CLI Configuration
The llmist CLI is configured through TOML files and environment variables.
Configuration File
Section titled “Configuration File”The CLI loads configuration from ~/.llmist/cli.toml:
# Initialize with default config npx @llmist/cli initBasic Structure
Section titled “Basic Structure”[complete]model = "anthropic:claude-sonnet-4-5"temperature = 0.7
[agent]model = "anthropic:claude-sonnet-4-5"max-iterations = 15gadget = ["~/gadgets/common-tools.ts"]Inheritance
Section titled “Inheritance”Sections can inherit settings from parent sections:
[agent]model = "anthropic:claude-sonnet-4-5"max-iterations = 15
[code-review]inherits = "agent"temperature = 0.3system = "You are a code reviewer."Custom Commands
Section titled “Custom Commands”Create custom commands with a type field:
[code-review]type = "agent"description = "Review code for bugs and best practices."system = "You are a senior code reviewer."max-iterations = 5gadget = ["~/gadgets/code-tools.ts"]Run with:
npx @llmist/cli code-review "Review my PR"Rate Limiting Configuration
Section titled “Rate Limiting Configuration”Control proactive rate limiting to prevent API errors before they occur.
Global Rate Limits
Section titled “Global Rate Limits”Apply to all commands:
[rate-limits]requests-per-minute = 50tokens-per-minute = 40000tokens-per-day = 1500000 # Optional daily capsafety-margin = 0.8 # Start throttling at 80% of limitenabled = true # Default: true if any limit is setPer-Command Rate Limits
Section titled “Per-Command Rate Limits”Override global settings for specific commands:
[agent.rate-limits]requests-per-minute = 15 # More conservative for agent modetokens-per-minute = 100000
[complete.rate-limits]requests-per-minute = 100 # Higher limits for completiontokens-per-minute = 200000Provider-Specific Examples
Section titled “Provider-Specific Examples”Gemini Free Tier:
[agent.rate-limits]requests-per-minute = 15tokens-per-minute = 1000000tokens-per-day = 1500000Anthropic Tier 1:
[agent.rate-limits]requests-per-minute = 50tokens-per-minute = 40000OpenAI Free Tier:
[agent.rate-limits]requests-per-minute = 3tokens-per-minute = 40000Disabling Rate Limiting
Section titled “Disabling Rate Limiting”[rate-limits]enabled = falseOr per-command:
[agent.rate-limits]enabled = falseRetry Configuration
Section titled “Retry Configuration”Control automatic retry behavior for transient failures.
Global Retry Settings
Section titled “Global Retry Settings”[retry]enabled = true # Default: trueretries = 3 # Max retry attemptsmin-timeout = 1000 # Initial delay (ms)max-timeout = 30000 # Maximum delay (ms)factor = 2 # Exponential backoff multiplierrandomize = true # Add jitter to prevent thundering herdrespect-retry-after = true # Honor Retry-After headersmax-retry-after-ms = 120000 # Cap server-requested delays (2 minutes)Per-Command Retry Settings
Section titled “Per-Command Retry Settings”[agent.retry]retries = 5 # More retries for long-running agentsmax-timeout = 60000 # Up to 1 minute between retries
[complete.retry]retries = 1 # Fast-fail for completionsmax-timeout = 5000Configuration Precedence
Section titled “Configuration Precedence”Settings are applied in this order (highest to lowest priority):
- CLI flags (
--rate-limit-rpm,--max-retries,--no-retry, etc.) - Profile-specific TOML config (
[agent.rate-limits],[complete.retry]) - Global TOML config (
[rate-limits],[retry]) - Provider defaults (auto-detected from model)
- Built-in defaults
CLI Flags
Section titled “CLI Flags”Override TOML configuration for individual runs:
Rate Limiting:
llmist agent "prompt" --rate-limit-rpm 50 --rate-limit-tpm 40000llmist agent "prompt" --no-rate-limitRetry:
llmist agent "prompt" --max-retries 5 --retry-max-timeout 60000llmist agent "prompt" --no-retryFor complete flag documentation, run:
llmist agent --helpllmist complete --helpPrompt Templates
Section titled “Prompt Templates”Define reusable prompts with Eta templating:
[prompts]base-assistant = "You are a helpful AI assistant."expert = """<%~ include("@base-assistant") %>You are also an expert in <%= it.field %>."""
[my-expert]system = '<%~ include("@expert", {field: "TypeScript"}) %>'File Includes
Section titled “File Includes”Load prompt content from external files with includeFile():
[prompts]# Load entire prompt from filefrom-file = '<%~ includeFile("~/.llmist/prompts/custom.md") %>'
# Mix file content with inline contenthybrid = """<%~ include("@base-assistant") %><%~ includeFile("./prompts/project-rules.txt") %>"""
[code-review]system = '<%~ includeFile("~/.llmist/prompts/code-review.md") %>'Path resolution:
~expands to home directory- Relative paths resolve from config file location
- Included files can themselves use
includeFile()andinclude() - Circular includes are detected and prevented
Gadget Approval
Section titled “Gadget Approval”The gadget approval system provides a safety layer for potentially dangerous gadget executions.
Approval Modes
Section titled “Approval Modes”| Mode | Behavior |
|---|---|
allowed | Gadget executes immediately |
denied | Gadget is rejected, LLM receives denial message |
approval-required | User is prompted before execution |
Default Behavior
Section titled “Default Behavior”By default, these gadgets require approval:
RunCommand- Executes shell commandsWriteFile- Creates or modifies filesEditFile- Edits existing files
All other gadgets default to allowed.
Configuration
Section titled “Configuration”[agent]gadget-approval = { WriteFile = "allowed", Shell = "denied", ReadFile = "allowed" }Wildcard Default
Section titled “Wildcard Default”Set default mode for all unconfigured gadgets:
[agent]gadget-approval = { "*" = "denied", ReadFile = "allowed", FloppyDisk = "allowed" }Example Configurations
Section titled “Example Configurations”High-Security Mode:
[agent]gadget-approval = { WriteFile = "denied", EditFile = "denied", RunCommand = "denied", ReadFile = "allowed"}Trust All Mode:
[agent]gadget-approval = { "*" = "allowed" }Selective Approval:
[agent]gadget-approval = { RunCommand = "approval-required", WriteFile = "allowed", DeleteFile = "denied"}Approval Prompts
Section titled “Approval Prompts”For file operations, a colored diff is shown:
🔒 Approval required: Modify src/index.ts
--- src/index.ts (original)+++ src/index.ts (modified)@@ -1,3 +1,4 @@ import { foo } from './foo';+import { bar } from './bar';
⏎ approve, or type to reject:- Press Enter or type
yto approve - Type any other text to reject (sent to LLM as feedback)
Non-Interactive Mode
Section titled “Non-Interactive Mode”When running non-interactively (e.g., in scripts or CI), approval-required gadgets are automatically denied.
Environment Variables
Section titled “Environment Variables”API Keys
Section titled “API Keys”export OPENAI_API_KEY="sk-..."export ANTHROPIC_API_KEY="sk-ant-..."export GEMINI_API_KEY="..."Logging
Section titled “Logging”export LLMIST_LOG_LEVEL="debug" # silly, trace, debug, info, warn, error, fatalexport LLMIST_LOG_TEE="true" # Also write to stdout when file logging is activeGlobal CLI Flags
Section titled “Global CLI Flags”These flags work with any command:
| Flag | Description |
|---|---|
--log-level <level> | Set log level |
--version | Show version number |
--help | Show help |
MCP servers ([mcp.servers.<name>])
Section titled “MCP servers ([mcp.servers.<name>])”Configure Model Context Protocol servers that the agent should attach to. Each server is its own table.
The MCP config schema is strict: [mcp], [mcp.servers], each server block, and nested env / headers blocks must have the expected shape. Unknown keys and invalid values fail config validation with a path-specific error instead of silently dropping a server.
Stdio server
Section titled “Stdio server”[mcp.servers.fs]transport = "stdio"command = "npx"args = ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]# Optional:# trust = true # bypass the runtime allowlist for this server# enabled = false # temporarily disable without removing the block# timeout-ms = 30000 # per-call timeout# env = { TZ = "UTC" }Streamable HTTP server
Section titled “Streamable HTTP server”[mcp.servers.remote]transport = "http"url = "https://my-mcp.example.com/mcp"
[mcp.servers.remote.headers]Authorization = "Bearer xyz"Field reference
Section titled “Field reference”| Field | Required | Default | Notes |
|---|---|---|---|
transport | yes | — | "stdio" or "http" (legacy SSE not supported) |
command | stdio only | — | Executable; basename gated by allowlist unless trust = true |
args | optional | [] | Arguments to the executable |
env | optional | parent env | Environment overrides for the spawned child |
url | http only | — | Must include http:// or https:// |
headers | optional | — | Fixed HTTP headers (e.g. Authorization) |
trust | optional | false | Bypass the stdio command allowlist for this server |
enabled | optional | true | Set false to skip the block at startup |
timeout-ms | optional | none | Per-operation timeout in milliseconds; must be a non-negative integer, and 0 disables the timeout |
Importing from Claude Code
Section titled “Importing from Claude Code”If you already have MCP servers configured in ~/.claude.json (Claude Code, Cursor, Cline), pull them into your llmist config:
llmist mcp import-claude-code # emit blocks to stdoutllmist mcp import-claude-code >> ~/.llmist/config.tomlllmist mcp import-claude-code --write # append directly to ~/.llmist/config.tomlSet CLAUDE_CONFIG_HOME to override the source path.
See Also
Section titled “See Also”- MCP — library guide
- MCP security — STDIO allowlist
- CLI Reference - All CLI commands
- CLI Gadgets - Writing gadgets for CLI
- Logging - Detailed logging configuration