55[ ![ codecov] ( https://codecov.io/gh/oyal/tree-cli-tool/branch/main/graph/badge.svg )] ( https://codecov.io/gh/oyal/tree-cli-tool )
66[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
77
8- 一个功能强大的命令行工具,用于显示目录树状结构,支持多种配置选项和输出格式。
8+ A powerful command-line tool to display directory tree structure with various configuration options and output formats.
99
10- ## 安装
10+ ** [ 中文文档] ( README.zh-CN.md ) **
11+
12+ ## Installation
1113
1214``` bash
1315npm install -g tree-cli-tool
1416```
1517
16- ## 基本用法
18+ ## Basic Usage
1719
1820``` bash
19- # 显示当前目录的树状结构
21+ # Display tree structure of current directory
2022tree-cli
2123
22- # 显示指定目录的树状结构
24+ # Display tree structure of specified directory
2325tree-cli /path/to/directory
2426
25- # 限制遍历深度
27+ # Limit traversal depth
2628tree-cli -d 3
2729
28- # 显示文件大小
30+ # Show file sizes
2931tree-cli -s
3032
31- # 输出为 JSON 格式
33+ # Output as JSON format
3234tree-cli -f json
3335
34- # 排除特定文件/目录
36+ # Exclude specific files/directories
3537tree-cli -e " node_modules" " *.log" " .git"
3638```
3739
38- ## 命令选项
40+ ## Command Options
3941
40- ### 基本选项
42+ ### Basic Options
4143
42- - ` [path] ` - 目标目录路径(默认:当前目录)
43- - ` -d, --max-depth <number> ` - 最大遍历深度, -1 表示无限制(默认:-1)
44- - ` -f, --format <type> ` - 输出格式: text|json|markdown(默认: text)
44+ - ` [path] ` - Target directory path (default: current directory)
45+ - ` -d, --max-depth <number> ` - Maximum traversal depth, -1 for unlimited (default: -1)
46+ - ` -f, --format <type> ` - Output format: text|json|markdown (default: text)
4547
46- ### 过滤选项
48+ ### Filter Options
4749
48- - ` -e, --exclude <patterns...> ` - 排除模式(支持 glob 风格)
49- - ` --include-types <types...> ` - 只包含指定文件类型(扩展名)
50- - ` --exclude-types <types...> ` - 排除指定文件类型(扩展名)
51- - ` -i, --ignore-pattern <regex> ` - 正则表达式忽略模式
50+ - ` -e, --exclude <patterns...> ` - Exclude patterns (supports glob style)
51+ - ` --include-types <types...> ` - Include only specified file types (extensions)
52+ - ` --exclude-types <types...> ` - Exclude specified file types (extensions)
53+ - ` -i, --ignore-pattern <regex> ` - Regular expression ignore pattern
5254
53- ### 显示选项
55+ ### Display Options
5456
55- - ` -a, --show-hidden ` - 显示隐藏文件和目录
56- - ` -s, --show-size ` - 显示文件大小
57- - ` --show-date ` - 显示修改时间
58- - ` -D, --dirs-only ` - 只显示目录
59- - ` --no-color ` - 禁用彩色输出
57+ - ` -a, --show-hidden ` - Show hidden files and directories
58+ - ` -s, --show-size ` - Show file sizes
59+ - ` --show-date ` - Show modification times
60+ - ` -D, --dirs-only ` - Show directories only
61+ - ` --no-color ` - Disable colored output
6062
61- ### 输出选项
63+ ### Output Options
6264
63- - ` -o, --output <file> ` - 输出到文件而不是标准输出
65+ - ` -o, --output <file> ` - Output to file instead of stdout
6466
65- ## 预设命令
67+ ## Preset Commands
6668
67- ### quick 命令
69+ ### quick Command
6870
69- 快速查看目录结构,自动排除常见的构建目录:
71+ Quick directory structure view, automatically excludes common build directories:
7072
7173``` bash
7274tree-cli quick [path] [-d depth]
7375```
7476
75- 自动排除: ` node_modules ` , ` .git ` , ` dist ` , ` build ` , ` .next ` , ` .nuxt `
77+ Automatically excludes: ` node_modules ` , ` .git ` , ` dist ` , ` build ` , ` .next ` , ` .nuxt `
7678
77- ### dev 命令
79+ ### dev Command
7880
79- 开发者友好的视图,排除更多构建和缓存目录:
81+ Developer-friendly view, excludes more build and cache directories:
8082
8183``` bash
8284tree-cli dev [path] [-d depth]
8385```
8486
85- 自动排除: ` node_modules ` , ` .git ` , ` dist ` , ` build ` , ` .next ` , ` .nuxt ` , ` coverage ` , ` .nyc_output ` , ` .cache ` , ` tmp ` , ` temp ` , ` *.log ` , ` .DS_Store ` , ` Thumbs.db `
87+ Automatically excludes: ` node_modules ` , ` .git ` , ` dist ` , ` build ` , ` .next ` , ` .nuxt ` , ` coverage ` , ` .nyc_output ` , ` .cache ` , ` tmp ` , ` temp ` , ` *.log ` , ` .DS_Store ` , ` Thumbs.db `
8688
87- ## 使用示例
89+ ## Usage Examples
8890
89- ### 1. 基本目录树
91+ ### 1. Basic Directory Tree
9092
9193``` bash
9294tree-cli
9395```
9496
95- ### 2. 限制深度并显示文件大小
97+ ### 2. Limit Depth and Show File Sizes
9698
9799``` bash
98100tree-cli -d 2 -s
99101```
100102
101- ### 3. 只显示 JavaScript 和 TypeScript 文件
103+ ### 3. Show Only JavaScript and TypeScript Files
102104
103105``` bash
104106tree-cli --include-types js ts jsx tsx
105107```
106108
107- ### 4. 排除特定目录和文件类型
109+ ### 4. Exclude Specific Directories and File Types
108110
109111``` bash
110112tree-cli -e " node_modules" " dist" --exclude-types log tmp
111113```
112114
113- ### 5. 输出为 JSON 格式
115+ ### 5. Output as JSON Format
114116
115117``` bash
116118tree-cli -f json -o tree.json
117119```
118120
119- ### 6. 使用正则表达式排除文件
121+ ### 6. Use Regular Expression to Exclude Files
120122
121123``` bash
122124tree-cli -i " test.*\\ .js$"
123125```
124126
125- ### 7. 开发者模式查看项目结构
127+ ### 7. Developer Mode View Project Structure
126128
127129``` bash
128130tree-cli dev -d 3
129131```
130132
131- ## 输出格式
133+ ## Output Formats
132134
133- ### Text 格式(默认)
135+ ### Text Format (Default)
134136
135137```
136138project/
@@ -144,7 +146,7 @@ project/
1441462 directories, 3 files
145147```
146148
147- ### JSON 格式
149+ ### JSON Format
148150
149151``` json
150152{
@@ -162,7 +164,7 @@ project/
162164}
163165```
164166
165- ### Markdown 格式
167+ ### Markdown Format
166168
167169``` markdown
168170# Directory Tree: project
@@ -181,7 +183,7 @@ project/
181183- **Files**: 3
182184```
183185
184- ## 作为 Node.js 模块使用
186+ ## Use as Node.js Module
185187
186188``` javascript
187189import { generateTree } from ' tree-cli-tool' ;
@@ -198,70 +200,70 @@ console.log(result.formatted);
198200console .log (' Stats:' , result .stats );
199201```
200202
201- ## 开发
203+ ## Development
202204
203- ### 本地开发
205+ ### Local Development
204206
205207``` bash
206- # 克隆仓库
208+ # Clone repository
207209git clone https://github.com/oyal/tree-cli-tool.git
208210cd tree-cli-tool
209211
210- # 安装依赖
212+ # Install dependencies
211213npm install
212214
213- # 开发模式运行
215+ # Run in development mode
214216npm run dev
215217
216- # 构建项目
218+ # Build project
217219npm run build
218220
219- # 运行测试
221+ # Run tests
220222npm test
221223
222- # 代码格式化
224+ # Format code
223225npm run format
224226
225- # 检查代码格式
227+ # Check code formatting
226228npm run format:check
227229```
228230
229- ### 代码质量保证
231+ ### Code Quality Assurance
230232
231- 项目配置了以下代码质量工具:
233+ The project is configured with the following code quality tools:
232234
233- - ** Prettier** : 代码格式化
234- - ** GitHub Actions** : 自动化 CI/CD 流程
235+ - ** Prettier** : Code formatting
236+ - ** GitHub Actions** : Automated CI/CD pipeline
235237
236- ** 代码质量检查 ** 在以下时机自动运行:
238+ ** Code quality checks ** run automatically at:
237239
238- 1 . GitHub Actions CI 流程中
239- 2 . 发布前自动检查( prepublishOnly)
240+ 1 . GitHub Actions CI pipeline
241+ 2 . Pre-publish checks ( prepublishOnly)
240242
241- ### 发布流程
243+ ### Publishing Process
242244
243- 本项目使用 GitHub Actions 自动化发布流程:
245+ This project uses GitHub Actions for automated publishing:
244246
245- 1 . ** 自动发布 ** (推荐):
246- - 进入 GitHub Actions 页面
247- - 选择 "Publish" 工作流
248- - 选择版本类型 (patch/minor/major)
249- - 点击运行
247+ 1 . ** Automated Publishing ** (Recommended):
248+ - Go to GitHub Actions page
249+ - Select "Publish" workflow
250+ - Choose version type (patch/minor/major)
251+ - Click run
250252
251- 2 . ** 手动发布 ** :
253+ 2 . ** Manual Publishing ** :
252254 ``` bash
253- npm version patch # 或 minor, major
255+ npm version patch # or minor, major
254256 git push origin main --tags
255257 ```
256258
257- ### 贡献指南
259+ ### Contributing
258260
259- 1 . Fork 本仓库
260- 2 . 创建功能分支 (` git checkout -b feature/amazing-feature ` )
261- 3 . 提交更改 (` git commit -m 'Add some amazing feature' ` )
262- 4 . 推送到分支 (` git push origin feature/amazing-feature ` )
263- 5 . 创建 Pull Request
261+ 1 . Fork this repository
262+ 2 . Create a feature branch (` git checkout -b feature/amazing-feature ` )
263+ 3 . Commit your changes (` git commit -m 'Add some amazing feature' ` )
264+ 4 . Push to the branch (` git push origin feature/amazing-feature ` )
265+ 5 . Create a Pull Request
264266
265- ## 许可证
267+ ## License
266268
267- MIT
269+ MIT
0 commit comments