A fast, secure launcher CLI tool that lets you switch between different AI coding assistants using fuzzy search. Built with TypeScript and Bun for optimal performance.
Installation โข Usage โข Configuration
ai <toolname> or fuzzy matchingai c for claude)$@ argument/stdin placeholdersccs api listcurl -fsSL https://raw.githubusercontent.com/jellydn/ai-cli-switcher/main/install.sh | sh
brew install jellydn/tap/ai
Download the latest ai-windows-x64.exe from Releases and add to your PATH.
Requires Bun:
git clone https://github.com/jellydn/ai-cli-switcher
cd ai-cli-switcher
bun install
bun run build
This produces a standalone executable at dist/ai.
# Option 1: Symlink to /usr/local/bin (requires sudo)
sudo ln -sf "$(pwd)/dist/ai" /usr/local/bin/ai
# Option 2: Symlink to ~/.local/bin (no sudo required)
mkdir -p ~/.local/bin
ln -sf "$(pwd)/dist/ai" ~/.local/bin/ai
# Ensure ~/.local/bin is in your PATH
Verify installation:
ai --help
Run without arguments to open fuzzy search:
ai
Controls:
| Key | Action |
|---|---|
| Type | Filter tools and templates |
โ / Ctrl+P / Shift+Tab |
Move up |
โ / Ctrl+N / Tab |
Move down |
Enter |
Select and launch |
Esc / Ctrl+C |
Cancel |
Note: Tab/Shift+Tab navigate the list (not shell completion) since the UI runs in raw mode.
[T] indicatorLaunch a tool directly by name or alias:
ai claude # Launch Claude
ai amp # Launch Amp
ai ccs:glm # Launch CCS with glm profile
ai c # Uses alias for claude (if configured)
Fuzzy matching works when no exact match is found:
ai cl # Matches "claude"
ai op # Matches "opencode"
ai cc # Matches "ccs" or "claude" (will ask if ambiguous)
CCS Profile Detection: Automatically detects CCS profiles and creates tools like:
ccs:glm - GPT model profileccs:kimi - Kimi model profileccs:custom - Custom profile namePass arguments to the selected tool:
ai claude --help # Direct: passes --help to claude
ai -- --help # Fuzzy: select tool, then pass --help
ai claude -- --version # Explicit separator
Templates can use $@ as a placeholder for arguments or piped stdin:
# Pass arguments directly
ai summarize main.ts # Expands template with arguments
# Pipe content via stdin
cat main.ts | ai summarize # Pipe file content to template
git diff | ai review # Pipe git diff for code review
echo "Hello world" | ai summarize
Both methods substitute content into the $@ placeholder. If no input is provided for a template requiring $@, an error is shown.
Templates without $@ run immediately when selected - perfect for common commands with embedded prompts:
# In config.json - no prompt needed, runs directly
ai gemini-arch # Runs immediately: ccs gemini 'Explain...'
ai # Or select from interactive menu
These templates have fixed commands and execute instantly on selection.
Config file location: ~/.config/ai-switcher/config.json
A default config is created on first run. Example:
{
"tools": [
{
"name": "claude",
"command": "claude",
"description": "Anthropic Claude CLI",
"aliases": ["c"]
},
{
"name": "opencode",
"command": "opencode",
"description": "OpenCode AI assistant",
"aliases": ["o", "oc"]
}
],
"templates": [
{
"name": "summarize",
"command": "claude -p 'Summarize this file: $@'",
"description": "Summarize a file with Claude"
},
{
"name": "review",
"command": "amp -p 'Review this code: $@'",
"description": "Code review with Amp"
},
{
"name": "commit-zen",
"command": "opencode run 'Generate commit message: $@'",
"description": "Generate commit message with OpenCode"
},
{
"name": "gemini-arch",
"command": "ccs gemini 'Explain this codebase architecture'",
"description": "Explain architecture with Gemini",
"aliases": ["arch"]
}
]
}
tools: Array of AI tools
name: Display name and primary lookup keycommand: The CLI command to executedescription: Shown in fuzzy search listaliases: Optional array of short aliasestemplates: Array of command templates
name: Template name (shown with [T] indicator)command: Command string, use $@ for argument substitutiondescription: Template descriptionThe following CLIs are auto-detected if installed and available in PATH:
claude - Anthropic Claude CLIopencode - OpenCode AI assistantamp - Sourcegraph Amp CLIccs - Claude Code Switch (with profile detection via ccs api list)Precedence Rules:
CCS Profile Auto-Detection:
Runs ccs api list to detect active profiles. Each profile with [OK] status becomes available as ccs:<profile-name>.
# Install dependencies
bun install
# Run in development mode
bun run dev
# Type checking (no compilation errors โ
)
bun run typecheck
# Build standalone executable
bun run build
# Test with specific tools
bun run src/index.ts claude --version
$@ syntax only)# Run unit tests
bun test
# Test auto-detection
bun run src/index.ts
# Test direct invocation
bun run src/index.ts claude --version
bun run src/index.ts opencode --help
# Test error handling
bun run src/index.ts nonexistent-tool
# Test alias support (if configured)
bun run src/index.ts c # Should match claude alias
# Test template with arguments
bun run src/index.ts summarize file.txt
# Test template with stdin
cat file.txt | bun run src/index.ts summarize
git diff | bun run src/index.ts review
bun run typecheck (no errors allowed)MIT