SuperSmall CLI Reference

Important: SuperSmall is a context optimization tool designed to work WITH other AI development tools like Claude Code and Kandi CLI. It does NOT provide AI capabilities on its own - it analyzes your codebase and generates optimized context to reduce API token usage when using AI assistants.

Table of Contents

Overview

SuperSmall is a code analysis and indexing tool that optimizes context generation for Claude and Anthropic APIs. It works by:

  1. Analyzing your repository to extract symbols, dependencies, and structure
  2. Building an efficient index stored locally in .supersmall/index.json
  3. Generating optimized context based on queries or file paths
  4. Integrating with AI tools like Claude Code and Kandi CLI
Note: SuperSmall does NOT include AI capabilities. It's a preprocessing tool that makes AI assistants more efficient by providing relevant context.

Installation

git clone [repository-url]
cd supersmall-cli-osx-alpha
swift build -c release
sudo cp .build/release/supersmall /usr/local/bin/

Requirements:

Commands

supersmall init

Initialize and index a repository for optimized context generation.

supersmall init [options]
Option Description Default
--languages Comma-separated list of languages to analyze swift,typescript,javascript,python,go,rust
--force Force re-indexing even if index exists false
--max-file-size Maximum file size to analyze (in MB) 10

Example:

supersmall init --languages typescript,javascript --force

supersmall query

Generate optimized context for a natural language query.

supersmall query <query> [options]
Option Description Default
--max-tokens Maximum context size in tokens 100000
--threshold Relevance threshold (0.0-1.0) 0.5
--include-contents Include file contents in output false

Example:

supersmall query "How does authentication work?" --max-tokens 50000 --include-contents

supersmall update

Update the repository index with incremental changes.

supersmall update [options]
Option Description Default
--incremental Only update modified files since last index false

Example:

supersmall update --incremental

supersmall stats

Show repository index statistics.

supersmall stats [options]
Option Description Default
--detailed Show detailed statistics breakdown false

Example:

supersmall stats --detailed

supersmall export

Export repository index to a file.

supersmall export <output> [options]
Option Description Default
--compress Compress the output file false

Example:

supersmall export index-backup.json --compress

supersmall import

Import repository index from a file.

supersmall import <input> [options]
Option Description Default
--merge Merge with existing index false

Example:

supersmall import index-backup.json --merge

supersmall claude-code

Generate optimized context for Claude Code. This command formats output specifically for use with Claude Code.

supersmall claude-code <input> [options]
Option Description Default
--type Context type: file, query, or auto auto
--max-tokens Maximum context size in tokens 100000
--include-related Include related files automatically false

Example:

supersmall claude-code src/auth.ts --include-related

supersmall kandi

Optimize prompts and context for Kandi CLI.

supersmall kandi <input> [options]
Option Description Default
--command Kandi command type: chat, ask, code, review chat
--max-tokens Maximum context size in tokens 100000
--stream Stream output for real-time processing false
--model API model to optimize for claude-3-opus-20240229

Example:

supersmall kandi "implement user registration" --command code --max-tokens 150000

Global Options

These options are available for all commands:

Option 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

Usage Examples

Basic Workflow

# 1. Initialize your repository
cd /path/to/your/project
supersmall init

# 2. Generate context for a query
supersmall query "How does the authentication system work?"

# 3. Use with Claude Code
supersmall claude-code src/main.ts --include-related

# 4. Export index for CI/CD
supersmall export ci-index.json --compress

Integration with AI Tools

SuperSmall output can be piped or copied to AI assistants:

# Generate context and copy to clipboard (macOS)
supersmall query "database schema" --include-contents | pbcopy

# Use with Claude Code (when it supports external context)
supersmall claude-code src/api/users.ts --output-format claude > context.txt
Remember: SuperSmall itself does NOT perform any AI analysis or code generation. It only prepares optimized context for use with AI tools. You need access to Claude Code, Kandi CLI, or other AI assistants to make use of the generated context.

What SuperSmall Does NOT Do

What SuperSmall DOES Do