Skip to content

CLI Configuration

The llmist CLI is configured through TOML files and environment variables.

The CLI loads configuration from ~/.llmist/cli.toml:

Terminal window
# Initialize with default config
bunx @llmist/cli init
~/.llmist/cli.toml
[complete]
model = "anthropic:claude-sonnet-4-5"
temperature = 0.7
[agent]
model = "anthropic:claude-sonnet-4-5"
max-iterations = 15
gadget = ["~/gadgets/common-tools.ts"]

Sections can inherit settings from parent sections:

[agent]
model = "anthropic:claude-sonnet-4-5"
max-iterations = 15
[code-review]
inherits = "agent"
temperature = 0.3
system = "You are a code reviewer."

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 = 5
gadget = ["~/gadgets/code-tools.ts"]

Run with:

Terminal window
bunx @llmist/cli code-review "Review my PR"

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"}) %>'

The gadget approval system provides a safety layer for potentially dangerous gadget executions.

ModeBehavior
allowedGadget executes immediately
deniedGadget is rejected, LLM receives denial message
approval-requiredUser is prompted before execution

By default, these gadgets require approval:

  • RunCommand - Executes shell commands
  • WriteFile - Creates or modifies files
  • EditFile - Edits existing files

All other gadgets default to allowed.

[agent]
gadget-approval = { WriteFile = "allowed", Shell = "denied", ReadFile = "allowed" }

Set default mode for all unconfigured gadgets:

[agent]
gadget-approval = { "*" = "denied", ReadFile = "allowed", FloppyDisk = "allowed" }

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"
}

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 y to approve
  • Type any other text to reject (sent to LLM as feedback)

When running non-interactively (e.g., in scripts or CI), approval-required gadgets are automatically denied.

Terminal window
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="..."
Terminal window
export LLMIST_LOG_LEVEL="debug" # silly, trace, debug, info, warn, error, fatal
export LLMIST_LOG_FILE="./app.log"
export LLMIST_LOG_RESET="true" # Clear log file on start

These flags work with any command:

FlagDescription
--log-level <level>Set log level
--log-file <path>Path to log file
--versionShow version number
--helpShow help