{"id":28935008,"url":"https://github.com/thealphamerc/treecraft","last_synced_at":"2026-04-18T12:04:18.136Z","repository":{"id":280334224,"uuid":"941617803","full_name":"TheAlphamerc/treecraft","owner":"TheAlphamerc","description":"A simple CLI for directory visualization, generation, and analysis, designed for developers and testers.","archived":false,"fork":false,"pushed_at":"2025-05-11T08:17:39.000Z","size":293,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-14T04:27:15.638Z","etag":null,"topics":["cli","nodejs","tree-export","tree-list","tree-stats","tree-structure","tree-view-cli"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/treecraft","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheAlphamerc.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-02T17:56:09.000Z","updated_at":"2025-05-11T08:07:52.000Z","dependencies_parsed_at":"2025-03-07T15:37:27.602Z","dependency_job_id":null,"html_url":"https://github.com/TheAlphamerc/treecraft","commit_stats":null,"previous_names":["thealphamerc/gen-struct","thealphamerc/treecraft"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheAlphamerc/treecraft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Ftreecraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Ftreecraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Ftreecraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Ftreecraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheAlphamerc","download_url":"https://codeload.github.com/TheAlphamerc/treecraft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Ftreecraft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31967994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","nodejs","tree-export","tree-list","tree-stats","tree-structure","tree-view-cli"],"created_at":"2025-06-22T19:09:09.777Z","updated_at":"2026-04-18T12:04:18.129Z","avatar_url":"https://github.com/TheAlphamerc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TreeCraft\n\nA powerful CLI for directory visualization, generation, and analysis, designed for developers and testers.\n\n\u003e **For complete documentation with all options and detailed examples, see [DOCUMENTATION.md](DOCUMENTATION.md)**\n\n## Installation\n\n```bash\n# Install globally\nnpm install -g treecraft\n\n# Or use directly from the repo\ngit clone https://github.com/TheAlphamerc/treecraft.git\ncd treecraft\nnpm install\nnpm run build\n```\n\n## Commands\n\n### `viz [path]`\nVisualize directory structure in various formats.\n\n- `-m, --mode \u003cmode\u003e`: Visualization mode [default: tree]\n  - `tree`: Traditional ASCII tree structure\n  - `graph`: Hierarchical graph with weighted branches\n  - `list`: Flat list of all paths\n  - `interactive`: Browse directories and files interactively\n- `-d, --depth \u003cn\u003e`: Limit depth (e.g., 2)\n- `-e, --exclude \u003cpatterns\u003e`: Exclude patterns (comma-separated, e.g., \"node_modules,dist\")\n- `-f, --filter \u003cpatterns\u003e`: Filter patterns (comma-separated, e.g., \"*.ts,*.js\")\n- `-c, --color`: Enable colored output\n- `-x, --export \u003cformat\u003e`: Export as text, json, or yaml\n- `--with-metadata`: Include size and modification time\n- `-o, --output-file \u003cfile\u003e`: Write output to file\n\n**Examples:**\n```bash\n# Default tree view with colors\ntreecraft viz . -c\n\n# Graph visualization with metadata\ntreecraft viz ./src -m graph --with-metadata\n\n# Interactive directory browser\ntreecraft viz . -m interactive\n\n# Export filtered JSON\ntreecraft viz ./src -f \"*.ts\" -x json -o src.json\n\n# Limit depth and exclude directories\ntreecraft viz . -d 1 -e \"dist,node_modules\"\n```\n\n### `gen \u003cinput\u003e -o \u003cpath\u003e`\nGenerate directory structure from a specification file.\n\n- `-o, --output \u003cpath\u003e`: Output directory (required)\n- `-s, --skip-all`: Skip existing files/directories\n- `-w, --overwrite-all`: Overwrite existing files/directories\n\n**Supported Input Formats:**\n- JSON: Nested object structure\n- YAML: Nested object structure\n- Text: ASCII tree format\n\n**Examples:**\n```bash\n# Generate from JSON specification\ntreecraft gen spec.json -o ./project\n\n# Generate with conflict resolution\ntreecraft gen spec.yaml -o ./project -s  # Skip existing files\n\n# Generate with overwrite\ntreecraft gen spec.txt -o ./project -w   # Overwrite existing files\n```\n\n**Example Specification (JSON):**\n```json\n{\n  \"src\": {\n    \"index.ts\": \"console.log('Hello World');\",\n    \"utils\": {\n      \"helpers.ts\": \"export function add(a, b) { return a + b; }\"\n    }\n  },\n  \"package.json\": \"{\\\"name\\\": \\\"example\\\", \\\"version\\\": \\\"1.0.0\\\"}\"\n}\n```\n\n### `stats [path]`\nAnalyze and display directory statistics.\n\n- `-s, --size-dist`: Show size distribution (\u003c1KB, 1KB-1MB, \u003e1MB)\n- `-x, --export \u003cformat\u003e`: Export as text, json, or yaml\n- `-f, --filter \u003cpatterns\u003e`: Filter patterns (comma-separated)\n- `-e, --exclude \u003cpatterns\u003e`: Exclude patterns (comma-separated)\n- `-d, --depth \u003cn\u003e`: Limit depth for statistics\n- `-t, --file-types`: Show file type breakdown\n- `-r, --sort \u003ckey\u003e`: Sort distribution by size or count [default: count]\n\n**Examples:**\n```bash\n# Basic statistics\ntreecraft stats .\n\n# Comprehensive statistics for JavaScript files\ntreecraft stats . -s -t -f \"*.js\"\n\n# Export statistics as JSON\ntreecraft stats . -x json -o stats.json\n\n# Sort size distribution by size\ntreecraft stats . -s -r size\n```\n\n### `search [path] \u003cquery\u003e`\nSearch for files by name.\n\n- `-t, --ext \u003cextension\u003e`: Filter by file extension (e.g., \".ts\", \".js\")\n- `-d, --depth \u003cn\u003e`: Limit search depth\n- `-f, --filter \u003cpatterns\u003e`: Include only specific patterns\n- `-e, --exclude \u003cpatterns\u003e`: Exclude patterns\n- `-x, --export \u003cformat\u003e`: Export results as text, json, or yaml\n\n**Examples:**\n```bash\n# Basic search\ntreecraft search . utils\n\n# Search only TypeScript files\ntreecraft search . utils -t \".ts\"\n\n# Export search results\ntreecraft search . config -x yaml \u003e results.yaml\n```\n\n## Visualization Modes\n\n### Tree Mode\nThe default visualization mode, displaying a traditional ASCII tree structure.\n\n```\n├── src\n│   ├── components\n│   │   └── Button.tsx\n│   └── index.ts\n└── package.json\n```\n\n### Graph Mode\nA hierarchical graph with weighted branches. Larger directories are shown first.\n\n```\nRoot\n  ├── src\n  │     ├── components\n  │     │       └── Button.tsx\n  │     └── index.ts\n  └── package.json\n```\n\nWith metadata:\n```\nRoot\n  ├── src [D, 4096B]\n  │     ├── components [D, 4096B]\n  │     │       └── Button.tsx [F, 256B]\n  │     └── index.ts [F, 128B]\n  └── package.json [F, 512B]\n```\n\n### List Mode\nA flat list of all paths in the directory structure.\n\n```\nsrc\nsrc/components\nsrc/components/Button.tsx\nsrc/index.ts\npackage.json\n```\n\n### Interactive Mode\nAn interactive browser that allows navigation through the directory structure using arrow keys and Enter.\n\n## File Format Support\n\n### Input Formats (for gen command)\n- **JSON**: Nested object structure\n- **YAML**: Nested object structure\n- **Text**: ASCII tree format\n\n### Export Formats (for all commands)\n- **Text**: Human-readable formatted output\n- **JSON**: Machine-readable JSON format\n- **YAML**: Human-readable YAML format\n\n## Error Handling\n\nTreeCraft provides detailed error messages for various scenarios:\n- Invalid paths or non-existent directories\n- Permission issues\n- Format validation errors\n- Input/output conflicts\n\n## Documentation\n\nFor complete documentation of all features, options, and advanced usage examples, refer to [DOCUMENTATION.md](DOCUMENTATION.md).\n\n## Contributing\n\n1. Clone: `git clone https://github.com/TheAlphamerc/treecraft.git`\n2. Install: `npm install`\n3. Build: `npm run build`\n4. Test: `npm test`\n\n### Running Tests\nThe project uses Jest for testing. Run tests with:\n\n```bash\nnpm test              # Run all tests\nnpm test -- [pattern] # Run specific tests\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealphamerc%2Ftreecraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthealphamerc%2Ftreecraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealphamerc%2Ftreecraft/lists"}