agctl runs Agent SDK for Go from your terminal — one-shot prompts or multi-turn chat, with built-in tools, optional MCP servers, and local, Temporal, or Restate execution. Configuration is YAML plus environment variables.
agctl is not the Go library. If you’re building an app in Go, install the SDK with go get github.com/agenticenv/agent-sdk-go. Install agctl separately using one of the methods below.Install
GitHub Releases (recommended)
Pre-built binaries for Linux, macOS, and Windows (amd64 and arm64) are published on GitHub Releases.
- Open the latest release.
- Download the archive for your OS and architecture from Assets.
- Extract
agctland place it on yourPATH.
go install
If you have Go 1.26+ installed:$(go env GOPATH)/bin — ensure that directory is on your PATH.
Quick start
You need an LLM API key for cloud providers (OpenAI, Anthropic, Gemini, etc.). A config file is optional — set env vars and run:agctl config edit opens your config in $EDITOR and writes to the path from agctl config path when you save.
One command only: agctl --config ~/my-settings.yaml chat or AGCTL_CONFIG=~/my-settings.yaml — partial YAML is fine (see Configuration).
In chat, type at You:. Exit with exit, quit, or bye.
For local Ollama, you usually omit the API key: AGCTL_LLM_PROVIDER=ollama AGCTL_LLM_MODEL=llama3 agctl chat.
Command reference
Global flag:
--config / -c / AGCTL_CONFIG — optional YAML file merged on top of defaults and your saved config.
Tool approval: In agctl chat, built-in tools prompt Approve? (y/n) before they run. If you enable MCP servers, tools run automatically. agctl run never prompts — it auto-approves all tool calls.
agctl chat and agctl run flags
These override config for a single invocation (highest precedence):
Examples
One-shot query
Interactive chat
Override config for one command
Temporal runtime
Restate runtime
Configuration
agctl ships with sensible defaults. You can run with env vars only, save a file with config edit, or pass --config for a one-off override.
Settings merge in order — later layers win. You only need to set the keys you care about in YAML.
Config file location (
agctl config path):
- macOS:
~/Library/Application Support/agctl/config.yaml - Linux:
~/.config/agctl/config.yaml(or$XDG_CONFIG_HOME/agctl/config.yaml) - Windows:
%LOCALAPPDATA%\agctl\config.yaml
agctl config show to see what is in effect. API keys and tokens print as ***. The temporal / restate blocks appear only when that runtime is selected.
Config schema
Top-level keys:llm
conversation
tools — built-in tool names: echo, current_time, random, calculator, weather, wikipedia, search. All default to enabled; set enabled: false to omit from the registry.
temporal — only used when runtime: temporal. Defaults if omitted: localhost:7233, namespace default, task queue agent-sdk-go.
restate — only used when runtime: restate. Defaults if omitted: ingress http://localhost:8080, admin http://localhost:9070, endpoint listen :9080.
logger — SDK/agent logs only; prompts and replies print to the console separately. Default output resolves to a log file under XDG state ($XDG_STATE_HOME/agctl/agctl.log for installed binaries).
Example config.yaml
Environment variables
All use theAGCTL_ prefix. They override merged file values. Prefer env for secrets.
MCP servers (optional)
Add entries undermcp.servers in your config (via agctl config edit or --config):
When at least one MCP server is enabled,
agctl chat auto-approves MCP tool calls (no per-call prompt). See MCP for how MCP works in the SDK.
Run agctl config edit for commented examples of HTTP transport and OAuth fields.
Token usage summary
Setllm_usage: true in config, AGCTL_LLM_USAGE=true, or pass --llm-usage on a single run. Chat prints a session total on exit; run prints after the single turn:
llm.provider is anthropic, the CLI enables prompt caching automatically (unlike the SDK library default — see LLM Providers).
Logging
The console shows your prompts and the agent’s replies. SDK diagnostic logs go to a file by default (logger.output, typically under $XDG_STATE_HOME/agctl/agctl.log). Override with logger.output or AGCTL_LOGGER_OUTPUT (stdout, stderr, or a path).
Troubleshooting
LLM API key required
Cloud providers need a key. SetAGCTL_LLM_APIKEY or llm.apiKey in config. Local Ollama usually does not need a key (AGCTL_LLM_PROVIDER=ollama).
Config file not found
If you pass--config or AGCTL_CONFIG, the path must exist. Check spelling and permissions. To use only defaults + env, omit both.
Saved config file missing
Ifagctl config path points to a file that does not exist yet, that is expected. agctl still runs with built-in defaults and env vars. Use agctl config edit to create the file, or write YAML at that path yourself.
Env var not applying
Confirm theAGCTL_ prefix and spelling (e.g. AGCTL_LLM_APIKEY, not AGENT_). Env overrides file values but chat/run flags override env for the same field. Run agctl config show to see the merged result.
--config partial file seems ignored
Partial YAML only overrides the keys you set. If you also have a saved config file, --config is merged after it, so your override file wins for any keys you specify there.
Run agctl config show to confirm the merged result.
Temporal connection errors
Ensure a Temporal server is running and reachable. With--runtime temporal and no temporal: block, defaults are localhost:7233, namespace default, task queue agent-sdk-go. Override via config, env, or --temporal-* flags.
Restate connection errors
Ensure a Restate server is running and reachable. With--runtime restate and no restate: block, defaults are ingress http://localhost:8080, admin http://localhost:9070, listen :9080. See restate-setup.md. When Restate runs in Docker, set --restate-deployment-url http://host.docker.internal:9080.
MCP server fails to start
Checkcommand and args for stdio servers, or url for HTTP. Increase timeout_seconds. Inspect SDK logs (logger.output / XDG state log file).
Related
Quickstart
Build an agent in your own Go application
Configuration
SDK configuration options the CLI uses under the hood