AIX CLI Command Reference
This document provides complete syntax, arguments, options, and exit code definitions for the aix CLI binary.
1. Top-Level Command Syntax
aix [OPTIONS] [PROMPT]
aix [COMMAND] [ARGS...]Global Options
| Option | Shorthand | Type | Description |
|---|---|---|---|
--mode | -m | control|auto|fast|plan | Execution autonomy mode (Default: control) |
--yes | -y | flag | Auto-approve bounded tool executions (Identical to --mode auto) |
--plan | flag | Dry-run mode: generates diff plan without writing to filesystem | |
--target | -t | sn|gcp|local | Environment endpoint target profile (Default: sn) |
--model | string | Override default model (e.g. claude-3-5-sonnet, qwen-max-longcontext) | |
--timeout | integer | Maximum execution timeout in seconds (Default: 600) | |
--verbose | -v | flag | Enable detailed debug logs, JSON-RPC payloads, and timing |
--version | -V | flag | Display version information and exit |
--help | -h | flag | Show help screen and command options |
2. Command Reference
aix run / Direct Prompt Execution
Execute autonomous engineering workflows directly:
# Interactive single prompt
aix "Refactor the payment retry loop in payments/worker.py to use exponential backoff"
# Fully automated non-interactive SWE loop
aix -y "Fix issue #412: WMS GC stock adjustment event dropped on network timeout"
# Stream execution output in JSONL format for CI/CD runners
aix --mode auto --output jsonl "Run static security audit"aix doctor
Audit environment, credentials, network routes, and sandbox permissions:
aix doctor [--fix] [--json]aix profile
Manage corporate environment connections:
aix profile list # List all configured profiles
aix profile show # Display active profile details
aix profile use <name> # Switch active profile (e.g. sn, gcp)
aix profile add <name> # Add new connection targetaix tui
Launch the 4-Split interactive full-screen terminal dashboard:
aix tui [--session <session_id>]aix vibe (Multi-Agent Swarm Orchestration)
Orchestrate a team of specialized agents (Architect, Dev, Data Engineer, QA, Ops):
# Launch multi-agent cooperative team
aix vibe --team fullstack "Build a high-throughput webhook receiver with Kafka forwarding"
# Run architecture tournament between 3 LLM models
aix vibe --tournament 3 "Design a distributed rate limiter with Redis Cluster backend"aix mcp (Model Context Protocol Integration)
Inspect and invoke enterprise MCP server tools:
aix mcp list # List connected MCP servers & active tools
aix mcp call <tool> <args> # Manually invoke an MCP tool with JSON arguments
aix mcp ping # Verify connectivity to remote MCP server poolisa app / aix app (Enterprise Fullstack Application Engineering)
Productizes Dual-Engine Enterprise Applications with live AEP catalog binding, contract verification, and governed multi-target GitOps deployment:
# 1. Scaffold a fullstack enterprise application
isa app scaffold <name> [--title <title>] [--template fullstack|workbench|api] [--dir <path>]
# 2. Discover available enterprise catalog capabilities, MCP tools, and Cube.js models
isa app catalog list [--kind <kind>] [--provider <provider>] [--search <text>] [--limit N]
# 3. Bind live enterprise capability or MCP mesh into app governance manifest (aep.json)
isa app bind <path> [--capability <id>] [--mcp <name>] [--cube <model>] [--vllm <model>]
# 4. Verify dual-stack contract integrity, Pydantic schemas, and frontend structure
isa app verify [path]
# 5. Governed deployment via target-native builder, SLSA L3 attestation, and GitOps promotion
isa app deploy [path] [--target gcp|sn] [--env prod|staging] [--repo <owner/repo>] [--timeout <sec>]
# 6. List and inventory local enterprise applications
isa app listApp Options & Flags:
--title <text>: Human-readable application title (e.g.,"SweetNight Ocean Control Tower").--template <fullstack|workbench|api>: Architecture preset:fullstack(default: FastAPI backend + Vite/React 18 frontend),workbench(Tower kit data card grid with AEP actions), orapi(headless FastAPI).--target <gcp|sn>: Deployment target cluster:gcp(default forisa, targeting GKEhttps://isagent.io/apps/<slug>/) orsn(default foraix, targeting SweetNight On-Premisehttps://aix.snnc.cc/apps/<slug>/).--capability <id>: Live AEP capability ID to bind (e.g.cap-iam-application-commercial-tower-prod,agent.config.update).--mcp <name>: Enterprise MCP server mesh name to bind (e.g.sn-erp-mcp,sn-feishu-mcp).--cube <model>: Semantic Lakehouse Cube.js data model to bind (e.g.ScmGlobalMultiEchelonInventory).--plan: Dry-run mode to preview generated files or release payloads without executing mutations.
isa acp / aix acp (Agent Client Protocol stdio Server)
Launches an Agent Client Protocol (ACP) v1 JSON-RPC 2.0 stdio server. Provides a low-latency, bidirectional interface for external IDEs (e.g. Zed editor), GUI wrappers, and orchestrators to control autonomous agent sessions.
Strict Stdio Hygiene Invariant:
stdoutcarries exclusively valid, newline-delimited JSON-RPC 2.0 frames with zero unformatted log lines, debug traces, or warnings leaking into the stream.- All internal logs, warnings (
warnings.showwarning), and diagnostic messages are redirected tostderr. - ANSI colors and escape sequences are automatically disabled (
NO_COLOR=1,ANSI_COLORS_DISABLED=1,TERM=dumb).
Protocol Methods:
initialize: Performs protocol handshake and capability negotiation. ReturnsprotocolVersion: 1,capabilities: {}, andserverInfo: { "name": "<brand>-acp-server", "version": "1.8.0" }.session/new: Instantiates an isolated agent workspace session. Acceptscwd, optionalmcpServers, and optionalsessionId. Returns a unique UUIDsessionId.session/prompt: Dispatches an engineering prompt turn into the session. AcceptssessionId,prompt,streaming, andnotify. Emitssession/updatenotifications during execution and returns{ "stopReason": "endTurn" }(or{ "stopReason": "cancelled" }).session/cancel: Safely interrupts an in-flight prompt turn and restores session consistency. Returns{ "status": "cancelled" }.ping: Lightweight liveness check. Returns{}.
# Launch ACP JSON-RPC server on stdio
isa acp
# Enterprise SweetNight profile ACP server
aix acpisa hook <bash|zsh|pwsh> (Shell Integration & Failure Context Capture)
Generates native shell integration scripts that instrument the active terminal session with OSC 133 semantic escape sequences and automated error state capture.
OSC 133 Semantic Escape Markers:
\033]133;A\007: Prompt Start — signals prompt rendering begin.\033]133;B\007: Command Start / Prompt End — marks start of user command entry.\033]133;C\007: Command Executed / Output Start — marks start of command output.\033]133;D;{exit_code}\007: Command Finished / Output End — carries the integer exit code.
Failure State Storage & Permissions:
- Non-zero command exit triggers background capture (
isa hook record) into~/.isa/state/last_failure_<tty>.json. - State directory is created with mode
0700(rwx------) and state files are atomically written with mode0600(rw-------). - Captured payload schema:
{ "tty", "exit_code", "command", "timestamp", "cwd", "error_output", "shell" }. - TTY sanitization (
sanitize_tty) prevents cross-tab collision and path traversal (e.g./dev/pts/2→pts_2).
# Bash (~/.bashrc)
eval "$(isa hook bash)"
# Zsh (~/.zshrc)
eval "$(isa hook zsh)"
# PowerShell ($PROFILE)
Invoke-Expression (& isa hook pwsh)
# Internal recording helper (invoked asynchronously by hook)
isa hook record --tty pts_1 --code 1 --cmd "pytest" --cwd "$PWD" --shell bashisa explain / aix explain (Intelligent Failure Diagnosis)
Diagnoses the last failed command executed in the active terminal tab or TTY session using AST symbol analysis and codebase context.
Capabilities & AST Symbol Resolution:
- Resolves active terminal TTY via
--tty,TTY,GPG_TTY,SSH_TTY, or streamos.ttyname(). - Reads
~/.isa/state/last_failure_<tty>.json. If empty or missing, safely displays"No recent command failure recorded for terminal <tty>". - Parses command strings and error tracebacks to extract candidate code symbols.
- Queries SQLite-backed
CodebaseASTIndexer(.isa/cache/symbols.db) to identify matching function, class, or method signatures, falling back to fuzzy matching viadifflib. - Diagnoses exit codes (
126Permission Denied,127Command Not Found,137SIGKILL / OOM,139SIGSEGV) and Python exceptions (AttributeError,TypeError,SyntaxError, etc.) into structuredActionableDiagnosticreports.
Options & Flags:
--tty <name>: Explicitly specify target terminal TTY (e.g.pts_1).--json: Output structured JSON diagnostic payload.
# Diagnose the last failed command in current terminal
isa explain
# Target a specific terminal session with JSON output
isa explain --tty pts_2 --jsonisa fix / aix fix (Automated Failure Remediation)
Recommends concrete command corrections or generates AST-level code patches for the last recorded command failure.
Remediation Engine:
- Corrects command typos (
gti→git,puthon→python). - Resolves Git subcommand and remote typos (
git ckeckout→git checkout,git push origan main→git push origin main). - Shell permission and structure fixes (
chmod +x <script>,mkdir -p <dir>,touch <file>). - Code patches with intra-line word-level diffs (
compute_word_diff_block) for missing syntax colons or module attribute typos.
Safety Guardrails:
- Automatically detects and refuses dangerous, ambiguous, or destructive operations (e.g. piped shells
| sh/| sudo bash, redirects to root> /, recursive deletionsrm -rf /). Displays[WARNING] Refused: Operation is dangerous or ambiguous.
Options & Flags:
--apply,-y,--yes,-a: Directly apply the recommended remediation or patch to disk. Without this flag, runs in preview mode.--tty <name>: Target specific terminal TTY.--json: Output fix plan in JSON format.
# Preview recommended remediation and word diff
isa fix
# Apply remediation automatically
isa fix --apply
# Non-interactive automated application
isa fix -y3. Process Exit Codes (0-6)
Automation scripts and CI/CD pipelines rely on deterministic exit codes:
| Code | Label | Meaning | Recommended Action |
|---|---|---|---|
0 | SUCCESS | Task completed cleanly; all verification tests passed | Proceed to next pipeline stage |
1 | GENERAL_ERROR | Unhandled exception or unexpected failure | Check standard error output |
2 | VERIFICATION_FAILED | Code generated, but tests failed to pass | Inspect pytest report; increase loop iterations |
3 | CIRCUIT_BREAKER_TRIPPED | Repetitive tool failures reached breaker threshold | Check permissions or invalid diff syntax |
4 | TIMEOUT | Task runtime exceeded --timeout limit | Increase timeout or decompose prompt into smaller tasks |
5 | POLICY_VIOLATION | Action denied by Cedar governance / sandbox rule | Request elevated PAM lease or adjust policy |
6 | AUTH_EXPIRED | SSO token or API key expired | Run aix auth login to renew credentials |
4. Error Taxonomy & Troubleshooting
| Error Code | Root Cause | Remediation |
|---|---|---|
ERR_AUTH_LEASE_EXPIRED | PAM lease exceeded max TTL (8 hours) | Run aix auth login --target sn to acquire a new lease |
ERR_GATEWAY_TIMEOUT | Upstream model pool latency spike | Specify fallback model via --model claude-3-5-haiku |
ERR_SANDBOX_ESCAPE_PREVENTED | Tool attempted writing outside workspace root | Keep file paths relative to git root |
ERR_DIFF_HUNK_REJECTED | File modified concurrently on disk | Run git stash or re-synchronize working tree |