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 secure browser sign-in, an interactive menu, streaming chat, and scriptable output.
Installation
Interactive menu
Running agc with no arguments opens the interactive menu:
Use ↑ / ↓ to navigate and Enter to select. The menu covers chat, runs, sessions, agents, tasks, workflows, files, code projects, developer API keys, MCP, skills, wallets, usage, logs, and configuration.
If you have not signed in, the menu starts the sign-in flow.
Authentication
Sign in with your Commons account
The CLI creates a short-lived device authorization request, opens Agent Commons in your browser, and waits for you to approve it. Your terminal never asks for your password.
If you are working on a remote host, print the approval URL instead:
The CLI stores its account session in ~/.agc/config.json with file mode 0600. It refreshes short-lived API access tokens when needed.
Use a project API key
For CI and other non-interactive environments, pass a project-scoped csk_* key:
Create and scope project keys in Agent Commons → Settings → Developer API keys or with the agc keys commands after account sign-in. Treat keys as server-side secrets.
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.
Developer projects and API keys
Developer API keys belong to a project, include explicit scopes, and can have an expiration date. The plaintext key is returned only when you create it.
Use agc api-keys as an alias for agc keys.
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
Library and code projects
Set a default agent with agc config set defaultAgentId <agentId> to omit repeated --agent flags.
Tools
MCP Servers
Wallets
Memory
Models
Skills
Usage and logs
Output formats
All commands default to human-readable output. Add --json for machine-readable JSON: