Argy Code CLI reference
Every command and option of the argy CLI, covering the TUI, run, server mode, authentication, sessions, modules, deployments and diagnostics.
This page documents every top-level command of the argy binary, its subcommands and its options. It is for developers who use Argy Code daily and for anyone wiring it into scripts or CI. To install the binary, see Install Argy Code.
The built-in help remains the reference for your installed version: argy --help and argy <command> --help. Help text follows the interface language (English or French).
Global options
These options are accepted by every command.
| Option | Type | Default | Description |
|---|---|---|---|
-h, --help | boolean | — | Show help. |
-v, --version | boolean | — | Show the version number. |
--print-logs | boolean | — | Write logs to stderr. |
--log-level | DEBUG | INFO | WARN | ERROR | — | Log level. |
--env | PROD (other values: see argy --help) | PROD | Argy environment; takes precedence over the ARGY_ENV variable and configuration. |
Command overview
| Command | Purpose |
|---|---|
argy [project] | Open the TUI (default command). |
argy run [message..] | Send a request non-interactively. |
argy attach <url> | Connect to a running Argy server. |
argy serve | Start a headless Argy server. |
argy acp | Start an ACP (Agent Client Protocol) server for IDEs. |
argy auth | Manage credentials. |
argy autoconfigure | Detect third-party coding tools and prepare their integration with Argy. |
argy agent | Create and list agents. |
argy mcp | Manage MCP servers. |
argy plug | Manage Argy Code plugins. |
argy models [provider] | List available models. |
argy stats | Show usage and cost statistics. |
argy session | Manage sessions. |
argy export [sessionID] | Export a session as JSON. |
argy import <file> | Import a session from a JSON file or a share URL. |
argy github | Manage the GitHub integration. |
argy pr <number> | Fetch a GitHub pull request branch, then open Argy. |
argy modules | Browse the catalog and manage deterministic modules. |
argy deploy <module> | Deploy a module. |
argy runs | Manage deployment runs. |
argy doctor | Show an environment diagnostic. |
argy storage | Inspect local storage. |
argy debug | Debugging and troubleshooting tools. |
argy upgrade [target] | Update Argy. |
argy uninstall | Uninstall Argy and its local files. |
argy completion | Generate the shell completion script. |
Terminal interface
argy [project]
Opens the TUI in project (current directory by default). Using the TUI is covered in TUI slash commands.
| Option | Type | Default | Description |
|---|---|---|---|
-m, --model | string | — | Model in provider/model format. |
-c, --continue | boolean | — | Continue the last session. |
-s, --session | string | — | ID of the session to continue. |
--prompt | string | — | Initial prompt. |
--agent | string | — | Agent to use (see Agents and modes). |
--port | number | 0 (random port) | Local server port. |
--hostname | string | 127.0.0.1 | Local server listen address. |
--mdns | boolean | false | Enable mDNS discovery (the listen address then defaults to 0.0.0.0). |
--mdns-domain | string | argy.local | mDNS domain name. |
--cors | array | [] | Additional domains allowed for CORS. |
argy # current directory
argy ./my-project --agent planner
argy -c # continue the last session
Non-interactive runs
argy run [message..]
Sends a message to the agent and prints the result without the TUI. Use it in scripts and CI; patterns are covered in Automation.
| Option | Type | Default | Description |
|---|---|---|---|
--command | string | — | Command to run; the message is used as its arguments. |
-c, --continue | boolean | — | Continue the last session. |
-s, --session | string | — | ID of the session to continue. |
--replay | string | — | Replay an existing session in read-only mode. |
--share | boolean | — | Share the session. |
-m, --model | string | — | Model in provider/model format. |
--cwd | string | current directory | Working directory for the run. |
--org | string | — | Organization ID to use. |
--agent | string | — | Agent to use. |
--skill | string | — | Name of a skill (SKILL.md) to load before running. |
--machine | boolean | false | Isolated workflow runtime; requires run-scoped inference authority (see below). |
--format | default | json | default | json emits raw JSON events. |
-f, --file | array | — | Files to attach to the message. |
--title | string | truncated prompt | Session title. |
--attach | string | — | URL of a running Argy server (e.g. http://localhost:4096). |
--port | number | random | Local server port. |
--variant | string | — | Model variant (provider-specific reasoning effort, e.g. high, max, minimal). |
--max-turns | number | — | Maximum number of agent turns before stopping. |
--thinking | boolean | false | Show thinking blocks. |
argy run "Add tests for src/lib/cn.ts"
argy run "Explain this file" --file src/app.ts
argy run --format json --agent reviewer "Review the uncommitted changes"
argy run --replay <sessionID>
-f, --file accepts several values: put the message before this option (or after --), otherwise it is read as a file to attach.
In autonomous mode, the agent is resumed while tasks in its plan remain incomplete. A failed run exits with a non-zero code.
--machine is meant for workflow executions: plugins, MCP servers, LSP, formatters, sharing and auto-update are disabled, and custom tools from the repository are ignored. It refuses to start when ARGY_PAT is present in the environment. See Permissions and security.
Server and IDE integrations
argy serve
Starts a headless Argy server that the TUI, argy run --attach or a client can connect to. Options: --port (default 0), --hostname (default 127.0.0.1), --mdns, --mdns-domain (default argy.local), --cors, with the same meaning as for argy [project].
argy attach
argy attach <url> opens the TUI on an Argy server that is already running.
| Option | Type | Default | Description |
|---|---|---|---|
--dir | string | — | Directory to work in. |
-s, --session | string | — | Session to continue. |
-p, --password | string | value of ARGY_SERVER_PASSWORD | Basic auth password. |
argy serve --port 4096
argy attach http://localhost:4096
The server listens on 127.0.0.1 by default. Only expose it on the network (--hostname 0.0.0.0 or --mdns) with basic auth configured (ARGY_SERVER_USERNAME, ARGY_SERVER_PASSWORD).
argy acp
Starts an ACP (Agent Client Protocol) server so a compatible editor can drive Argy Code. Same network options as argy serve, plus --cwd (working directory, default: current directory).
argy autoconfigure
Detects coding tools installed on the machine and prepares their integration with Argy, giving each tool its own credential.
| Option | Type | Description |
|---|---|---|
--list | boolean | List detected tools and detection evidence, without signing in. |
--guide | boolean | Print the manual steps without changing any file. |
--guide-html | string | Write a standalone HTML integration guide to the given path. |
--dry-run | boolean | Prepare actions without applying them or creating credentials. |
--sync | boolean | Recompute the sync plan for the selected tools. |
--yes | boolean | Explicitly confirm applicable actions. |
--login | boolean | Reuse the local session or trigger sign-in. |
--non-interactive | boolean | Never open a prompt or a browser. |
--json | boolean | JSON result with no configuration content and no secrets. |
--tool | array | IDs of the tools to select. |
--recoveries | string | Inspect recoveries in an absolute directory (read-only). |
--launch | claude-code | aider | junie | copilot-cli | opencode | codex | Launch the configured CLI with its dedicated credential (arguments after --). |
argy autoconfigure --list
argy autoconfigure --dry-run --tool codex
argy autoconfigure --launch codex -- --help
Authentication
argy auth
| Subcommand | Aliases | Description |
|---|---|---|
argy auth login | — | Sign in with a device code (default) or a PAT with --pat. |
argy auth logout | — | Sign out of Argy. |
argy auth status | ls, list | Show sign-in state, credits and quota. |
login option | Type | Default | Description |
|---|---|---|---|
--pat | boolean | false | Use a personal access token (PAT) instead of the device code. |
The full flow is described in Install Argy Code; tokens and platform identity in IAM and authentication.
Agents, models and extensions
argy agent
| Subcommand | Description |
|---|---|
argy agent create | Guided creation of a custom agent. |
argy agent list | List available agents (built-in and custom). |
create option | Type | Description |
|---|---|---|
--path | string | Directory where the agent file is generated. |
--description | string | What the agent should do. |
--mode | all | primary | subagent | Agent mode. |
--tools | string | Comma-separated list of tools (default: all). |
-m, --model | string | Model in provider/model format. |
Built-in agents and modes are described in Agents and modes.
argy models [provider]
Lists the models the Argy LLM Gateway exposes to your account, optionally filtered by provider.
| Option | Type | Description |
|---|---|---|
--verbose | boolean | Include model metadata such as costs. |
--refresh | boolean | Refresh the model cache from the Argy LLM Gateway. |
Models and the matching API are documented in LLM Gateway.
argy mcp
| Subcommand | Aliases | Description |
|---|---|---|
argy mcp add | — | Add an MCP server (interactive wizard). |
argy mcp list | ls | List MCP servers and their status. |
argy mcp auth [name] | — | Authenticate with an OAuth-enabled MCP server. |
argy mcp logout [name] | — | Remove OAuth credentials for an MCP server. |
argy mcp debug <name> | — | Debug the OAuth connection of an MCP server. |
argy plug
| Subcommand | Aliases | Description |
|---|---|---|
argy plug list | ls | List installed plugins. |
argy plug install <path> | — | Install a plugin from a local path. |
argy plug remove <name> | rm, uninstall | Remove a plugin. |
Configuring MCP servers, plugins and skills is covered in Extensions.
Sessions and usage
argy session
| Subcommand | Description |
|---|---|
argy session list | List sessions. Options: -n, --max-count (number), --format (table | json, default table). |
argy session recovery status <sessionID> | Explain why a session is blocked on recovery and what to do. |
argy session recovery acknowledge <sessionID> | Explicitly acknowledge the block after checking it by hand. |
argy session recovery adopt <sessionID> | Explicitly adopt a session that predates recovery tracking. |
argy session recovery repair <sessionID> | Close obligations left by guard refusals; dry-run unless --apply is passed. |
argy export and argy import
argy export <sessionID> > session.json
argy import session.json
argy import <argy.cloud-share-url>
argy import <file> accepts a path to a JSON file or an argy.cloud share URL.
argy stats
| Option | Type | Default | Description |
|---|---|---|---|
--days | number | all time | Stats for the last N days. |
--tools | number | all | Number of tools to show. |
--models | number (optional) | hidden | Show per-model stats; with a number, limit to the top N. |
--project | string | all projects | Filter by project; an empty string means the current project. |
For an organization-wide view, use Argy Portal (see Governance and observability).
GitHub
| Command | Description |
|---|---|
argy pr <number> | Fetch the pull request branch, then open Argy on it. |
argy github install | Install the GitHub agent. |
argy github run | Run the GitHub agent. Options: --event (mock GitHub event), --token (GitHub personal access token). |
Modules and deployments
argy modules, argy deploy and argy runs connect your terminal to the Argy Portal module catalog (see Projects and modules). The full lifecycle of a deterministic module is described in Extensions, and the equivalent endpoints in Platform API.
argy modules
| Subcommand | Aliases | Description |
|---|---|---|
list | ls | List available modules; --format accepts table or json. |
search <query> | — | Search modules. |
info <id> | — | Show module details. |
init <directory> | — | Scaffold a deterministic bundle with mocked tests. |
run <directory> | — | Local dry-run with simulated dependencies; never publishes and never reaches the real network. |
validate <directory> | — | Validate a module and its entrypoint. |
package <directory> | — | Build a deterministic ZIP archive and its SHA-256 digest. |
create <directory> | — | Create a private module draft and upload the bundle. |
upload <directory> | — | Upload an immutable version to an existing module. |
publish <directory> | — | Create, upload and publish a version. |
init options:
| Option | Type | Default | Description |
|---|---|---|---|
--name | string | directory name | Module name. |
--runtime | node | bun | python | node | Bundle runtime. bun is opt-in (local dry-run on macOS only); python targets Python 3.11 with the standard library and vendored pure dependencies. |
--force | boolean | false | Replace generated files only. |
--json | boolean | false | Machine-readable result. |
run options:
| Option | Type | Default | Description |
|---|---|---|---|
--config | JSON | simulated {} | Module configuration object (not a path), validated against its schema. |
--input | JSON | {} | Input object (not a path). |
--fixtures | JSON | {} | Simulated responses: http, tools, inference, notifier, plus unbound optional secrets. |
--timeout | number (ms) | 10000 | Local process timeout (120,000 at most). |
--json | boolean | false | Structured result or diagnostics. |
Options shared by validate, package, create, upload and publish:
| Option | Type | Default | Description |
|---|---|---|---|
--output | string | — | ZIP inside the module dist/ folder; an identical archive is reused, never overwritten. |
--module-id | string | — | UUID of an existing module (required for upload). |
--sha256 | string | — | Expected lowercase SHA-256 of the bundle. |
--visibility | PRIVATE | ORGANIZATION | PUBLIC | manifest value | Visibility on create or publish; rejected by upload. |
--dry-run | boolean | false | Validate and build without writing or making network requests. |
--json | boolean | false | Structured result or error. |
--yes | boolean | false | Confirm remote creation, upload or publication. |
--non-interactive | boolean | false | Never prompt; remote mutations then require --yes. |
--publish-only | boolean | false | publish only: verify and publish an already uploaded bundle without replacing it. |
argy modules init ./my-module --runtime python
argy modules run ./my-module --input '{"name":"demo"}'
argy modules package ./my-module --output ./my-module/dist/module.zip --json
argy modules publish ./my-module --sha256 <digestSha256> --visibility ORGANIZATION --yes --non-interactive
package requires --output (or --dry-run for validation only); without either, it fails with OUTPUT_REQUIRED. Its JSON output includes the archive's digestSha256: keep the value of the archive you reviewed and pass it to --sha256 on create, upload or publish. If the rebuilt bundle no longer matches that digest, the command fails with DIGEST_MISMATCH instead of publishing different content. To add a version to an existing module, use upload with its ID (--module-id).
argy deploy
argy deploy <module> deploys a module (name or ID), then streams its logs. --no-logs (default false) skips log streaming.
argy runs
| Subcommand | Aliases | Description |
|---|---|---|
argy runs list | ls | List runs. Options: --format (table | json), -n, --limit. |
argy runs logs <runId> | — | Show the logs of a run; -f, --follow streams them. |
argy runs cancel <runId> | — | Cancel a running deployment. |
Diagnostics and maintenance
argy doctor
Prints an environment diagnostic. --clean-stale-owners (opt-in) removes session owner markers whose owner process is proven dead.
argy storage
Read subcommands change nothing: status, doctor (and its equivalent diagnose), usage, legacy-status. Write actions are explicit:
| Subcommand | Description |
|---|---|
rollback --target <dir> | Export local storage to JSON files; --force overwrites target files one by one. |
cleanup-legacy | Move legacy JSON storage to the trash after reconciliation; dry-run unless --confirm is passed. |
release-legacy | Explicitly release reconciled provenance without deleting any file. |
| Exit code | Meaning |
|---|---|
0 | Success or complete report. |
1 | Error or refused operation. |
2 | Corrupted or foreign database. |
3 | Storage active or locked; refused without changes. |
argy debug
| Subcommand | Description |
|---|---|
config | Show the resolved configuration. |
paths | Show global paths (data, config, cache, state). |
skill | List available skills. |
agent <name> | Show an agent's configuration; --tool and --params run a tool. |
lsp, rg, file, snapshot | LSP, search, file system and snapshot debugging utilities. |
scrap | List known projects. |
wait | Wait indefinitely (debugging). |
argy debug config is the first thing to run when a Configuration setting does not seem to apply.
argy upgrade, argy uninstall, argy completion
argy upgrade [target] and argy uninstall are covered in Install Argy Code. argy completion generates the shell completion script; check argy completion --help on your machine before adding it to your shell configuration.
Useful environment variables
| Variable | Effect |
|---|---|
ARGY_PAT | Personal access token for non-interactive use. |
ARGY_ENV | Argy environment (PROD by default); --env takes precedence. |
ARGY_SERVER_USERNAME, ARGY_SERVER_PASSWORD | Basic auth for the local server. |
Other variables are listed in Configuration.
Common errors
| Situation | Fix |
|---|---|
| An option is not recognized. | Check your version with argy --version and the command help with argy <command> --help. |
--format json is rejected on another command. | --format json is an option of run (and some subcommands), not a global option. |
argy modules publish stops in --non-interactive mode. | Add --yes: every remote mutation requires it when prompts are disabled. |
argy run --machine refuses to start. | Remove ARGY_PAT from the environment: machine mode requires run-scoped inference authority. |