Skip to Content

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

OptionShorthandTypeDescription
--mode-mcontrol|auto|fast|planExecution autonomy mode (Default: control)
--yes-yflagAuto-approve bounded tool executions (Identical to --mode auto)
--planflagDry-run mode: generates diff plan without writing to filesystem
--target-tsn|gcp|localEnvironment endpoint target profile (Default: sn)
--modelstringOverride default model (e.g. claude-3-5-sonnet, qwen-max-longcontext)
--timeoutintegerMaximum execution timeout in seconds (Default: 600)
--verbose-vflagEnable detailed debug logs, JSON-RPC payloads, and timing
--version-VflagDisplay version information and exit
--help-hflagShow 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 target

aix 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 pool

isa 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 list

App 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), or api (headless FastAPI).
  • --target <gcp|sn>: Deployment target cluster: gcp (default for isa, targeting GKE https://isagent.io/apps/<slug>/) or sn (default for aix, targeting SweetNight On-Premise https://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:

  • stdout carries 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 to stderr.
  • 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. Returns protocolVersion: 1, capabilities: {}, and serverInfo: { "name": "<brand>-acp-server", "version": "1.8.0" }.
  • session/new: Instantiates an isolated agent workspace session. Accepts cwd, optional mcpServers, and optional sessionId. Returns a unique UUID sessionId.
  • session/prompt: Dispatches an engineering prompt turn into the session. Accepts sessionId, prompt, streaming, and notify. Emits session/update notifications 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 acp

isa 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 mode 0600 (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 bash

isa 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 stream os.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 via difflib.
  • Diagnoses exit codes (126 Permission Denied, 127 Command Not Found, 137 SIGKILL / OOM, 139 SIGSEGV) and Python exceptions (AttributeError, TypeError, SyntaxError, etc.) into structured ActionableDiagnostic reports.

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 --json

isa 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 deletions rm -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 -y

3. Process Exit Codes (0-6)

Automation scripts and CI/CD pipelines rely on deterministic exit codes:

CodeLabelMeaningRecommended Action
0SUCCESSTask completed cleanly; all verification tests passedProceed to next pipeline stage
1GENERAL_ERRORUnhandled exception or unexpected failureCheck standard error output
2VERIFICATION_FAILEDCode generated, but tests failed to passInspect pytest report; increase loop iterations
3CIRCUIT_BREAKER_TRIPPEDRepetitive tool failures reached breaker thresholdCheck permissions or invalid diff syntax
4TIMEOUTTask runtime exceeded --timeout limitIncrease timeout or decompose prompt into smaller tasks
5POLICY_VIOLATIONAction denied by Cedar governance / sandbox ruleRequest elevated PAM lease or adjust policy
6AUTH_EXPIREDSSO token or API key expiredRun aix auth login to renew credentials

4. Error Taxonomy & Troubleshooting

Error CodeRoot CauseRemediation
ERR_AUTH_LEASE_EXPIREDPAM lease exceeded max TTL (8 hours)Run aix auth login --target sn to acquire a new lease
ERR_GATEWAY_TIMEOUTUpstream model pool latency spikeSpecify fallback model via --model claude-3-5-haiku
ERR_SANDBOX_ESCAPE_PREVENTEDTool attempted writing outside workspace rootKeep file paths relative to git root
ERR_DIFF_HUNK_REJECTEDFile modified concurrently on diskRun git stash or re-synchronize working tree
Was this page helpful?