# bestls
[](https://www.rust-lang.org/)
[](LICENSE)
[](https://github.com/MurtadaNazar/bestls/discussions)
[](docs/CHANGELOG.md)
A fast, colorful, and Rust-powered replacement for the traditional `ls` command.
`bestls` provides human-readable file listings in both pretty tables and JSON formats, with powerful filtering, tree view, and modern CLI conveniences built for speed and usability.
## âĻ Features
- ðĻ **Colorful output** - Beautiful colored tables with optional color controls
- ð **Multiple formats** - Tables, compact JSON, pretty JSON, or single-column compact mode
- ⥠**Blazing fast** - Parallel metadata fetching with Rayon
- ð **Human-readable** - File sizes in KB, MB, GB format with conversions
- ð§ **Flexible sorting** - Sort by name, size, or modification date
- ðģ **Tree view** - Recursive directory traversal with depth control
- ð **Smart filtering** - Filter by extension, pattern, and file size
- ðïļ **Hidden files** - View hidden files with `--all` flag
- ð **File permissions** - Unix-style permission display (rwxrwxrwx)
- ðĨ **Owner info** - File owner and group information
- ðĪ **Export data** - Save results to files, JSON formats for automation
- ð **Shell completion** - Tab-completion for Bash, Zsh, and Fish
- ðŠķ **Lightweight** - Single binary with no runtime dependencies
## ðĶ Installation
### From crates.io
```bash
cargo install bestls
```
### From source
```bash
git clone https://github.com/MurtadaNazar/bestls.git
cd bestls
cargo build --release
```
The binary will be available at `target/release/bestls`.
## ð Quick Start
### Basic Usage
```bash
# List current directory
bestls
# List specific directory
bestls -p /path/to/directory
# Include hidden files
bestls -a
# Sort by size
bestls --sort size
```
### Filtering & Tree View
```bash
# Show only Rust files
bestls --filter-ext rs
# Recursive tree view (limit depth to 2)
bestls --tree --depth 2
# Find files between 1KB and 10MB
bestls --min-size 1KB --max-size 10MB
# Pattern matching
bestls --filter-name "*.md"
```
### Output Options
```bash
# Compact single-column output
bestls --compact
# Export as JSON
bestls --format json --out results.json
# Pretty JSON
bestls --format json-pretty
# No colors (for piping/scripts)
bestls --no-color
```
### Advanced Examples
```bash
# Find large Rust files sorted by size
bestls -p src --filter-ext rs --min-size 5KB --sort size
# Export directory structure as JSON
bestls --tree --depth 3 --format json --out structure.json
# Filter markdown files and export
bestls --filter-ext md --json-pretty --out docs_list.json
```
### Shell Completions
Enable tab-completion in your shell:
```bash
# For Bash
bestls completion bash > ~/.local/share/bash-completion/completions/bestls
# For Zsh (add to .zshrc: fpath=(~/.zfunc $fpath))
bestls completion zsh > ~/.zfunc/_bestls
# For Fish
bestls completion fish > ~/.config/fish/completions/bestls.fish
```
## ð Documentation
- **[EXAMPLES.md](docs/EXAMPLES.md)** - Comprehensive usage examples and workflows
- **[CHANGELOG.md](docs/CHANGELOG.md)** - Version history and release notes
- **[CONTRIBUTING.md](docs/CONTRIBUTING.md)** - Guidelines for contributors
- **[ROADMAP.md](docs/ROADMAP.md)** - Planned features and development roadmap
- **[VERSION_POLICY.md](docs/VERSION_POLICY.md)** - Version management and release process
- **[IMPLEMENTATION_SUMMARY.md](docs/IMPLEMENTATION_SUMMARY.md)** - Technical implementation details
## ð ïļ Command Line Options
### Core Options
| `--path` | `-p` | Directory path to list |
| `--sort` | `-s` | Sort by: `name`, `size`, `date` |
| `--all` | `-a` | Show hidden files (starting with .) |
| `--help` | `-h` | Show help information |
| `--version` | `-V` | Show version information |
### Filtering Options
| `--tree` | Recursive directory listing |
| `--depth N` | Maximum recursion depth |
| `--filter-ext` | Filter by extensions (comma-separated) |
| `--filter-name` | Filter by filename pattern (glob-style) |
| `--min-size` | Minimum file size (e.g., 1KB, 1MB) |
| `--max-size` | Maximum file size (e.g., 10MB, 1GB) |
### Output Options
| `--format` | Output format: `table`, `json`, `json-pretty` |
| `--compact` | Single-column output mode |
| `--columns` | Select visible columns |
| `--out` | Export output to file |
| `--no-color` | Disable colored output |
| `--json` | Compact JSON (legacy) |
| `--json-pretty` | Pretty JSON (legacy) |
### Subcommands
| `completion`| Generate shell completions |
## ðïļ Building from Source
### Prerequisites
- Rust 1.85.0 or later
- Cargo package manager
### Build Steps
1. Clone the repository:
```bash
git clone https://github.com/MurtadaNazar/bestls.git
cd bestls
```
2. Build the project:
```bash
cargo build --release
```
3. (Optional) Install globally:
```bash
cargo install --path .
```
## ðŽ Community
Join our community discussions! We'd love to hear from you:
- ðĄ **[Ideas & Feature Requests](https://github.com/MurtadaNazar/bestls/discussions)** - Share your ideas for new features
- â **[Q&A](https://github.com/MurtadaNazar/bestls/discussions)** - Get help and ask questions
- ð ïļ **[Show and Tell](https://github.com/MurtadaNazar/bestls/discussions)** - Share how you're using bestls
- ðĒ **[Announcements](https://github.com/MurtadaNazar/bestls/discussions)** - Stay updated with the latest news
## ðĪ Contributing
Contributions are welcome! Please see [CONTRIBUTING.md](docs/CONTRIBUTING.md) for guidelines.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
For more details, see [CONTRIBUTING.md](docs/CONTRIBUTING.md).
## ð License
This project is licensed under:
- **MIT License** - See [LICENSE](LICENSE) for details
## ðĻâðŧ Author
### Murtaza Nazar
- Email: [mkm9284@gmail.com](mailto:mkm9284@gmail.com)
- GitHub: [@MurtadaNazar](https://github.com/MurtadaNazar)
## ð Links
- [Repository](https://github.com/MurtadaNazar/bestls)
- [Issues](https://github.com/MurtadaNazar/bestls/issues)
- [Releases](https://github.com/MurtadaNazar/bestls/releases)