Skip to Content

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

DimensionAIX CLI Enterprise SpecificationDescription
Primary CommandaixUnified binary command line tool
Default Targetsn (SweetNight Hub)Pre-configured corporate environment & credentials
Gateway Endpointhttps://aix.snnc.ccModel gateway, PAM privilege management & SLSA provenance
Model Routingsn-enterprise, claude-api, codex-apiCorporate compute pools & load balanced models
SWE CapabilitiesSOTA Autonomous SWE LoopSelf-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 doctor

Diagnostic 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 true

3. Four Core Autonomy Modes

ModeBadgeHuman OversightBest Used For
control (Default)🛡️ GovernedHigh (Interactive approval prompt before file or shell changes)Production debugging, core library refactorings, pair programming
auto⚡ AutonomousZero (Auto-approves bounded sandbox modifications)0-to-1 scaffolding, major refactorings, autonomous SWE loops
fast🚀 ExpeditedZero (Single agent execution without tournament overhead)Quick scripts, lightweight queries, fast code explanations
plan📋 SimulationRead-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:

$ aix

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

SyntaxDescriptionExample Usage
@file:L1-L20Injects exact line ranges into agent promptaix "Based on @src/service.py:10-45 write unit tests for this function"
!<command>Execute shell commands in governed sandbox!git status, !npm test
/modeSwitch execution autonomy mode/mode auto, /mode control, /mode plan
/modelSwitch coding pool and model tiers/model pool agy-gcp, /model tier seraph
/skillsInspect and invoke domain skills/skills list, /skills run dp-starrocks-query
/sessionSave and resume multi-turn conversations/session save auth-refactor, /session resume <id>
/permInspect permissions or request PAM lease/perm status, /perm pam request
/clearClear 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 benchmark

Live 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 146ms

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

8. 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-21

9. 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 revoke

All 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 history

11. 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 revoke

12. Complete Command Reference Cheat Sheet

CategoryRecommended CommandDescription
Interactive REPLaixLaunch single-agent conversational terminal
Autonomous SWE Loopaix -y "<prompt>"Run fully autonomous self-healing coding loop
4-Split TUI Consoleaix tui or /tui in REPLOpen multi-panel visual terminal dashboard
Health Diagnosticsaix doctorValidate Python runtime, credentials, gateway connectivity
7-Suite Benchmarkaix vibe benchmarkRun rigorous multi-agent engineering evaluation
Multi-Agent Teamsaix vibe "<task>"Dispatch architecture, dev, QA, ops multi-agent team
AEP Scaffoldingaix aep init <app>Bootstrap governed enterprise microservice
Deploymentaix deploy applyDeploy workload to cloud infrastructure
MCP Managementaix mcp listInspect and discover governed MCP tools
Domain Skillsaix skills run <name>Execute registered enterprise domain skills
PAM Lease Requestaix permission pam requestRequest temporary elevated privilege token
Billing & Creditsaix billing balanceQuery tenant quota and compute token usage
Session Resumeaix session resume <id>Resume previous investigation or debugging session
Full Helpaix --helpView 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 > /map

13.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 clean

13.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 > /learn

13.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 reset

13.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 frontier

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

14. 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)
VariableDefault ValueDescription
AIX_TARGETsnTarget hub profile (sn for corporate network, gcp for cloud, local for dev).
AIX_BASE_URLhttps://aix.snnc.ccModel Gateway and AEP governance API endpoint.
AIX_API_KEY(None)Bearer token for headless CI/CD execution (aix_live_...).
AIX_AUTONOMY_MODEcontrolDefault autonomy mode (control, auto, fast, plan).
AIX_TIMEOUT120Per-step execution timeout in seconds.
AIX_CIRCUIT_BREAKER_MAX_ERRORS3Number of consecutive identical errors before tripping circuit breaker pivot.
AIX_SANDBOX_STRICTtrueRestricts 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 CodeSymbolMeaningAction in CI Pipeline
0EXIT_SUCCESSAll requested tasks and verification gates completed 100% green.Continue to deploy / merge.
1EXIT_GENERAL_ERRORUnhandled CLI internal exception or invalid user arguments.Review CLI logs in CI.
2EXIT_SYNTAX_ERRORGenerated code has fatal AST syntax errors that failed parsing.Re-run with --mode auto.
3EXIT_AUTH_FAILUREMissing, invalid, or expired API token / SSO credential.Refresh token via aix auth login.
4EXIT_GATE_FAILUREVerification tests (e.g. pytest) failed after retries were exhausted.Block PR merge; inspect failure report.
5EXIT_CIRCUIT_BREAKERInfinite loop or repeated tool rejection intercepted by circuit breaker.Inspect PIVOT directive recommendations.
6EXIT_POLICY_VIOLATIONAttempted 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:

KeybindingAction
Tab / Shift+TabCycle focus between the 4 dashboard panels (AST / QA / Audit / Swarm).
↑ / ↓ or j / kScroll through active execution trace, logs, or symbol trees.
Enter / SpaceExpand or collapse AST symbol details or test failure stack traces.
Ctrl + CCancel current sub-agent reasoning without exiting the TUI dashboard.
Ctrl + D or qExit TUI and return to standard terminal prompt.
/Focus search drawer to filter active symbols or test cases.

17. Troubleshooting & Error Taxonomy Matrix

Error SignatureUnderlying Root CauseActionable Remediation Step
AuthExpiredError: token signature expiredLocal Authentik SSO session or bootstrap code has exceeded TTL.Run aix auth login --target sn --browser to refresh credentials.
CircuitBreakerTripped: 3 identical edit hunks rejectedTarget 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 rootAgent 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-outHigh 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 outJIT PAM elevation window (15m - 60m) expired during long debugging session.Request a new lease via aix permission pam request --scope <scope>.