Skip to content

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.

OptionTypeDefaultDescription
-h, --helpboolean—Show help.
-v, --versionboolean—Show the version number.
--print-logsboolean—Write logs to stderr.
--log-levelDEBUG | INFO | WARN | ERROR—Log level.
--envPROD (other values: see argy --help)PRODArgy environment; takes precedence over the ARGY_ENV variable and configuration.

Command overview

CommandPurpose
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 serveStart a headless Argy server.
argy acpStart an ACP (Agent Client Protocol) server for IDEs.
argy authManage credentials.
argy autoconfigureDetect third-party coding tools and prepare their integration with Argy.
argy agentCreate and list agents.
argy mcpManage MCP servers.
argy plugManage Argy Code plugins.
argy models [provider]List available models.
argy statsShow usage and cost statistics.
argy sessionManage sessions.
argy export [sessionID]Export a session as JSON.
argy import <file>Import a session from a JSON file or a share URL.
argy githubManage the GitHub integration.
argy pr <number>Fetch a GitHub pull request branch, then open Argy.
argy modulesBrowse the catalog and manage deterministic modules.
argy deploy <module>Deploy a module.
argy runsManage deployment runs.
argy doctorShow an environment diagnostic.
argy storageInspect local storage.
argy debugDebugging and troubleshooting tools.
argy upgrade [target]Update Argy.
argy uninstallUninstall Argy and its local files.
argy completionGenerate 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.

OptionTypeDefaultDescription
-m, --modelstring—Model in provider/model format.
-c, --continueboolean—Continue the last session.
-s, --sessionstring—ID of the session to continue.
--promptstring—Initial prompt.
--agentstring—Agent to use (see Agents and modes).
--portnumber0 (random port)Local server port.
--hostnamestring127.0.0.1Local server listen address.
--mdnsbooleanfalseEnable mDNS discovery (the listen address then defaults to 0.0.0.0).
--mdns-domainstringargy.localmDNS domain name.
--corsarray[]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.

OptionTypeDefaultDescription
--commandstring—Command to run; the message is used as its arguments.
-c, --continueboolean—Continue the last session.
-s, --sessionstring—ID of the session to continue.
--replaystring—Replay an existing session in read-only mode.
--shareboolean—Share the session.
-m, --modelstring—Model in provider/model format.
--cwdstringcurrent directoryWorking directory for the run.
--orgstring—Organization ID to use.
--agentstring—Agent to use.
--skillstring—Name of a skill (SKILL.md) to load before running.
--machinebooleanfalseIsolated workflow runtime; requires run-scoped inference authority (see below).
--formatdefault | jsondefaultjson emits raw JSON events.
-f, --filearray—Files to attach to the message.
--titlestringtruncated promptSession title.
--attachstring—URL of a running Argy server (e.g. http://localhost:4096).
--portnumberrandomLocal server port.
--variantstring—Model variant (provider-specific reasoning effort, e.g. high, max, minimal).
--max-turnsnumber—Maximum number of agent turns before stopping.
--thinkingbooleanfalseShow 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.

OptionTypeDefaultDescription
--dirstring—Directory to work in.
-s, --sessionstring—Session to continue.
-p, --passwordstringvalue of ARGY_SERVER_PASSWORDBasic 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.

OptionTypeDescription
--listbooleanList detected tools and detection evidence, without signing in.
--guidebooleanPrint the manual steps without changing any file.
--guide-htmlstringWrite a standalone HTML integration guide to the given path.
--dry-runbooleanPrepare actions without applying them or creating credentials.
--syncbooleanRecompute the sync plan for the selected tools.
--yesbooleanExplicitly confirm applicable actions.
--loginbooleanReuse the local session or trigger sign-in.
--non-interactivebooleanNever open a prompt or a browser.
--jsonbooleanJSON result with no configuration content and no secrets.
--toolarrayIDs of the tools to select.
--recoveriesstringInspect recoveries in an absolute directory (read-only).
--launchclaude-code | aider | junie | copilot-cli | opencode | codexLaunch 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

SubcommandAliasesDescription
argy auth login—Sign in with a device code (default) or a PAT with --pat.
argy auth logout—Sign out of Argy.
argy auth statusls, listShow sign-in state, credits and quota.
login optionTypeDefaultDescription
--patbooleanfalseUse 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

SubcommandDescription
argy agent createGuided creation of a custom agent.
argy agent listList available agents (built-in and custom).
create optionTypeDescription
--pathstringDirectory where the agent file is generated.
--descriptionstringWhat the agent should do.
--modeall | primary | subagentAgent mode.
--toolsstringComma-separated list of tools (default: all).
-m, --modelstringModel 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.

OptionTypeDescription
--verbosebooleanInclude model metadata such as costs.
--refreshbooleanRefresh the model cache from the Argy LLM Gateway.

Models and the matching API are documented in LLM Gateway.

argy mcp

SubcommandAliasesDescription
argy mcp add—Add an MCP server (interactive wizard).
argy mcp listlsList 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

SubcommandAliasesDescription
argy plug listlsList installed plugins.
argy plug install <path>—Install a plugin from a local path.
argy plug remove <name>rm, uninstallRemove a plugin.

Configuring MCP servers, plugins and skills is covered in Extensions.

Sessions and usage

argy session

SubcommandDescription
argy session listList 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

OptionTypeDefaultDescription
--daysnumberall timeStats for the last N days.
--toolsnumberallNumber of tools to show.
--modelsnumber (optional)hiddenShow per-model stats; with a number, limit to the top N.
--projectstringall projectsFilter by project; an empty string means the current project.

For an organization-wide view, use Argy Portal (see Governance and observability).

GitHub

CommandDescription
argy pr <number>Fetch the pull request branch, then open Argy on it.
argy github installInstall the GitHub agent.
argy github runRun 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

SubcommandAliasesDescription
listlsList 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:

OptionTypeDefaultDescription
--namestringdirectory nameModule name.
--runtimenode | bun | pythonnodeBundle runtime. bun is opt-in (local dry-run on macOS only); python targets Python 3.11 with the standard library and vendored pure dependencies.
--forcebooleanfalseReplace generated files only.
--jsonbooleanfalseMachine-readable result.

run options:

OptionTypeDefaultDescription
--configJSONsimulated {}Module configuration object (not a path), validated against its schema.
--inputJSON{}Input object (not a path).
--fixturesJSON{}Simulated responses: http, tools, inference, notifier, plus unbound optional secrets.
--timeoutnumber (ms)10000Local process timeout (120,000 at most).
--jsonbooleanfalseStructured result or diagnostics.

Options shared by validate, package, create, upload and publish:

OptionTypeDefaultDescription
--outputstring—ZIP inside the module dist/ folder; an identical archive is reused, never overwritten.
--module-idstring—UUID of an existing module (required for upload).
--sha256string—Expected lowercase SHA-256 of the bundle.
--visibilityPRIVATE | ORGANIZATION | PUBLICmanifest valueVisibility on create or publish; rejected by upload.
--dry-runbooleanfalseValidate and build without writing or making network requests.
--jsonbooleanfalseStructured result or error.
--yesbooleanfalseConfirm remote creation, upload or publication.
--non-interactivebooleanfalseNever prompt; remote mutations then require --yes.
--publish-onlybooleanfalsepublish 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

SubcommandAliasesDescription
argy runs listlsList 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:

SubcommandDescription
rollback --target <dir>Export local storage to JSON files; --force overwrites target files one by one.
cleanup-legacyMove legacy JSON storage to the trash after reconciliation; dry-run unless --confirm is passed.
release-legacyExplicitly release reconciled provenance without deleting any file.
Exit codeMeaning
0Success or complete report.
1Error or refused operation.
2Corrupted or foreign database.
3Storage active or locked; refused without changes.

argy debug

SubcommandDescription
configShow the resolved configuration.
pathsShow global paths (data, config, cache, state).
skillList available skills.
agent <name>Show an agent's configuration; --tool and --params run a tool.
lsp, rg, file, snapshotLSP, search, file system and snapshot debugging utilities.
scrapList known projects.
waitWait 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

VariableEffect
ARGY_PATPersonal access token for non-interactive use.
ARGY_ENVArgy environment (PROD by default); --env takes precedence.
ARGY_SERVER_USERNAME, ARGY_SERVER_PASSWORDBasic auth for the local server.

Other variables are listed in Configuration.

Common errors

SituationFix
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.

See also