The agc command-line tool gives you full access to Agent Commons from your terminal — with an interactive menu, streaming chat, and scriptable output.
npm install -g @agent-commons/cliRunning agc with no arguments opens a full interactive menu — no commands to memorise:
agcUse ↑ / ↓ arrow keys to navigate and Enter to select. The menu covers chat, runs, sessions, agents, tasks, workflows, MCP, skills, library files, code projects, developer keys, wallets, usage, logs, and configuration.
If no credentials are saved yet, the menu automatically launches the setup wizard.
agc loginThe CLI starts a standard device authorization flow. It opens Commons Identity in your browser and displays a one-time code. Approve the request with your Commons account; your password and API keys never enter the terminal.
Credentials are stored in ~/.agc/config.json with user-only permissions. The
CLI exchanges the account session for short-lived platform access tokens.
agc logout # clear local credentials
agc whoami # show account + verify API access
agc config get # show non-secret configuration
agc config set defaultAgentId ... # set a preferred agentFor CI or other non-interactive automation, create a project-scoped csk_*
developer key and supply it through the environment:
export AGC_API_KEY=csk_test_xxxx
export AGC_API_URL=https://api.agentcommons.io # optional — this is the default
export AGC_AGENT_ID=agent_abc123 # optional default agentEnv vars take precedence over the config file.
agc keys projects list
agc keys scopes
agc keys create \
--name "CI" \
--project prj_... \
--scopes agents:read,agents:run
agc keys list --project prj_...
agc keys revoke key_...Interactive use should prefer agc login. Developer keys are for SDKs,
servers, CI, and automation.
agc agents listOutput:
ID NAME MODEL STATUS
agent_abc123 Research Bot openai/gpt-4o active
agent_def456 Writing Helper anthropic/... active
agc agents createInteractive prompts for name, instructions, model, etc.
Or pass flags:
agc agents create \
--name "My Bot" \
--instructions "You are helpful." \
--model-provider openai \
--model-id gpt-4oagc agents get agent_abc123agc agents update agent_abc123 --temperature 0.5
agc agents update agent_abc123 --instructions "New instructions"agc agents delete agent_abc123agc chat --agent agent_abc123Opens a real-time streaming chat. Type messages and get responses. Exit with /quit.
you › What is the capital of Kenya?
agent › The capital of Kenya is Nairobi.
you › What's the population?
agent › Nairobi has a population of approximately 4.4 million people…
you › /quit
Session saved. Resume with: agc chat --resume <sessionId>
In-session slash commands:
| Command | Description |
|---|---|
| /help | Show available slash commands |
| /session | Print the current session ID (for later resume) |
| /clear | Clear the terminal screen |
| /quit | Exit — session is preserved for future resume |
Set a default agent to skip --agent every time:
agc config set defaultAgentId agent_abc123
agc chat # uses defaultAgentId automaticallyagc chat --agent agent_abc123 --resume session_xyzagc run --agent agent_abc123 "Summarize https://example.com"The prompt is a positional argument (not a flag). Optional flags:
| Flag | Description |
|---|---|
--agent <agentId> |
Agent to run (falls back to defaultAgentId in config) |
--session <sessionId> |
Attach run to an existing session |
--no-stream |
Wait for the full response instead of streaming tokens |
--json |
Output raw event stream as JSON lines |
Useful for scripting:
agc run --agent agent_abc123 "Today's date?" | tee output.txtagc sessions list # list all sessions
agc sessions list --agent agent_abc123 # for a specific agent
agc sessions get session_xyz # show session detailsagc task create \
--title "Summarize Hacker News" \
--description "Get top 10 stories and write a 1-line summary of each" \
--agent agent_abc123agc task create \
--title "Morning briefing" \
--agent agent_abc123 \
--input '{"topic":"overnight news"}'agc task execute task_abc123 --watchRuns the task immediately and streams output to the terminal.
agc task list
agc task list --agent agent_abc123
agc task list --status runningagc task cancel task_abc123agc workflow listagc workflow create --file workflow.jsonWhere workflow.json is a workflow definition:
{
"name": "My Workflow",
"definition": {
"nodes": [...],
"edges": [...]
}
}agc workflow get workflow_abc123agc workflow run workflow_abc123 --input '{"url":"https://example.com"}' --watchStreams output as each node completes.
agc tools list
agc tools list --type mcp
agc tools list --type customagc tools create --file tool.jsonagc tools exec weather --agent agent_abc123 --args '{"city":"Nairobi"}'# SSE/HTTP server
agc mcp add --name "GitHub Tools" --type sse --url https://mcp.example.com/sse
# stdio server
agc mcp add --name "Filesystem" --type stdio \
--command "npx -y @modelcontextprotocol/server-filesystem /data"
agc mcp connect server_abc123agc mcp sync server_abc123agc mcp tools server_abc123agc mcp listagc mcp disconnect server_abc123agc wallet create --agent agent_abc123 --label main
agc wallet balance --agent agent_abc123
agc wallet list --agent agent_abc123
agc wallet send --agent agent_abc123 --to 0xADDRESS --amount 5.0 --token USDCagc memory list --agent agent_abc123
agc memory create --agent agent_abc123 --content "User prefers bullet lists" --type semantic
agc memory search --agent agent_abc123 "user preferences"
agc memory delete memory_abc123agc models ls # all supported models
agc models ls --provider openaiagc skills list # all available skills
agc skills get skill_abc123
agc skills create --slug concise-review --name "Concise review" \
--instructions "Review changes and report actionable findings."agc usage agents # usage across your agents
agc usage agent agent_abc123 # usage for a specific agent
agc logs list --agent agent_abc123
agc logs errors --agent agent_abc123All commands default to a human-readable table or text output. Add --json to get raw JSON:
agc agents list --json
agc run --agent agent_abc123 "Hello" --jsonagc is designed to be used in shell scripts:
#!/bin/bash
# Run an agent and save output
RESULT=$(agc run --agent agent_abc123 "Summarize: $(cat input.txt)" --json)
echo $RESULT | jq '.response' > summary.txt
# Chain tasks
agc task execute task_123 && agc task execute task_456