CLI Reference
Terminal-first access to Agent Commons with the agc command.
CLI Reference
The agc command-line tool gives you full access to Agent Commons from your terminal — with an interactive menu, streaming chat, and scriptable output.
Installation
Interactive menu
Running agc with no arguments opens a full interactive menu — no commands to memorise:
Use ↑ / ↓ arrow keys to navigate, Enter to select. The menu covers every feature: Chat, Run, Sessions, Agents, Tasks, Workflows, MCP, Skills, Wallet, Usage, Logs, and Config.
If no credentials are saved yet, the menu automatically launches the setup wizard.
Authentication
First-time setup
A three-step guided wizard runs:
- API Endpoint — defaults to https://api.agentcommons.io. Press Enter to accept.
- API Key — your browser opens automatically to agentcommons.io/settings. Generate a key there, paste it in the terminal.
- Wallet address — your 0x… identity used as the request initiator.
Credentials are stored in ~/.agc/config.json (mode 0600).
Other auth commands
Environment variables
You can set credentials via env vars instead of running agc login:
Env vars take precedence over the config file.
Agents
Chat
agc chat opens an interactive streaming REPL. Each conversation is tied to a session so history is preserved.
In-session slash commands:
| Command | Description |
|---|---|
| /help | Show available slash commands |
| /session | Print the current session ID (for later resume) |
| /tools | Show local tools status and cached permissions |
| /clear | Clear the terminal screen |
| /quit | Exit — session is preserved for future resume |
File context: prefix any path with @ to inject its contents into your message:
Set a default agent so you can skip --agent every time:
Run (one-shot)
agc run sends a single prompt and exits. Useful for scripting, piping output, or quick one-off queries.
Session flags
By default agc run is stateless — each call starts fresh. Use session flags when you need the agent to remember context across calls:
| Flag | Description |
|---|---|
--session <id> | Resume an existing session. Validates the ID before running. |
--new-session | Create a new session, print its ID, use it for this run. |
The session ID is printed at the end of every run that uses one, so you can copy it straight from the terminal.
Local file system flags
Give the agent direct access to files on your machine:
| Flag | Description |
|---|---|
--local | Enable local file system access with per-operation confirmation prompts |
--yes / -y | Enable local file system access and auto-approve all operations |
All file operations are sandboxed to the current working directory. Sensitive paths (.ssh, .aws, .env, credentials) are always blocked regardless of flags.
When --local or --yes is active, the agent gains access to these tools:
| Tool | Description |
|---|---|
cli_read_file | Read a file (plain text, PDF, or Word doc) |
cli_write_file | Write or overwrite a file |
cli_list_directory | List directory contents |
cli_search_files | Find files by name pattern |
cli_run_command | Run a shell command and capture output |
cli_start_process | Start a long-running background command |
cli_wait_for_process | Wait for a background process and stream its output |
cli_process_status | Check status of a background process |
cli_kill_process | Kill a background process |
cli_list_processes | List all background processes this session |
Combining flags
Sessions
Session logs from agc chat and agc run --local are written to ~/.agc/sessions/<sessionId>.jsonl. Each line is a JSON record of the message or tool call.
Tasks
Workflows
Tools
MCP Servers
Wallets
Memory
Models
Skills
Usage & Logs
Output formats
All commands default to human-readable output. Add --json for machine-readable JSON: