Unreleased docs

agent is not currently published in the cmdhub registry. This page is available by direct URL for development/reference use.

auto_fix_high
cmdhub adapter

Agent CLI
for cmdhub.

Schema-aware transforms between one command contract and another.

lock Auth: Model profile
Quick Install cmdhub get agent

data_object Agent Contract

Agents should start with auth/status and discovery commands, inspect schemas before composition, and treat commands marked as mutating as state-changing operations.

Output

Use human output for normal reads, `--json` for scripting or complete structured fields, and `--jsonl` for upstream pipe inputs.

Auth

local model profile. Provider credentials stay with the source and destination CLIs.

Refs

Prefer list/search, then short refs or piped JSONL. Use `resolve` to inspect cached refs.

Schemas

Use `agent schema` and `catalog.json` to inspect fields, flags, examples, and side effects.

Auth scopes

local model/profile configuration

terminal Command Reference

Generated from source. Global flags apply to all commands.

Global Flags

--json bool Emit JSON machine output
--jsonl bool Emit JSONL records for piping
--output, -o string Compatibility output mode: json|jsonl. Prefer --json or --jsonl
--view string = summary View mode: summary|full
--profile string Config/auth profile
--config string Config path override
--quiet, -q bool Suppress non-essential diagnostics
--debug bool Enable debug diagnostics
--limit int = 50 Maximum items to emit
--page-size int = 50 Requested upstream page size
--cursor string Continuation cursor
--no-paginate bool Fetch only one page
--version, -v bool Print version information
agent adapt Compile one typed stream into another
#cmd-agent-adapt discovery safe dry-run
--dry-run bool Dry run mode
--model string Model profile name
--to string Target command
--via string Optional intermediate intent schema
$ agent adapt --help
$ gmail message get m1 --jsonl | agent adapt --to 'gcal event create' --dry-run
$ gmail message get m1 --jsonl | agent adapt --to 'gcal event create' --via intent.meeting_request.v1 --json
$ gmail message get m1 --jsonl | agent adapt --to intent.task.v1
agent auth Show local agent auth state
#cmd-agent-auth discovery safe
The agent CLI does not own provider credentials. Provider CLIs such as gmail, gcal, gdrive, msdrive, mscal, slack, and notion handle their own auth. Configure model backends with agent model.
agent auth login No-op for local agent auth
#cmd-agent-auth-login mutates state
$ agent auth login
agent auth logout No-op for local agent auth logout
#cmd-agent-auth-logout mutates state
$ agent auth logout
$ agent auth logout --help
agent auth refresh No-op for local agent auth refresh
#cmd-agent-auth-refresh mutates state
$ agent auth refresh
agent auth status Show local agent auth status
#cmd-agent-auth-status discovery safe
$ agent auth status
$ agent auth status --json
agent auth whoami Show local agent model profile identity
#cmd-agent-auth-whoami discovery safe
$ agent auth whoami
agent capabilities Describe agent CLI capabilities
#cmd-agent-capabilities discovery safe
$ agent capabilities
$ agent capabilities --json
$ agent capabilities --view full
agent doctor Run agent CLI diagnostics
#cmd-agent-doctor discovery safe
$ agent doctor
$ agent doctor --view full
agent explain Explain how stdin could map to a target schema
#cmd-agent-explain discovery safe
--model string Model profile name
--to string Target command
--via string Optional intermediate intent schema
$ agent explain
$ gmail message get m1 --jsonl | agent explain --to 'gcal event create'
$ gmail message get m1 --jsonl | agent explain --to 'gcal event create' --via intent.meeting_request.v1 --json
$ gmail message get m1 --jsonl | agent explain --to intent.task.v1
agent login No-op for local agent auth
#cmd-agent-login mutates state
$ agent auth login
$ agent login
agent logout No-op for local agent auth logout
#cmd-agent-logout mutates state
$ agent auth logout
$ agent logout
agent model Manage model execution profiles
#cmd-agent-model discovery safe
$ agent model add local
$ agent model add local --provider ollama --model qwen3.5:2b
$ agent model add work-openai --provider openai --model <model>
$ agent model use local
$ agent model list
agent model add Add or update a model execution profile
#cmd-agent-model-add mutates state
--api-key-stdin bool Read API key from stdin
--base-url string Model endpoint base URL
--model string Provider model name
--protocol string Model protocol override
--provider string Model provider: ollama|openai|anthropic|claude|gemini|custom
--structured-output bool = true Backend supports structured JSON output
$ agent model add --help
$ agent model add gateway --provider custom --protocol openai-chat --base-url https://llm-gateway.example.com/v1 --model <model> --api-key-stdin
$ agent model add local
$ agent model add local --provider ollama --model qwen3.5:2b
$ agent model add work-openai --provider openai --model <model>
agent model list List model execution profiles
#cmd-agent-model-list discovery safe
$ agent model list
$ agent model list --json
$ agent model list --view full
agent model remove Remove a model execution profile and its stored API key
#cmd-agent-model-remove mutates state
$ agent model remove --help
$ agent model remove local
agent model show Show a model execution profile
#cmd-agent-model-show discovery safe
$ agent model show
$ agent model show local --json
agent model test Test a model execution profile
#cmd-agent-model-test discovery safe
$ agent model test
$ agent model test local --json
agent model use Set the default model execution profile
#cmd-agent-model-use mutates state
$ agent model use --help
$ agent model use local
agent resolve Resolve an agent schema or command target
#cmd-agent-resolve discovery safe
Resolve an intent schema id or a command target such as ‘gcal event create’. This does not resolve item refs such as m1 or c1.
$ agent resolve
$ agent resolve 'gcal event create'
$ agent resolve 'gcal event create' --view full
$ agent resolve gmail message get --view full
$ agent resolve intent.contact.v1
agent schema Show schema for a command or intent
#cmd-agent-schema discovery safe

Show schema for a command or intent.

Use –to for command targets and intent schema ids. The –via flag is accepted as a compatibility alias for intent schema ids used with adapt/explain.

--in bool Show input schema
--out bool Show output schema
--to string Target command
--via string Intent schema id alias for --to
$ agent schema
$ agent schema --to 'gcal event create' --in --json
$ agent schema --to 'mscal event create' --in --json
$ agent schema --to intent.contact.v1 --out --json
$ agent schema --via intent.crm_activity.v1 --out --json
$ agent schema gcal event create --in --json
agent validate Validate stdin against a target or intent schema
#cmd-agent-validate discovery safe
--schema string Intent schema id
--to string Target command
$ agent validate
$ cat event.json | agent validate --to 'gcal event create'
$ cat task.json | agent validate --schema intent.task.v1
$ gmail message get m1 --jsonl | agent validate --schema intent.note.v1
agent version Show agent version information
#cmd-agent-version discovery safe
$ agent version
$ agent version --json
$ agent version --view full

play_circle Live Examples

Output captured from a real workspace. Regenerate with scripts/gen-docs.sh --update.

auth

Show local auth status
$ agent auth status
Agent auth: local
Provider credentials: none needed
Model profile: local

Next: agent model list

lifecycle

Show capabilities
$ agent capabilities
agent capabilities
  auth       show local auth status
  capabilities
  doctor     run local diagnostics
  model      manage model execution profiles
  schema     inspect command and intent schemas
  transform
  validate   validate stdin against a schema
  version

Output: json, jsonl
Identifiers: stdin, schema_id, command_target

Next: agent schema --to intent.contact.v1 --out

schemas

Inspect an intent schema
$ agent schema --to intent.contact.v1 --out
Schema: intent.contact.v1
Command: intent.contact.v1
Direction: output
Required: name, confidence

Next: agent validate --schema intent.contact.v1

alt_route Composition Patterns

Bridge your ecosystem with zero middleware.

# Adapt a Gmail message into a calendar-event input contract
gmail message list --label INBOX --limit 1 --jsonl \
  | agent adapt --to "gcal event create"