agentctl auth uses the runtime contract behind agent.sh to log in and
synchronize host-storable auth data.
Use it when you want a runtime to talk to its online/provider-backed service instead of the default local Ollama-backed mode.
In practice, agentctl auth is the command that:
- opens the runtime's login flow in a temporary auth container
- stores the resulting auth state in the macOS Keychain
- lets later
agentctl run --onlinesessions replay that auth into containers
You do not need agentctl auth for normal local-model runs. It is only needed
for online runs such as:
agentctl auth --runtime codex
agentctl run --runtime codex --online
agentctl auth --runtime claude
agentctl run --runtime claude --onlineagentctl auth
agentctl auth --runtime codex
agentctl auth --runtime claudeIn --online mode:
agentctlresolves the effective runtime- it performs best-effort auth replay from Keychain before launch
- after the run, refreshed auth may be saved back to Keychain
Examples:
agentctl run --runtime codex --online
agentctl run --runtime claude --online--auth only works with --online:
agentctl run --runtime claude --online --authIf you reauthenticate a runtime, restart any running online session for that runtime before relying on the new credentials.
Host-side Keychain storage is keyed per runtime and auth format.
Notes:
- Runtimes use runtime-specific Keychain slots
- Keychain auth is the host-side source of truth for online launches when a runtime supports host-managed auth
Codex auth is stored in ~/.codex/auth.json inside the container runtime state.
Device-auth login creates that file.
Claude auth on Linux is synchronized through:
~/.claude/.credentials.json
The host-storable Claude blob also preserves the minimal proven replay state
from ~/.claude.json:
oauthAccounthasCompletedOnboarding
That is enough to replay auth into a fresh Claude container in current testing.
agentctl-keychain.sh is the low-level macOS Keychain adapter used by agentctl for runtime auth state.