Basic ExamplesΒΆ
This page provides simple examples of common Recursivist usage patterns. These examples are designed to help you get familiar with the basic capabilities of the tool.
Simple VisualizationΒΆ
Viewing the Current DirectoryΒΆ
To visualize the current directory structure:
This will produce output similar to:
π my-project
βββ π src
β βββ π main.py
β βββ π utils.py
β βββ π tests
β βββ π test_main.py
β βββ π test_utils.py
βββ π README.md
βββ π requirements.txt
βββ π setup.py
Viewing a Specific DirectoryΒΆ
To visualize a different directory:
Limiting Directory DepthΒΆ
To limit the depth of the directory tree (useful for large projects):
Output:
π my-project
βββ π src
β βββ π main.py
β βββ π utils.py
β βββ π tests
β β― (max depth reached)
βββ π README.md
βββ π requirements.txt
βββ π setup.py
Showing Full PathsΒΆ
To show full file paths instead of just filenames:
Output:
π my-project
βββ π src
β βββ π /home/user/my-project/src/main.py
β βββ π /home/user/my-project/src/utils.py
β βββ π tests
β βββ π /home/user/my-project/src/tests/test_main.py
β βββ π /home/user/my-project/src/tests/test_utils.py
βββ π /home/user/my-project/README.md
βββ π /home/user/my-project/requirements.txt
βββ π /home/user/my-project/setup.py
File StatisticsΒΆ
Showing Lines of CodeΒΆ
To display and sort by lines of code:
Output:
π my-project (4328 lines)
βββ π src (3851 lines)
β βββ π main.py (245 lines)
β βββ π utils.py (157 lines)
β βββ π tests (653 lines)
β βββ π test_main.py (412 lines)
β βββ π test_utils.py (241 lines)
βββ π README.md (124 lines)
βββ π requirements.txt (18 lines)
βββ π setup.py (65 lines)
Showing File SizesΒΆ
To display and sort by file sizes:
Output:
π my-project (1.2 MB)
βββ π src (850.5 KB)
β βββ π main.py (12.4 KB)
β βββ π utils.py (8.2 KB)
β βββ π tests (45.7 KB)
β βββ π test_main.py (28.9 KB)
β βββ π test_utils.py (16.8 KB)
βββ π README.md (4.2 KB)
βββ π requirements.txt (512 B)
βββ π setup.py (3.8 KB)
Showing Modification TimesΒΆ
To display and sort by modification times:
Output:
π my-project (Today 14:30)
βββ π src (Today 14:25)
β βββ π main.py (Today 14:25)
β βββ π utils.py (Yesterday 18:10)
β βββ π tests (Feb 15)
β βββ π test_main.py (Feb 15)
β βββ π test_utils.py (Feb 10)
βββ π README.md (Today 10:15)
βββ π requirements.txt (Jan 20)
βββ π setup.py (Jan 15)
Combining StatisticsΒΆ
To show multiple statistics at once:
Output:
π my-project (4328 lines, 1.2 MB)
βββ π src (3851 lines, 850.5 KB)
β βββ π main.py (245 lines, 12.4 KB)
...
Simple ExclusionsΒΆ
Excluding Specific DirectoriesΒΆ
To exclude directories like node_modules or .git:
Excluding File ExtensionsΒΆ
To exclude files with specific extensions:
Combining ExclusionsΒΆ
You can combine different exclusion methods:
Basic ExportsΒΆ
Exporting to MarkdownΒΆ
To export the current directory structure to Markdown:
This creates a file named structure.md in the current directory.
Exporting to Multiple FormatsΒΆ
To export to multiple formats at once:
Exporting to a Specific DirectoryΒΆ
To export to a different directory:
Customizing the FilenameΒΆ
To use a custom filename prefix:
This creates a file named my-project.json.
Exporting with StatisticsΒΆ
To include file statistics in the export:
Simple ComparisonsΒΆ
Comparing Two DirectoriesΒΆ
To compare two directories:
This displays a side-by-side comparison in the terminal.
Exporting a ComparisonΒΆ
To save the comparison as an HTML file:
This creates a file named comparison.html in the current directory.
Comparing with StatisticsΒΆ
To include file statistics in the comparison:
This makes it easy to see not just structural differences but also differences in code volume.
Shell CompletionΒΆ
Generating Shell Completion for BashΒΆ
mkdir -p ~/.bash_completion.d
recursivist completion bash > ~/.bash_completion.d/recursivist
source ~/.bash_completion.d/recursivist
Generating Shell Completion for ZshΒΆ
Then add to your .zshrc:
Version InformationΒΆ
To check the version of Recursivist:
Next StepsΒΆ
These basic examples should help you get started with Recursivist. For more advanced examples, check out:
- Filtering Examples - More complex pattern matching
- Export Examples - Advanced export options
- Compare Examples - In-depth comparison examples
- Advanced Examples - Advanced usage patterns