{"id":43467260,"url":"https://github.com/razvanazamfirei/chezmoi-files","last_synced_at":"2026-02-18T04:01:26.352Z","repository":{"id":336171718,"uuid":"741238746","full_name":"razvanazamfirei/chezmoi-files","owner":"razvanazamfirei","description":"A command-line utility for generating colorized tree visualizations of file paths with glob pattern filtering and customizable colors","archived":false,"fork":false,"pushed_at":"2026-02-03T05:09:05.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-03T18:28:11.358Z","etag":null,"topics":["chezmoi","cli","command-line","dotfiles","filesystem","glob-patterns","rust","rust-cli","syntax-highlighting","tree","tree-visualization","visualization"],"latest_commit_sha":null,"homepage":"https://github.com/razvanazamfirei/chezmoi-files","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/razvanazamfirei.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-10T01:27:51.000Z","updated_at":"2026-02-03T05:09:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/razvanazamfirei/chezmoi-files","commit_stats":null,"previous_names":["razvanazamfirei/rust.chezmoi-files"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/razvanazamfirei/chezmoi-files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razvanazamfirei%2Fchezmoi-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razvanazamfirei%2Fchezmoi-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razvanazamfirei%2Fchezmoi-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razvanazamfirei%2Fchezmoi-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/razvanazamfirei","download_url":"https://codeload.github.com/razvanazamfirei/chezmoi-files/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razvanazamfirei%2Fchezmoi-files/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29567616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"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":["chezmoi","cli","command-line","dotfiles","filesystem","glob-patterns","rust","rust-cli","syntax-highlighting","tree","tree-visualization","visualization"],"created_at":"2026-02-03T06:40:56.048Z","updated_at":"2026-02-18T04:01:26.346Z","avatar_url":"https://github.com/razvanazamfirei.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chezmoi-files\n\n[![Crates.io](https://img.shields.io/crates/v/chezmoi-files.svg)](https://crates.io/crates/chezmoi-files)\n[![Documentation](https://docs.rs/chezmoi-files/badge.svg)](https://docs.rs/chezmoi-files)\n[![License](https://img.shields.io/crates/l/chezmoi-files.svg)](LICENSE)\n[![Rust Version](https://img.shields.io/badge/rust-1.92%2B-blue.svg)](https://www.rust-lang.org)\n\nA command-line utility and Rust library that generates colorized tree visualizations of file paths. It reads file paths\nfrom stdin, filters them based on configurable glob patterns, and outputs a hierarchical tree structure with\nsyntax-highlighted file names.\n\nPerfect for use with [chezmoi](https://www.chezmoi.io/) to visualize your dotfiles, or with any tool that outputs file\npaths. Can also be used as a library in your own Rust projects.\n\n## Features\n\n- **Glob Pattern Filtering**: Advanced pattern matching with wildcards (`*`, `?`, `[abc]`, `[a-z]`)\n- **Customizable Colors**: Configure colors for folders, files, and specific extensions\n- **Multiple Sorting Options**: Sort by name, type, or keep original order\n- **Statistics**: Display counts of files, directories, and excluded items\n- **Fast**: Optimized Rust implementation with minimal overhead\n- **Configurable**: Simple TOML configuration file\n- **Well-tested**: 89.61% code coverage with 83 tests\n\n## Installation\n\n### From crates.io\n\n```bash\ncargo install chezmoi-files\n```\n\n### From source\n\n```bash\ngit clone https://github.com/razvanazamfirei/chezmoi-files.git\ncd chezmoi-files\ncargo install --path .\n```\n\n### Pre-built binaries\n\nDownload pre-built binaries from the [releases page](https://github.com/razvanazamfirei/chezmoi-files/releases).\n\n## Usage\n\n### As a Command-Line Tool\n\nPipe file paths into the program:\n\n```bash\n# Basic usage\nfind . -type f | chezmoi-files\n\n# With chezmoi\nchezmoi managed | chezmoi-files\n\n# From a file list\ncat files.txt | chezmoi-files\n```\n\nThe program expects one file path per line on stdin. It will:\n\n1. Filter paths based on exclusion patterns\n2. Strip the current directory prefix to create relative paths\n3. Build a tree structure\n4. Display it with syntax-highlighted file names\n\n### Command-Line Options\n\n```bash\n# Disable colorized output\nfind . -type f | chezmoi-files --no-color\n\n# Show statistics (file and directory counts)\nchezmoi managed | chezmoi-files --stats\n\n# Sort output by name\nfind . -type f | chezmoi-files --sort name\n\n# Sort output by type (directories first, then by extension)\nfind . -type f | chezmoi-files --sort type\n\n# Combine options\nchezmoi managed | chezmoi-files --stats --sort name --no-color\n```\n\n### Configuration Commands\n\n```bash\n# Show current configuration location and contents\nchezmoi-files config\n\n# Output the default configuration\nchezmoi-files config --default\n\n# Initialize configuration file with defaults\nchezmoi-files config --init\n```\n\n### As a Library\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nchezmoi-files = \"0.7\"\n```\n\nUse in your code:\n\n```rust\nuse chezmoi_files::{TreeNode, ColorScheme, Config};\n\n// Create a tree structure\nlet mut root = TreeNode::new();\nroot.add_path(vec![\"src\", \"main.rs\"]);\nroot.add_path(vec![\"src\", \"lib.rs\"]);\nroot.add_path(vec![\"tests\", \"test.rs\"]);\n\n// Load configuration\nlet config = Config::default ();\n\n// Create color scheme\nlet color_scheme = ColorScheme::new();\n\n// Check if paths should be excluded\nif config.is_excluded(\"DS_Store\") {\nprintln ! (\"DS_Store files are excluded\");\n}\n```\n\nSee the [API documentation](https://docs.rs/chezmoi-files) for more details.\n\n## Configuration\n\nThe program reads configuration from:\n\n```\n~/.config/chezmoi/chezmoi-files.toml\n```\n\nAn example configuration file is provided as `chezmoi-files.toml.example`. Copy it to the config location and customize\nas needed.\n\n### Configuration Format\n\nThe config file uses TOML format with two sections:\n\n```toml\n[excluded-files]\nfiles = [\n    \"DS_Store\",\n    \"fish_variables\",\n    \".rubocop.yml\",\n    \".ruff_cache\",\n    \"yazi.toml-\",\n    \".zcompcache\",\n    \".zcompdump\",\n    \".zsh_history\",\n    \"plugins/fish\",\n    \"plugins/zsh\",\n]\n\n[included-files]\nfiles = []\n```\n\n### Pattern Matching\n\nPatterns support glob-style wildcards:\n\n- `*` - Matches any sequence of characters\n- `?` - Matches any single character\n- `[abc]` - Matches any character in the set\n- `[a-z]` - Matches any character in the range\n\nExamples:\n\n- `*.tmp` - Matches any file ending in `.tmp`\n- `cache/*` - Matches any file in a cache directory\n- `test_?.rs` - Matches `test_1.rs`, `test_a.rs`, etc.\n- `fish_variables*` - Matches `fish_variables`, `fish_variables.bak`, etc.\n\n**Exclusion Logic:**\n\n- Paths matching exclusion patterns are filtered out\n- Paths matching inclusion patterns override exclusions (whitelist)\n- Patterns without wildcards use substring matching for backward compatibility\n\n### Default Exclusions\n\nIf no config file exists, these patterns are excluded by default:\n\n- `DS_Store`\n- `fish_variables`\n- `.rubocop.yml`\n- `.ruff_cache`\n- `yazi.toml-`\n- `.zcompcache`\n- `.zcompdump`\n- `.zsh_history`\n- `plugins/fish`\n- `plugins/zsh`\n\n## Color Scheme\n\n### Default Colors\n\nFiles are colorized based on their extension:\n\n- **Folders**: White\n- **Shell scripts** (.sh, .bash, .zsh, .fish, .nu): Green\n- **Config files** (.toml, .yaml, .yml, .json, .xml, .ini, .conf): Yellow\n- **Documentation** (.md, .txt, .rst): Cyan\n- **Source code** (.rs, .py, .js, .ts, .go, .c, .cpp, .java, .jl): Red\n- **Plists** (.plist, .sublime): Magenta\n- **Default**: Blue\n\n### Customizing Colors\n\nYou can customize colors in the configuration file:\n\n```toml\n[colors]\nenabled = true\nfolder = \"white\"\ndefault-file = \"blue\"\n\n[colors.extensions]\n\".rs\" = \"red\"\n\".py\" = \"green\"\n\".md\" = \"cyan\"\n```\n\nAvailable color names: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`\n\nYou can also use custom ANSI codes for more control.\n\n## Examples\n\n### Basic directory tree\n\n```bash\necho -e \"src/main.rs\\nsrc/lib.rs\\ntests/test.rs\" | chezmoi-files\n```\n\nOutput:\n\n```\n.\n├── src\n│   ├── main.rs\n│   └── lib.rs\n└── tests\n    └── test.rs\n```\n\n### With chezmoi\n\n```bash\nchezmoi managed | chezmoi-files\n```\n\nThis displays all files managed by chezmoi in a tree structure, excluding patterns from your config file.\n\n## Requirements\n\n- Rust 1.92.0 or later\n- Input must be piped (the program will exit if stdin is a terminal)\n\n## Testing\n\nThe project has comprehensive test coverage with **83 tests** achieving **89.61% overall coverage**:\n\n```bash\n# Run all tests\ncargo test\n\n# Generate coverage report\ncargo llvm-cov --all-features --workspace --html\n```\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/razvanazamfirei/chezmoi-files.git\ncd chezmoi-files\n\n# Run tests\ncargo test\n\n# Run with coverage\ncargo llvm-cov --all-features --workspace --html\n\n# Run clippy\ncargo clippy --all-targets --all-features\n```\n\n## Similar Projects\n\n- [tree](https://linux.die.net/man/1/tree) - The classic Unix tree command\n- [eza](https://github.com/eza-community/eza) - Modern replacement for ls with tree view\n- [broot](https://github.com/Canop/broot) - Interactive tree view\n\n## License\n\nLicensed under the Apache License, Version 2.0 ([LICENSE](LICENSE) or http://www.apache.org/licenses/LICENSE-2.0)\n\n## Acknowledgments\n\n- Tree rendering algorithm derived from [eza](https://github.com/eza-community/eza) (MIT License)\n- Built with Rust's excellent ecosystem\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazvanazamfirei%2Fchezmoi-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazvanazamfirei%2Fchezmoi-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazvanazamfirei%2Fchezmoi-files/lists"}