AIX Command Line Interface (CLI) Master Guide
AIX Agentic CLI is the next-generation autonomous engineering environment built for software engineers, data platform developers, and site reliability teams. Beyond conversational agent interactions and a 4-split TUI dashboard, it delivers industry State of the Art (SOTA) autonomous long-running software engineering loops (SWE Loops)—capable of end-to-end task planning, executing batched tool calls, observing runtime feedback, tripping circuit breakers on error, and autonomously self-healing defects until all verification gates pass.
1. Unified Architecture & Enterprise Positioning
SweetNight AIX platform employs a modular, decoupled enterprise agent architecture:
┌─────────────────────────────────────────┐
│ AIX Core Agent Engine │
│ (Action Traces / Verification Gates) │
└────────────────────┬────────────────────┘
│
┌────────────────────┴────────────────────┐
│ AIX Vibe Multi-Agent Teams Engine │
│ (Architecture / Dev / Data / QA / Ops) │
└────────────────────┬────────────────────┘
│
┌────────────────────┴────────────────────┐
│ aix (AIX Enterprise Terminal) │
│ • Default Target: sn (Internal Network) │
│ • Enterprise Gateway: aix.snnc.cc │
│ • PAM Leases, AEP Gateways & Provenance │
└─────────────────────────────────────────┘Enterprise Core Capabilities Reference
| Dimension | AIX CLI Enterprise Specification | Description |
|---|---|---|
| Primary Command | aix | Unified binary command line tool |
| Default Target | sn (SweetNight Hub) | Pre-configured corporate environment & credentials |
| Gateway Endpoint | https://aix.snnc.cc | Model gateway, PAM privilege management & SLSA provenance |
| Model Routing | sn-enterprise, claude-api, codex-api | Corporate compute pools & load balanced models |
| SWE Capabilities | SOTA Autonomous SWE Loop | Self-healing, 4-Split TUI, 7-Suite benchmark, CircuitBreaker |
2. Installation, Configuration & Doctor Diagnostics
2.1 Installation
# Option 1: macOS / Linux one-click enterprise installation & bootstrap (Recommended)
curl -fsSL 'https://aix.snnc.cc/console/api/cli-bootstrap/install.sh?target=sn' | sh
# Option 2: Windows PowerShell native one-click installation
& ([scriptblock]::Create((irm 'https://aix.snnc.cc/console/api/cli-bootstrap/install.ps1?target=sn')))
# Option 3: Internal repository workspace registration (Platform contributors)
uv tool install --force .2.2 Environment Health Diagnostics (doctor)
Run the comprehensive health probe to inspect Python runtime, credentials, gateway connectivity, and sandbox health:
$ aix doctorDiagnostic Output Sample:
╭── 🩺 AIX CLI Diagnostic Report (Profile: sn) ─────────────────────╮
│ • CLI Version : aix-cli 1.0.0 (Python 3.12.3) │
│ • Auth Status : Valid (User: xenodennis · Target: sn) │
│ • Gateway Link : Healthy (https://aix.snnc.cc · Latency: 42ms) │
│ • Coding Pool : agy-gcp (Active Tier: Cherub · gpt-4o) │
│ • Zero-Trust : Governed Sandbox Active (LocalPermissionManager) │
│ • CircuitBreaker: Armed (Threshold: 3 failures / 2 identical calls)│
│ • Git Worktree : Clean (sn_operation_tower · Branch: main) │
╰────────────────────────────────────────────────────────────────────╯2.3 Profile & Config Management (profile / config)
# List all configured profiles
aix profile list
# Switch to the global GCP profile
aix profile use gcp
# Read or modify CLI configurations
aix config get base_url
aix config set auto_approve true3. Four Core Autonomy Modes
| Mode | Badge | Human Oversight | Best Used For |
|---|---|---|---|
control (Default) | 🛡️ Governed | High (Interactive approval prompt before file or shell changes) | Production debugging, core library refactorings, pair programming |
auto | ⚡ Autonomous | Zero (Auto-approves bounded sandbox modifications) | 0-to-1 scaffolding, major refactorings, autonomous SWE loops |
fast | 🚀 Expedited | Zero (Single agent execution without tournament overhead) | Quick scripts, lightweight queries, fast code explanations |
plan | 📋 Simulation | Read-only (Generates dry-run unified diffs without modifying files) | Architecture proposals, security reviews, impact assessment |
Syntax Examples:
# Enable autonomous mode via one-shot flag
aix -y "Add an LRU cache module and verify with unit tests"
aix --mode auto "Refactor order status state machine"
# Run a risk-free dry-run simulation
aix --plan "Refactor the settlement pipeline"4. Autonomous Long-Running Loops (SWE Loops)
4.1 Architecture & Flow
Traditional CLIs execute one-shot answers or blindly fire scripts; AIX runs true feedback-driven loops:
4.2 Real Scenario 1: 0-to-1 Module Scaffold & TDD Verification
Prompt:
aix -y "In the current workspace data_platform directory, implement a pipeline health check module data_platform/pipeline_health.py and unit tests data_platform/test_pipeline_health.py, then run pytest to verify all tests pass. If any tests fail, autonomously self-heal until 100% green."Live Execution Trace:
🔧 [CLI Agent Tool: write_workspace_file] data_platform/pipeline_health.py (20 lines)
🔧 [CLI Agent Tool: write_workspace_file] data_platform/test_pipeline_health.py (28 lines)
🔧 [CLI Agent Tool: run_governed_shell] !pytest data_platform/test_pipeline_health.py
============================== 3 passed in 0.01s ===============================
Data platform pipeline health checker and unit tests successfully delivered:
| Deliverable | Status |
| :--- | :--- |
| Health Checker (pipeline_health.py) | Completed (Source/Transform/Destination probes) |
| Unit Tests (test_pipeline_health.py)| Completed (Active, inactive, and exception handling) |
| Final Verification Gate | 3 passed in 0.01s (100% Green) |4.3 Real Scenario 2: Defect Injection, Circuit Breaker Pivot & Self-Healing
When subtle bugs or invalid diff hunks occur, the built-in Circuit Breaker steps in:
Prompt:
aix -y "Run pytest data_platform/test_pipeline_health.py. If any tests fail, inspect the source and test code, analyze the root cause, autonomously edit the implementation, and re-run pytest until all tests pass."Multi-Turn Agent Trace:
# Step 1: Probe status
🔧 [CLI Agent Tool: run_governed_shell] !pytest data_platform/test_pipeline_health.py
│ FAILED: test_pipeline_is_healthy - AssertionError: False is not true
# Step 2: Inspect code and tests
🔧 [CLI Agent Tool: read_workspace_file] data_platform/pipeline_health.py (L1-L10)
🔧 [CLI Agent Tool: read_workspace_file] data_platform/test_pipeline_health.py (L1-L28)
# Step 3: Local edit encounters hunk mismatch; Circuit Breaker radar trips immediately
╭── 🚨 [Circuit Breaker Alert] Infinite Failure Loop Intercepted ───╮
│ Status : Tripped at Step 3 to prevent token exhaustion │
│ Pattern : Repetitive identical tool invocation failures │
│ Strategy : PIVOT (Force architectural rewrite / avoid bad retries)│
╰───────────────────────────────────────────────────────────────────╯
# Step 4: Agent pivots to a clean full rewrite based on PIVOT directive
Agent Reasoning: "Detected editing misalignment. Pivoting to clean rewrite via write_workspace_file."
🔧 [CLI Agent Tool: write_workspace_file] data_platform/pipeline_health.py (10 lines)
🔧 [CLI Agent Tool: run_governed_shell] !pytest data_platform/test_pipeline_health.py
# Step 5: Uncaught exception discovered; agent analyzes and adds try/except robustness
Agent Reflection: "Test failed because mock source threw an unhandled exception. Wrapping checks in try/except."
🔧 [CLI Agent Tool: write_workspace_file] data_platform/pipeline_health.py (13 lines)
🔧 [CLI Agent Tool: run_governed_shell] !pytest data_platform/test_pipeline_health.py
============================== 3 passed in 0.01s ===============================
Agent Summary: "All unit tests have passed! The health checker now handles exceptions robustly."5. Interactive REPL & Four-Split TUI
Run aix without arguments to launch the interactive REPL:
$ aix5.1 4-Split TUI Workspace Dashboard (/tui)
Type /tui in REPL or run aix tui to open the live split-screen terminal console:
┌──────────────────────────────┬──────────────────────────────┐
│ 1. Architecture & AST Index │ 2. Self-Healing & QA Gate │
│ • AST Nodes: 3,420 mapped │ • Pytest: 373 Passed (100%) │
│ • Inbound Callers: 14 refs │ • CDD Verification: ACTIVE │
├──────────────────────────────┼──────────────────────────────┤
│ 3. Zero-Trust Audit & PAM │ 4. Vibe Multi-Agent Squads │
│ • Sandbox: Governed L2 │ • Architecture Team (Seraph)│
│ • PAM Lease: 24 min left │ • Dev / QA Team (Cherub) │
└──────────────────────────────┴──────────────────────────────┘5.2 Slash Commands & In-Line Code References
| Syntax | Description | Example Usage |
|---|---|---|
@file:L1-L20 | Injects exact line ranges into agent prompt | aix "Based on @src/service.py:10-45 write unit tests for this function" |
!<command> | Execute shell commands in governed sandbox | !git status, !npm test |
/mode | Switch execution autonomy mode | /mode auto, /mode control, /mode plan |
/model | Switch coding pool and model tiers | /model pool agy-gcp, /model tier seraph |
/skills | Inspect and invoke domain skills | /skills list, /skills run dp-starrocks-query |
/session | Save and resume multi-turn conversations | /session save auth-refactor, /session resume <id> |
/perm | Inspect permissions or request PAM lease | /perm status, /perm pam request |
/clear | Clear screen while preserving agent memories | /clear |
6. Multi-Agent Vibe Teams & 7-Suite SOTA Benchmark
6.1 Dispatching Specialized Engineering Squads
AIX CLI orchestrates multi-agent teams using simple natural language:
aix vibe "Design a CDD contract for container in-transit tracking and implement the ingestion pipeline"architecture-team(Seraph · 3.0x credit weight): High-level system design, CDD contract review, tournament arbitration;dev-team(Cherub · 1.0x credit weight): Full-stack implementation and core business logic;data-team(Cherub · 1.0x credit weight): Data fabric pipelines, StarRocks/Iceberg schemas, SQL DDL optimization;qa-team(Cherub · 1.0x credit weight): Edge-case test generation and coverage gate enforcement;ops-team(Angel · 0.2x credit weight): Worktree management, zero-trust enforcement, and deployment.
6.2 7-Suite Automated Benchmark
$ aix vibe benchmarkLive Result (100% Green across all suites):
✔ Suite 1: codebase_intelligence (AST index, python, tsx, sql, callers, glob, grep)
✔ Suite 2: atomic_multi_edit (multi-hunk atomic, AST check, diff snapshots)
✔ Suite 3: self_healing_verification_gate (AST + CDD + R1-R6 rules, 100% self-heal)
✔ Suite 4: three_layer_skills_and_zero_trust (SDLC + dp-* + sn-*, L3 zero-trust intercept)
✔ Suite 5: best_of_n_tournament (3-agent tournament, consensus judge, telemetry self-heal)
✔ Suite 6: skill_distillation_and_memory (session-to-skill, project memory persistence)
✔ Suite 7: polyglot_0_to_1_blueprint_and_smoke (py+go+java+tsx+sql, live HTTP smoke)
--------------------------------------------------------------------------------
Benchmark Summary: 7/7 suites passed (100.0%) in 146ms7. AEP Governed Applications & Deployment (aep, deploy)
Manage enterprise governed applications directly from the CLI:
# 1. List available application pack blueprints
aix aep packs
# 2. Initialize project from approved template pack
aix aep init my-inventory-checker --pack aix-governed-admin-pack
# 3. Run local contract and security verification
aix aep precheck --local
# 4. Deploy workload to enterprise Kubernetes cluster
aix deploy apply --env staging --manifest aep-app.yaml
# 5. Monitor status and rollback
aix deploy status
aix deploy rollback --revision 28. MCP Tools & Skill Management (mcp, skill)
# List all local and hub-connected MCP servers
aix mcp list
# Test connectivity to enterprise Feishu MCP server
aix mcp test sn-feishu-mcp --ping
# List active skills (SDLC, Data Platform, Business Skills)
aix skills list
# Run domain skill directly
aix skills run sn-order-reconcile --date 2026-10-219. Zero-Trust Security & PAM Privileged Leases (permission, audit)
9.1 Sandboxed Protection
- Workspace Boundary Enforcement: Prevents unauthorized access outside project root;
- Automatic Secret Redaction: Sanitizes JWT tokens, API keys, and database passwords from stdout/stderr;
- Destructive Command Interception: Blocks unsafe shell execution (e.g.
rm -rf /).
9.2 Dynamic PAM Leases
When troubleshooting live production issues requiring elevated privileges:
# Request a temporary PAM lease
aix permission pam request --scope prod-db --reason "Investigating stuck OMS queue" --duration 30m
# Inspect active lease
aix permission pam status
# Release lease immediately upon completion
aix permission pam revokeAll actions are logged to .aix/audit.log and verifiable with aix audit list.
10. Coding Pools & Metering (model, billing)
# List available enterprise coding pools
aix model list
# Switch to Gemini Enterprise coding pool
aix model pool agy-gcp
# Inspect monthly seat quota and credit balance
aix billing balance
aix billing history11. End-to-End Business Scenarios
Scenario 1: Cross-Border Logistics In-Transit Inventory Reconciliation
cd ~/Documents/Fun/SN/sn_commercial_tower
aix -y "Write an in-transit inventory reconciliation script check_in_transit.py matching ERP shipments with overseas warehouse receipts, and build accompanying tests test_check_in_transit.py. Run pytest and autonomously fix any mismatches until 100% green."Scenario 2: Emergency Incident Response with PAM Lease
# 1. Request temporary 15-minute PAM lease
aix permission pam request --scope oms-sync --reason "Investigating deadlocked consumer" --duration 15m
# 2. Run autonomous investigation
aix --mode auto "Inspect OMS consumer logs, diagnose the deadlock cause, and implement recovery patch"
# 3. Revoke lease after verification
aix permission pam revoke12. Complete Command Reference Cheat Sheet
| Category | Recommended Command | Description |
|---|---|---|
| Interactive REPL | aix | Launch single-agent conversational terminal |
| Autonomous SWE Loop | aix -y "<prompt>" | Run fully autonomous self-healing coding loop |
| 4-Split TUI Console | aix tui or /tui in REPL | Open multi-panel visual terminal dashboard |
| Health Diagnostics | aix doctor | Validate Python runtime, credentials, gateway connectivity |
| 7-Suite Benchmark | aix vibe benchmark | Run rigorous multi-agent engineering evaluation |
| Multi-Agent Teams | aix vibe "<task>" | Dispatch architecture, dev, QA, ops multi-agent team |
| AEP Scaffolding | aix aep init <app> | Bootstrap governed enterprise microservice |
| Deployment | aix deploy apply | Deploy workload to cloud infrastructure |
| MCP Management | aix mcp list | Inspect and discover governed MCP tools |
| Domain Skills | aix skills run <name> | Execute registered enterprise domain skills |
| PAM Lease Request | aix permission pam request | Request temporary elevated privilege token |
| Billing & Credits | aix billing balance | Query tenant quota and compute token usage |
| Session Resume | aix session resume <id> | Resume previous investigation or debugging session |
| Full Help | aix --help | View complete CLI documentation and flags |
13. Enterprise Engineering Capabilities
As the premier enterprise autonomous terminal agent, AIX CLI introduces four proprietary breakthroughs built for complex enterprise engineering:
13.1 Semantic Codebase Topology & Repo Map (aix map / /map)
Avoid token window exhaustion caused by blind full-file reading. AIX uses an integrated multi-language AST parser to extract symbols, classes, functions, and cross-file imports budgeted to a strict token ceiling (default 2,500 tokens):
# Generate global semantic repo map for current workspace
aix map
# Target a specific subsystem with custom token budget
aix map src/core --tokens 1500
# Open interactively in REPL
aix > /map13.2 Asynchronous Background Task Orchestration (aix task / /bg / /tasks)
For long-running integration tests, Docker container builds, or ETL sync jobs, AIX provides native OS-level background daemon task management with real log streaming:
# 1. Run command in background
aix task run "pytest tests/integration/ -v"
# Or inside interactive REPL:
aix > /bg pytest -v
# 2. Inspect active and historical tasks
aix task list
# Or inside REPL:
aix > /tasks
# 3. Stream real logs or terminate runaway tasks
aix task logs task-1792656712-672e --tail 50
aix task kill task-1792656712-672e
aix task clean13.3 Project Memory Bank & Closed-Loop Skill Distillation (aix memory / /memory / /learn)
Give the agent cumulative project memory that grows smarter over time. Architectural decisions and conventions are safely persisted in .agent/MEMORY.md:
# 1. Record engineering convention or constraint
aix memory add "All public API routes must define Pydantic input schemas" --category architecture
aix memory add "Database migrations must maintain backward compatibility" --category convention
# 2. Query knowledge graph
aix memory search "Pydantic"
aix memory show
# 3. Session-to-Skill Distillation Flywheel
# Once the agent solves a difficult bug, crystallize its playbook into a reusable 3-Layer SKILL.md
aix skill distill fix-redis-deadlock --description "Investigate and resolve Redis distributed lock deadlocks"
# Or in REPL:
aix > /learn13.4 Fine-Grained Token Economics & Telemetry Dashboard (aix cost / /cost)
Terminal-native token transparency dashboard calculating prompt, completion, and cache-hit ratios with real-time peer model cost comparison:
# 1. Inspect cumulative session and project cost
aix cost
# Or inside REPL:
aix > /cost
# 2. View model pricing matrix
aix cost models
# 3. Reset telemetry data
aix cost reset13.5 Cognitive Dynamic Model Cascade Auto-Router (aix model route / /route)
Pareto-optimal cognitive model cascade router evaluating prompt complexity (L1-Fast / L2-Standard / L3-Reasoning) with automatic tier escalation upon circuit breaker triggers:
# 1. Inspect active routing policy (auto / cost / balanced / frontier)
aix model route show
# Or inside REPL:
aix > /route
# 2. Simulate prompt evaluation and estimated cost
aix model route eval "refactor core event loop to eliminate concurrency deadlock"
# 3. Dynamically set policy
aix model route set cost
aix model route set frontier13.6 Pre-Flight AST Architecture Conflict Radar (aix preflight / /preflight)
Millisecond AST scanner detecting circular import cycles, broken call-site signatures, and syntax errors before launching slow test suites:
# 1. Scan entire workspace AST dependency graph
aix preflight
# Or inside REPL:
aix > /preflight
# 2. Scan specific subpackages
aix preflight src/services/order/
# 3. Machine-readable JSON output for CI quality gates
aix preflight --json14. Environment Variables & Configuration Precedence
AIX CLI resolves its runtime configuration via the following precedence order:
CLI Flags > Environment Variables > Local Project Config (.aix/config.json) > Global Profile (~/.aix/profiles.json)| Variable | Default Value | Description |
|---|---|---|
AIX_TARGET | sn | Target hub profile (sn for corporate network, gcp for cloud, local for dev). |
AIX_BASE_URL | https://aix.snnc.cc | Model Gateway and AEP governance API endpoint. |
AIX_API_KEY | (None) | Bearer token for headless CI/CD execution (aix_live_...). |
AIX_AUTONOMY_MODE | control | Default autonomy mode (control, auto, fast, plan). |
AIX_TIMEOUT | 120 | Per-step execution timeout in seconds. |
AIX_CIRCUIT_BREAKER_MAX_ERRORS | 3 | Number of consecutive identical errors before tripping circuit breaker pivot. |
AIX_SANDBOX_STRICT | true | Restricts shell and file mutations strictly to the current workspace root. |
15. Standard Exit Codes & CI/CD Pipeline Automation
For programmatic scripts, GitHub Actions, and Jenkins pipelines, AIX CLI emits deterministic POSIX exit codes:
| Exit Code | Symbol | Meaning | Action in CI Pipeline |
|---|---|---|---|
0 | EXIT_SUCCESS | All requested tasks and verification gates completed 100% green. | Continue to deploy / merge. |
1 | EXIT_GENERAL_ERROR | Unhandled CLI internal exception or invalid user arguments. | Review CLI logs in CI. |
2 | EXIT_SYNTAX_ERROR | Generated code has fatal AST syntax errors that failed parsing. | Re-run with --mode auto. |
3 | EXIT_AUTH_FAILURE | Missing, invalid, or expired API token / SSO credential. | Refresh token via aix auth login. |
4 | EXIT_GATE_FAILURE | Verification tests (e.g. pytest) failed after retries were exhausted. | Block PR merge; inspect failure report. |
5 | EXIT_CIRCUIT_BREAKER | Infinite loop or repeated tool rejection intercepted by circuit breaker. | Inspect PIVOT directive recommendations. |
6 | EXIT_POLICY_VIOLATION | Attempted mutation blocked by AEP Cedar zero-trust boundary. | Request PAM elevation or modify contract. |
16. 4-Split TUI Navigation & Keybindings Reference
When running /tui or aix tui, navigate the split dashboard using standard terminal shortcuts:
| Keybinding | Action |
|---|---|
Tab / Shift+Tab | Cycle focus between the 4 dashboard panels (AST / QA / Audit / Swarm). |
↑ / ↓ or j / k | Scroll through active execution trace, logs, or symbol trees. |
Enter / Space | Expand or collapse AST symbol details or test failure stack traces. |
Ctrl + C | Cancel current sub-agent reasoning without exiting the TUI dashboard. |
Ctrl + D or q | Exit TUI and return to standard terminal prompt. |
/ | Focus search drawer to filter active symbols or test cases. |
17. Troubleshooting & Error Taxonomy Matrix
| Error Signature | Underlying Root Cause | Actionable Remediation Step |
|---|---|---|
AuthExpiredError: token signature expired | Local Authentik SSO session or bootstrap code has exceeded TTL. | Run aix auth login --target sn --browser to refresh credentials. |
CircuitBreakerTripped: 3 identical edit hunks rejected | Target file has evolved and patch offsets no longer match original lines. | The CLI will automatically trigger a clean full-file rewrite. If persistent, run aix -y --mode auto "clean rewrite <file>". |
SandboxViolation: path '/etc/hosts' is outside root | Agent attempted to read or mutate system files outside the Git repository. | Security boundary working as intended. Bound task to workspace directories. |
GatewayTimeout: 504 Gateway Time-out | High cluster GPU queue contention or network egress hiccup. | Re-run with --tier fast or switch coding pool via aix model pool agy-gcp. |
PAMLeaseExpired: session timed out | JIT PAM elevation window (15m - 60m) expired during long debugging session. | Request a new lease via aix permission pam request --scope <scope>. |