A CLI provider registry and policy gateway that discovers commands from installed CLI tools and exposes them to AI agents through the Model Context Protocol.
climode auto-discovers command trees from any installed binary, enforces per-command access policies, and stores the full provider manifest as a versioned JSON config so teams share identical tool surfaces across environments.
| Package | Description |
|---|---|
@lightfastai/climode |
CLI entry point, provider discovery, config management, policy engine, and command execution |
@lightfastai/climode-mcp |
MCP server that exposes providers and commands as tools for AI agents |
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Add a CLI tool as a provider
climode add gh
# List registered providers
climode list
# View commands for a provider
climode commands gh
# Disable a dangerous command
climode disable gh repo delete
# Execute a command (for testing)
climode exec gh issue list -- --repo owner/repoWhen you run climode add <binary>, the discovery engine probes the binary to detect the best parsing strategy:
- Cobra — Go CLIs using
__completeintrospection - Clap — Rust CLIs using
completions bashscript parsing - Generic — Falls back to
--helptext parsing for everything else
The full command tree (commands, subcommands, flags, arguments) is persisted to climode.json.
Every discovered command defaults to Enabled. Use climode enable / climode disable to control access per-command. The policy engine checks every invocation before execution — disabled commands are blocked and hidden from agents.
The MCP server (climode-mcp) exposes three tools over stdio:
| Tool | Description |
|---|---|
list_providers |
Returns all registered providers with metadata |
get_commands |
Returns enabled commands for a provider |
execute_command |
Runs an enabled command and returns stdout, stderr, and exit code |
Add to your MCP settings:
{
"mcpServers": {
"climode": {
"command": "climode-mcp"
}
}
}| Command | Description |
|---|---|
climode add <binary> |
Register a new CLI tool as a provider |
climode remove <provider> |
Remove a provider from the manifest |
climode list |
List all registered providers |
climode commands <provider> |
Show commands and policies for a provider |
climode enable <provider> <command...> |
Enable a command |
climode disable <provider> <command...> |
Disable a command |
climode refresh <provider> |
Re-discover commands, preserving existing policies |
climode exec <provider> <command...> [-- args] |
Execute a command after policy check |
Provider state lives in climode.json:
{
"version": 1,
"providers": [
{
"name": "gh",
"binary_path": "/opt/homebrew/bin/gh",
"version": "2.81.0",
"strategy": "cobra",
"registered_at": "2026-03-31T12:00:00Z",
"commands": [
{
"path": ["gh", "issue", "list"],
"description": "List issues in a repository",
"args": [],
"flags": [
{ "name": "repo", "short": "R", "description": "Select another repository", "takes_value": true }
],
"policy": "Enabled"
}
]
}
]
}# Watch mode (all packages)
pnpm dev
# Run tests
pnpm test
# Type check
pnpm typecheck