Skip to content

AI Agent Integration

CommandIt works with AI coding assistants like Claude Code, Codex, Cursor, and more. Once connected, your AI can search, use, and create snippets — making every snippet in your library a tool your AI can call.

Open Settings → Agent Integration and click Install CLI, or run in Terminal:

Terminal window
commandit install-cli

This creates a commandit command available system-wide.

To uninstall:

Terminal window
commandit install-cli --uninstall

Open Settings → Agent Integration and copy the setup instruction for your platform:

Terminal agents (CLI):

PlatformCommand
Claude Codeclaude plugin add chriscox/commandit-plugin
Codexcodex mcp add commandit -- commandit mcp
Gemini CLIgemini mcp add commandit -- commandit mcp

Editor agents (JSON config):

PlatformConfig fileKey
Cursor~/.cursor/mcp.jsonmcpServers
Windsurf~/.windsurf/mcp.jsonmcpServers
VS Code.vscode/mcp.jsonservers

For editor agents, add the JSON from Settings to the config file. Example for Cursor/Windsurf:

{
"mcpServers": {
"commandit": {
"command": "commandit",
"args": ["mcp"]
}
}
}

Alternatively, use the CLI to write the config automatically:

Terminal window
commandit install-mcp --cursor # Writes to ~/.cursor/mcp.json
commandit install-mcp --windsurf # Writes to ~/.windsurf/mcp.json
commandit install-mcp --claude # Writes to Claude Desktop config

That’s it — your AI agent now has access to your snippet library.

Once connected, your AI can work with your snippets through natural conversation. Here are real-world scenarios:

You: “Deploy to staging” AI: searches your snippets → finds “K8s Deploy” → fills in env=staging, replicas=3 AI: “Running: kubectl apply -f deployment.yaml --namespace staging

Your AI finds the right snippet by meaning, not just keywords. Ask for “deploy” and it finds your snippet named “K8s Apply” even without an exact match.

You: “Set up a Redis container on port 6380” AI: finds your Docker Run snippet → fills image=redis, port=6380 AI: “Here’s the command: docker run -d -p 6380:6379 --name redis redis:alpine

The AI understands your intent and fills template arguments ({port}, {image}, {name}) from context — no manual substitution needed.

You: “What Git commands do I have?” AI: searches by category → lists all snippets in your Git category AI: “You have 12 Git snippets: interactive rebase, bisect, cherry-pick…”

Browse by category, tag, or just describe what you’re looking for.

You: “Save that complex find command I just ran as a snippet” AI: detects arguments, generates description, suggests category and tags AI: “Created ‘Find & Delete Old Logs’ with args: {days}, {extension}”

Your AI builds complete snippets with detected arguments, descriptions, and organization — not just raw text.

You (in Cursor): “Add the nginx reverse proxy config for this project” AI: searches your ops snippets → finds Nginx Reverse Proxy → renders with project values

Editor agents paste snippets directly into your files with arguments filled from your project context.

You: “Set up CommandIt for Cursor” AI: finds the MCP setup snippet in your library → shows the JSON config

The setup instructions are themselves CommandIt snippets. Once one agent is connected, it can help you connect the others.

  • Search your snippets — “Find my Docker commands”
  • Use a snippet — “Run my deploy script with port 8080”
  • Create snippets — “Save that kubectl command I just ran as a snippet” (Plus)
  • Browse your library — “What categories do I have?”
  • Describe a snippet — “What args does my deploy snippet take?”
  • Generate commands — “Create a command to compress all PNGs recursively” (Plus)
  • Explain commands — “Explain what this find command does” (Plus)
  • Enhance snippets — “Add metadata to all my snippets missing descriptions” (Plus)

Use these in Terminal or let your AI call them:

CommandWhat it does
commandit search "query"Search snippets
commandit listList all snippets
commandit get <id>View a snippet
commandit describe <id>See a snippet’s args and schema
commandit categoriesList categories
commandit tagsList tags
commandit versionShow CLI version, schema, and database info
commandit detect-args --template "..."Detect arguments in a command template
commandit describe-command --command "..."Generate an AI description for a command
commandit categorize --command "..."Suggest the best category for a command
CommandWhat it does
commandit render <id> --arg key=valueFill in a snippet’s args
commandit paste <id> --arg key=valueFill and paste into your active app
commandit create --name "..." --template "..."Create a new snippet
commandit historyView execution history
commandit generate "description"Generate a shell command from natural language
commandit explain "command"Explain a command with flag breakdown
commandit enhance --command "..."Fill all metadata (name, desc, args, tags, category)
commandit improve --command "..."Polish and optimize a command template
commandit suggest-tags --command "..."Suggest relevant tags for a command
JSON output
Add --format json for machine-readable output (automatic when piped).

CommandIt includes a built-in MCP (Model Context Protocol) server. All supported platforms connect through MCP, giving your AI native access to your snippet library.

ToolTierWhat it does
commandit_searchFreeSearch snippets by query, category, or tags
commandit_describeFreeGet a snippet’s schema (args, types, defaults)
commandit_list_categoriesFreeList categories with snippet counts
commandit_detect_argsFreeDetect arguments in a command template
commandit_describe_commandFreeGenerate an AI description for a command
commandit_categorizeFreeSuggest the best category for a command
commandit_renderPlusFill args and return rendered text
commandit_createPlusCreate a new snippet (supports dry_run)
commandit_pastePlusRender and paste into the active app
commandit_generatePlusConvert natural language to a shell command
commandit_explainPlusExplain a command with flag breakdown and warnings
commandit_enhancePlusFill all metadata for a command or existing snippet
commandit_improvePlusPolish and optimize a command template
commandit_suggest_tagsPlusSuggest relevant tags for a command

Your AI can also read these resources directly:

  • commandit://snippets — your full snippet library
  • commandit://snippets/{id} — a specific snippet with args schema
  • commandit://history — recent execution history (Plus)
Terminal window
commandit mcp --read-only # Non-mutating tools only
commandit mcp --tools search,render # Limit available tools
PlatformSetupType
Claude CodeCLI commandMCP server
Codex (OpenAI)CLI commandMCP server
Gemini CLICLI commandMCP server
CursorJSON configMCP server
WindsurfJSON configMCP server
VS CodeJSON configMCP server

The installer automatically adds ~/.local/bin to your shell PATH. Restart your terminal for the change to take effect, then verify:

Terminal window
commandit version

If it’s still not found, check that your shell profile has the PATH entry:

Terminal window
grep ".local/bin" ~/.zprofile ~/.zshrc ~/.bash_profile 2>/dev/null

If missing, add it manually:

Terminal window
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zprofile
  1. Test the server directly: Run commandit mcp in Terminal. It should wait for input (no error). Press Ctrl+C to stop.
  2. Check your config: Make sure the JSON is valid (no trailing commas). Use the setup instruction from Settings → Agent Integration.
  3. Restart your editor: Most editors require a restart after changing MCP config.
  4. Check your PATH: Run which commandit in Terminal. If not found, restart your terminal or re-run the CLI install from Settings > Developer Tools.
  5. Use install-mcp: For maximum reliability, run commandit install-mcp --cursor (or --windsurf, --claude) which writes the absolute binary path to the config file.

CommandIt.app must be running for commandit paste to work. The CLI sends paste requests to the running app via macOS inter-process communication.

Read-only commands (search, list, describe) and free AI actions (detect-args, describe-command, categorize) are free. Render, paste, create, and Plus AI actions (generate, explain, enhance, improve, suggest-tags) require a Plus subscription.

AI CLI commands (generate, explain, enhance, etc.) require the CommandIt app to be running. They route through the app’s AI provider via inter-process communication, so make sure:

  • CommandIt.app is open
  • AI is configured in Settings (on-device or cloud provider)
  • The request hasn’t timed out (30-second timeout for AI actions)

CLI-managed agents — use the editor’s own CLI:

Terminal window
claude mcp remove commandit
codex mcp remove commandit
gemini mcp remove commandit

JSON-configured editors — delete the commandit entry under mcpServers in:

  • ~/Library/Application Support/Claude/claude_desktop_config.json (Claude Desktop)
  • ~/.cursor/mcp.json
  • ~/.windsurf/mcp.json

Uninstall the CLI:

Terminal window
commandit install-cli --uninstall
rm -f ~/.local/bin/commandit
rm -rf ~/.local/Frameworks/SQLCipher.framework ~/.local/Frameworks/Sparkle.framework

For a complete uninstall (including app data, Keychain, and shell profile changes) see Uninstall.