智能树
STDIO超快目录可视化工具,带交互界面和AI优化
超快目录可视化工具,带交互界面和AI优化
Smart Tree is a blazingly fast, AI-friendly directory visualization tool that's 10-24x faster than traditional
tree. Now with Spicy TUI mode for cyberpunk-cool directory browsing, Smart Tips, and MCP Hook Management! Built with Rust for maximum performance and featuring revolutionary compression algorithms.
| Feature | Description | Command | 
|---|---|---|
| 🌶️ Spicy TUI | Interactive terminal UI with fuzzy search & M8 caching | st --spicy | 
| 💡 Smart Tips | Helpful hints that appear at the top | st --tips on/off | 
| 🎣 MCP Hooks | Programmatic Claude Code hook management | Via MCP tools | 
| 🎸 Marqant Compression | 70-90% markdown compression | mq compress file.md | 
| 🌊 SSE Streaming | Real-time directory monitoring | st --sse | 
| 🧬 M8 Identity | Filesystem verification & caching | m8 init | 
| 🌲 Tree-Sitter | AST-aware code editing | st --mode edit | 
# Install Smart Tree (choose your method) # Option 1: Homebrew (builds from source) brew install --HEAD --formula https://raw.githubusercontent.com/8b-is/smart-tree/main/Formula/smart-tree.rb # Option 2: Install script (downloads binary) curl -sSL https://raw.githubusercontent.com/8b-is/smart-tree/main/scripts/install.sh | bash # Option 3: Cargo (builds from source) cargo install --git https://github.com/8b-is/smart-tree --tag v5.2.0 st # 🎉 Experience the magic! st # Classic tree view st --spicy # 🌶️ NEW: Spicy interactive TUI mode! st --mode ai --compress # AI-optimized (80% smaller) st --mode quantum # Quantum compression (100x smaller!) st --search "TODO" # Lightning-fast content search
Experience directory browsing like never before with our cyberpunk-inspired terminal UI:
st --spicy
/ - Search file names with fuzzy matchingCtrl+F - Search file content across the tree←/h - Collapse directory or go to parent→/l - Expand directory or enter↑↓/jk - Navigate up/downartem)j/k or ↑↓ - Move selection up/downh/l or ←→ - Collapse/expand directories (tree navigation!)Enter - Open selected item/ - Fuzzy search file namesCtrl+F - Search content within filesEsc - Exit search modeCtrl+H - Toggle hidden filesCtrl+S - Save search results to M8 context? or F1 - Toggle help overlayq or Esc - QuitSmart Tree now shows helpful tips at the top of the output!
st --tips off # Disable tips st --tips on # Re-enable tips
~/.st/tips_state.jsonExample tip:
──── 🚀 Speed tip - Use --mode quantum for 100x compression! ─── --tips off ───
Control Claude Code hooks programmatically via MCP tools:
// List all hooks hooks {operation:'list'} // Enable Smart Tree context hook hooks {operation:'set', hook_type:'UserPromptSubmit', enabled:true} // Test a hook hooks {operation:'test', hook_type:'UserPromptSubmit', input:'analyze /src'}
The hooks provide:
| Directory Size | tree | exa --tree | Smart Tree | Speedup | 
|---|---|---|---|---|
| Small (100 files) | 15ms | 25ms | 2ms | 7.5x | 
| Medium (10K files) | 450ms | 380ms | 35ms | 12.8x | 
| Large (100K files) | 4.8s | 3.2s | 198ms | 24.2x | 
| Massive (1M files) | 45s | 28s | 1.9s | 23.7x | 
--mode classic): Traditional tree view--mode ai): Compressed for LLM context windows--mode quantum): Maximum compression using wave functions--mode markdown): Beautiful documentation format--mode mermaid): Flowchart diagrams# Direct formula installation (no tap needed!) brew install --HEAD --formula https://raw.githubusercontent.com/8b-is/smart-tree/main/Formula/smart-tree.rb
git clone https://github.com/8b-is/smart-tree cd smart-tree cargo build --release sudo cp target/release/st /usr/local/bin/ sudo cp target/release/mq /usr/local/bin/ sudo cp target/release/m8 /usr/local/bin/
Download pre-built binaries from releases
st # Current directory, depth 3 st /path/to/dir -d 5 # Specific path, depth 5 st --all # Show hidden files st --size-sort # Sort by file size
st --mode ai --compress # Token-efficient format st --mode quantum # Maximum compression st --mode summary-ai # Ultra-compressed summary st --mcp # Run as MCP server
st --search "TODO" # Search file contents st --type rs # Only Rust files st --pattern "test_*" # Glob pattern matching st --modified 7d # Files modified in last 7 days
st --git-aware # Show git status st --mode stats # Directory statistics st --stream # Streaming mode for huge directories st --claude-save # Save session consciousness
Smart Tree provides 30+ tools via Model Context Protocol:
st --mcp-config >> ~/Library/Application\ Support/Claude/claude_desktop_config.json
overview: Quick project understandingfind: Powerful file discoverysearch: Content search with contextanalyze: Deep code analysisedit: AST-aware code editinghistory: Track file changesmemory: Anchor insights for recallhooks: Manage Claude Code hooksexport ST_DEFAULT_DEPTH=5 # Default tree depth export ST_COLOR=always # Force colors export ST_NO_ICONS=1 # Disable emoji icons export ST_MAX_FILE_SIZE=10M # Skip large files
Create ~/.config/smart-tree/config.toml:
[display] default_depth = 5 show_hidden = false use_icons = true color_mode = "auto" [performance] max_buffer_size = "100MB" thread_count = 8 use_streaming = true [mcp] enabled = true port = 3000
Revolutionary markdown compression achieving 70-90% size reduction:
mq compress README.md # Compress single file mq aggregate docs/ # Compress directory mq decompress file.mq # Restore original
Wave-function based compression for maximum efficiency:
git clone https://github.com/8b-is/smart-tree cd smart-tree cargo build --release cargo test
cargo test # Unit tests ./scripts/test_all.sh # Integration tests cargo bench # Performance benchmarks
Contributions welcome! Please read CONTRIBUTING.md
Created by the 8b-is team with contributions from:
MIT License - see LICENSE for details
Made with ❤️ and Rust
Website • Issues • Discussions