agent-rt

Local-first, agent-native developer tools.

View My GitHub Profile

llmctl

llmctl is a fast, pipe-friendly CLI for testing OpenAI-compatible and Anthropic LLM endpoints. One single Zig binary speaks Chat Completions, OpenAI-compatible servers (llama-server, vLLM, Ollama, …), and Anthropic Messages — through a provider abstraction where format × timing (text/json/ndjson × stream/batch) are orthogonal.

llmctl "explain recursion"
echo "summarize" | llmctl < article.txt
llmctl --base-url http://10.0.0.64:8800 --model gemma "hi"
llmctl --output ndjson -m gpt-4o -m claude-sonnet-4-5 "hi" | jq .
llmctl --provider anthropic --model claude-sonnet-4-5 "hi"
llmctl --render markdown "explain monads"           # ANSI-rendered output
llmctl -i                                           # REPL with slash commands

Why one CLI for every chat API

llmctl is opinionated for users who debug, script, and compare LLM endpoints from the shell:

Position in the Agent-RT family

Tool Layer
llmctl Direct chat-completion API client (debugging, scripting)
acpctl ACP agent invocation
mcpctl MCP server invocation
secretctl Encrypted secret store + capability injection

llmctl is a leaf — it talks HTTP to a model and gets out of the way. Pair with secretctl exec --tag ai -- llmctl … to keep API keys out of your shell environment.

Install

brew install agent-rt/tap/llmctl  # macOS arm64 (Apple Silicon) only

Or download the tarball from the Releases page.

Build from source (requires Zig 0.16):

git clone https://github.com/agent-rt/llmctl
cd llmctl
zig build -Doptimize=ReleaseSafe
./zig-out/bin/llmctl --version

Defaults

~/.config/llmctl/defaults — one key = value per line — sets fallback values applied before CLI parsing (any flag overrides). Recognised keys: provider, model, base_url, system, max_tokens, temperature, top_p.

provider = local
base_url = http://10.0.0.64:8800
model    = unsloth/gemma-4-26B-A4B-it-GGUF:gemma-4-26B-A4B-it-UD-Q4_K_M
max_tokens = 4096

Manage the file from the CLI (preserves comments and blank lines, atomic writes):

llmctl config list                       # print all currently-set keys
llmctl config get model                  # print one value
llmctl config set provider openai        # write/update
llmctl config unset model
llmctl config path                       # print resolved file path

Search order: $LLMCTL_DEFAULTS, $XDG_CONFIG_HOME/llmctl/defaults, ~/.config/llmctl/defaults.

REPL slash commands

llmctl -i enters an interactive REPL. Inside:

Command Effect
/help, /? List all commands
/exit, /quit, /q Leave the REPL (Ctrl-D also works)
/clear Drop conversation history (keep system prompt)
/system [<text>] Show or set the system prompt
/model [<name>] Show or switch model
/tokens Print accumulated input/output token counts
/save <path> / /load <path> Persist or restore the session JSON
/history List current messages
/info Provider, model, system, auto-save, dry-run state
/dry-run [on\|off] Toggle request-printing — next turn prints the body instead of sending