A command-line tool for displaying directory structures with various filtering and formatting options.
To install SSP, you need to have Rust installed on your system. Clone the repository and build the project:
git clone <repository-url>
cd ssp
cargo build --release
The executable will be located at target/release/ssp
.
ssp [OPTIONS] [DIRECTORY]
If no directory is specified, SSP will display the structure of the current working directory.
Flag | Long Form | Description | Example |
---|---|---|---|
-i |
--ignore |
Ignore specified folder | ssp -i node_modules |
-of |
--only-folders |
Show only directories | ssp -of |
-l |
--lines |
Show line count for files | ssp -l |
-e |
--extension |
Filter by file extension | ssp -e rs |
-d |
--depth |
Limit display depth | ssp -d 2 |
-h |
--help |
Show help message | ssp -h |
Ignores specified folders when displaying the directory structure. You can specify multiple folders by using the flag multiple times.
Default ignored folders: .git
, node_modules
, __pycache__
Displays only directories, excluding all files from the output.
Shows the number of lines in each file alongside the filename. This is particularly useful for code analysis.
Filters files to show only those with the specified extension. For example, -e rs
will show only Rust files.
Limits the depth of directory traversal. For example, -d 2
will show only up to 2 levels deep.
Displays the help message with usage instructions.
# Display current directory structure
ssp
# Display specific directory structure
ssp /path/to/project
# Show only folders
ssp -of
# Show only .rs files with line counts
ssp -l -e rs
# Ignore multiple folders
ssp -i node_modules -i target -i .git
# Limit depth to 2 levels
ssp -d 2
# Combine multiple options
ssp -of -d 3 -i build
Basic output:
project/
├── src
│ ├── main.rs
│ └── utils.rs
├── tests
│ └── integration.rs
├── Cargo.toml
└── README.md
With line counts:
project/
├── src
│ ├── main.rs (150)
│ └── utils.rs (75)
├── tests
│ └── integration.rs (200)
├── Cargo.toml (25)
└── README.md (50)
Only folders with limited depth:
project/
├── src
│ ├── main
│ └── utils
└── docs
├── api
└── guides
SSP displays directory structures using Unicode tree characters for clear visualization:
├──
for items with siblings below└──
for the last item in a directory│
for vertical continuation lines
Entries are automatically sorted with directories appearing first, followed by files, both in alphabetical order.
SSP automatically ignores common development folders:
.git
- Git metadatanode_modules
- Node.js dependencies__pycache__
- Python cache files
Works on Windows, macOS, and Linux systems.
SSP currently doesn't require any configuration files. All settings are passed through command-line arguments.
SSP provides clear error messages for common issues:
- Non-existent path:
Error: Path 'nonexistent' does not exist
- Not a directory:
Error: 'file.txt' is not a directory
- Missing argument:
Error: --ignore flag requires an argument
- Invalid depth:
Error: --depth flag requires a numeric value
- Unknown flag:
Unknown flag: --invalid
- Permission denied: Appropriate system error messages
- Read errors:
Failed to read directory
with details
- SSP reads directory entries only when needed for display
- Large directories with many files may take longer to process
- Line counting for the
--lines
option requires reading entire files
- Does not follow symbolic links to avoid infinite loops
- Unicode tree characters may not display properly in all terminals
- Line counting is based on newline characters and may not match IDE counts exactly
To contribute to SSP:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Initial release
- Basic directory structure display
- Support for filtering options
- Line counting functionality
- Depth limiting
- Cross-platform support
Tree characters not displaying correctly:
- Ensure your terminal supports Unicode
- Check your locale settings
Performance issues with large directories:
- Use
--depth
to limit traversal - Use
--ignore
to skip large dependency folders
Permission errors:
- Run with appropriate permissions
- Use
--ignore
to skip inaccessible directories
For additional help, use the --help
flag or check this documentation. For bug reports, please open an issue on the project repository.
Distributed under the MIT License. See LICENSE file for details.