Command Reference
This section provides comprehensive documentation for every SuperSmall command, including all options, parameters, and usage examples.
Command Structure
All SuperSmall commands follow a consistent structure:
supersmall [global-options] [command-options] [arguments]
Global Options
These options are available for all commands:
| Option | Short | Description | Default |
|--------|-------|-------------|---------|
| --repo
| | Path to repository | Current directory (.
) |
| --output-format
| | Output format: terminal
, json
, claude
, kandi
| terminal
|
| --verbose
| | Enable verbose output | false
|
| --dangerously-skip-permissions
| | Skip permission checks (use with caution) | false
|
| --version
| | Show version information | |
| --help
| -h
| Show help information | |
Command Categories
Core Commands
Essential commands for repository analysis and context generation:
- [init
](core.md#init) - Initialize and index a repository
- [query
](core.md#query) - Generate optimized context for a query
- [update
](core.md#update) - Update repository index incrementally
- [stats
](core.md#stats) - Show repository index statistics
Integration Commands
Commands for integrating with other tools:
- [claude-code
](integration.md#claude-code) - Generate context for Claude Code
- [kandi
](integration.md#kandi) - Optimize prompts for Kandi CLI
Data Management Commands
Commands for managing indexes:
- [export
](data.md#export) - Export repository index
- [import
](data.md#import) - Import repository index
Quick Examples
Initialize a Repository
supersmall init --languages typescript,javascript --force
Query with Context
supersmall query "database connection logic" --max-tokens 50000 --include-contents
Claude Code Integration
supersmall claude-code src/auth.ts --include-related
Kandi CLI Optimization
supersmall kandi "implement user registration" --command code --max-tokens 100000
Output Formats
SuperSmall supports multiple output formats to integrate with different workflows:
Terminal Format (Default)
Human-readable output with colors and formatting for interactive use.
JSON Format
Structured data for programmatic processing:
supersmall query "auth logic" --output-format json
Claude Format
Optimized for Claude Code integration:
supersmall query "auth logic" --output-format claude
Kandi Format
Compatible with Kandi CLI workflows:
supersmall query "auth logic" --output-format kandi
Error Handling
SuperSmall provides clear error messages and exit codes:
| Exit Code | Meaning |
|-----------|---------|
| 0 | Success |
| 1 | General error |
| 2 | Command line usage error |
| 3 | Index not found |
| 4 | File not found |
| 5 | Permission denied |
Best Practices
1. Always initialize before querying: Run supersmall init
before using query commands
2. Use incremental updates: Run supersmall update --incremental
regularly
3. Export indexes for CI/CD: Use supersmall export
to share indexes
4. Specify languages: Limit indexing to relevant languages for better performance
5. Monitor token usage: Use --verbose
to see token counts and optimization ratios