Quick Start GuideΒΆ
This guide covers the essentials. After installing Recursivist, you can run it in any directory.
Visualize a DirectoryΒΆ
Display the current directory as a colored tree in the terminal:
Output:
π my-project
βββ π README.md
βββ π setup.py
βββ π requirements.txt
βββ π src
βββ π main.py
βββ π utils.py
βββ π tests
βββ π test_main.py
βββ π test_utils.py
Files are listed before subdirectories, and each file type is given its own color. To visualize a different directory, pass its path:
Show File StatisticsΒΆ
Display and sort by lines of code, file size, or modification time. The --sort-by-* flags both sort and annotate; the bare --loc/--size/--mtime flags annotate without reordering:
recursivist visualize --sort-by-loc # sort by and show lines of code
recursivist visualize --sort-by-size # sort by and show file sizes
recursivist visualize --sort-by-mtime # sort by and show modification times
recursivist visualize --sort-by-loc --size # sort by LOC, show LOC and size
Flags are read left to right: only the first sorting flag takes effect (a second --sort-by-* is ignored), and annotations appear in the order given.
With --sort-by-loc:
π my-project (1262 lines)
βββ π README.md (124 lines)
βββ π setup.py (65 lines)
βββ π requirements.txt (18 lines)
βββ π src (1055 lines)
βββ π main.py (245 lines)
βββ π utils.py (157 lines)
βββ π tests (653 lines)
βββ π test_main.py (412 lines)
βββ π test_utils.py (241 lines)
Show Git StatusΒΆ
Annotate files with their Git status when the directory is inside a repository:
Markers are [U] untracked, [M] modified, [A] added, and [D] deleted.
Export a Directory StructureΒΆ
Export to one or more of txt, json, html, md, svg, or rst (Markdown is the default):
recursivist export # Markdown (structure.md)
recursivist export --format html
recursivist export --format json
recursivist export --format "txt md json" # multiple at once
Compare Two DirectoriesΒΆ
Show two structures side by side with differences highlighted:
Save the comparison as an HTML file instead of printing it:
Scan a GitHub RepositoryΒΆ
visualize, export, and compare accept a GitHub repository URL wherever they accept a directory:
recursivist visualize https://github.com/owner/repo
recursivist export https://github.com/owner/repo --format md
recursivist compare ./my-fork https://github.com/owner/repo
Add a /tree/<ref> selector to pin a branch, tag, or commit (optionally followed by a subtree to scan), and set GITHUB_TOKEN (or GH_TOKEN) to raise rate limits and reach private repositories. See the CLI Reference for the accepted URL forms and the options that apply to a GitHub input.
Common OptionsΒΆ
These options work across visualize, export, and compare:
# Exclude directories
recursivist visualize --exclude node_modules --exclude .git
# Exclude file extensions (leading dot optional)
recursivist visualize --exclude-ext .pyc --exclude-ext .log
# Exclude by glob pattern (default) or regex (--regex)
recursivist visualize --exclude-pattern "*.test.js"
recursivist visualize --exclude-pattern "^test_.*\.py$" --regex
# Include only matching files
recursivist visualize --include-pattern "*.py" --include-pattern "*.md"
# Respect a .gitignore-style file
recursivist visualize --ignore-file .gitignore
# Limit traversal depth
recursivist visualize --depth 2
# Show full paths instead of bare filenames
recursivist visualize --full-path
Shell CompletionΒΆ
Recursivist supports tab completion for Bash, Zsh, Fish, and PowerShell. The quickest setup uses Typer's built-in installer:
See the Shell Completion guide for per-shell instructions.
Next StepsΒΆ
- Visualization β customize terminal output
- Pattern Filtering β precise include/exclude control
- Export Formats β every output format in detail
- CLI Reference β all commands and options