folder-tree-generator

TotalClaw 作者 totalclaw

生成目录结构的 ASCII 树或 JSON 表示形式。当您需要可视化文件层次结构、文档文件夹内容或调试目录布局时使用。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~wanng-ide-folder-tree-generator
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~wanng-ide-folder-tree-generator/file -o wanng-ide-folder-tree-generator.md
## 概述(中文)

生成目录结构的 ASCII 树或 JSON 表示形式。当您需要可视化文件层次结构、文档文件夹内容或调试目录布局时使用。

## 原文

# Folder Tree Generator

A utility skill to visualize directory structures in ASCII tree format or JSON.

## Usage

```bash
# Generate ASCII tree for current directory
node skills/folder-tree-generator/index.js

# Generate ASCII tree for specific directory
node skills/folder-tree-generator/index.js /path/to/dir

# Generate JSON output
node skills/folder-tree-generator/index.js --json

# Limit depth
node skills/folder-tree-generator/index.js --depth 2
```

## Options

- `--json`: Output as JSON.
- `--depth <n>`: Limit recursion depth.
- `[dir]`: Directory to scan (default: `.`).

## Examples

**ASCII Output:**
```
.
├── file1.txt
└── dir1
    ├── file2.txt
    └── file3.txt
```

**JSON Output:**
```json
{
  "name": ".",
  "type": "directory",
  "children": [
    { "name": "file1.txt", "type": "file" },
    { "name": "dir1", "type": "directory", "children": [...] }
  ]
}
```