AX CLI - Enterprise-Class Vibe Coding

April 3, 2026 · View on GitHub

Project Status: ax-cli is no longer being updated as of April 2, 2026. Please use ax-code for all new installs and ongoing updates.

downloads Tests macOS Windows Ubuntu Node.js License: MIT

English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Deutsch | Español | Português | Français | Tiếng Việt | ไทย

Table of Contents


Quick Start

ax-cli has been superseded by ax-code. This repository remains available for existing users, but it will not receive further updates after April 2, 2026.

Get started in under a minute:

npm install -g @defai.digital/ax-grok
ax-grok setup
ax-grok

Best for: Live web search, vision, extended reasoning, 2M context window

Run /init inside the CLI to initialize your project context.


GLM Users

Note: The ax-glm cloud package has been deprecated.

For GLM cloud API access, we recommend using OpenCode.

Local GLM models (GLM-4.6, CodeGeeX4) are still fully supported via ax-cli for offline inference through Ollama, LMStudio, or vLLM. See Local/Offline Models below.


Why AX CLI?

FeatureDescription
Provider OptimizedFirst-class support for Grok (xAI) with provider-specific parameters
17 Built-in ToolsFile editing, bash execution, search, todos, and more
Agentic BehaviorsReAct reasoning loops, self-correction on failures, TypeScript verification
AutomatosX Agents20+ specialized AI agents for backend, frontend, security, DevOps, and more
Autonomous Bug FixingScan and auto-fix timer leaks, resource issues, type errors with rollback safety
Intelligent RefactoringDead code removal, type safety fixes, complexity reduction with verification
MCP IntegrationModel Context Protocol with 12+ production-ready templates
Project MemoryIntelligent context caching with 50% token savings
Enterprise SecurityAES-256-GCM encryption, no telemetry, CVSS-rated protections
65% Test Coverage6,210 tests with strict TypeScript

Grok Highlights

  • Grok (ax-grok): Built-in web search, vision, reasoning_effort; Grok 4.1 fast variants ship with 2M context, parallel server tools, x_search, and server-side code execution. See docs/grok-4.1-advanced-features.md for details.

Supported Models

Grok (xAI)

Grok 4.1 advanced: ax-grok now enables Grok 4.1's server-side agent tools (web_search, x_search, code_execution) with parallel function calling and 2M-context fast variants. See the full guide in docs/grok-4.1-advanced-features.md.

ModelContextFeaturesAlias
grok-4.1131KBalanced default with built-in reasoning, vision, searchgrok-latest
grok-4.1-fast-reasoning2MBest for agentic/tool-heavy sessions with reasoninggrok-fast
grok-4.1-fast-non-reasoning2MFastest agentic runs without extended reasoninggrok-fast-nr
grok-4-0709131KOriginal Grok 4 release (compatible)grok-4
grok-2-image-121232KImage generation: text-to-imagegrok-image

Model Aliases: Use convenient aliases like ax-grok -m grok-latest instead of full model names.

Local/Offline Models (ax-cli)

For local inference via Ollama, LMStudio, or vLLM, use ax-cli:

npm install -g @defai.digital/ax-cli
ax-cli setup   # Configure your local server URL

ax-cli works with any model available on your local server. Just specify the model tag when configuring (e.g., qwen3:14b, glm4:9b).

Recommended Model Families:

ModelBest For
QwenBest overall for coding tasks
GLMRefactoring and documentation
DeepSeekFast iterations, good speed/quality
CodestralC/C++/Rust and systems programming
LlamaBest compatibility and fallback

Installation

Requirements

  • Node.js 24.0.0+
  • macOS 14+, Windows 11+, or Ubuntu 24.04+

Install

npm install -g @defai.digital/ax-grok   # Grok (xAI)

Setup

ax-grok setup

The setup wizard will guide you through:

  1. Securely encrypting and storing your API key (using AES-256-GCM encryption).
  2. Configuring your default AI model and other preferences.
  3. Validating your configuration to ensure everything is set up correctly.

Usage

Interactive Mode

ax-grok              # Starts the interactive CLI session
ax-grok --continue   # Resume previous conversation
ax-grok -c           # Short form

Headless Mode

ax-grok -p "analyze this codebase"
ax-grok -p "fix TypeScript errors" -d /path/to/project

Agentic Behavior Flags

# Enable ReAct reasoning mode (Thought → Action → Observation cycles)
ax-grok --react

# Enable TypeScript verification after plan phases
ax-grok --verify

# Disable self-correction on failures
ax-grok --no-correction

By default, self-correction is ON (agent automatically retries on failures with reflection). ReAct and verification are OFF by default but can be enabled for more structured reasoning and quality checks.

Essential Commands

CommandDescription
/initGenerate AX.md project context (see Project Initialization)
/helpShow all commands
/modelSwitch AI model
/langChange display language (11 languages)
/doctorRun diagnostics
/exitExit CLI

Keyboard Shortcuts

ShortcutActionDescription
Ctrl+OToggle verbosityShow or hide detailed logs and internal processes
Ctrl+KQuick actionsOpen the quick actions menu for common commands
Ctrl+BBackground modeRun the current task in the background
Shift+TabAuto-editTrigger AI-powered code suggestions
`Esc$ \times 2\text{Cancel}\text{Clear} \text{current} \text{input} \text{or} \text{cancel} \text{ongoing} \text{operation}

\text{Project} \text{Initialization}

\text{The} $/initcommand generates anAX.md` file at your project root - a comprehensive context file that helps the AI understand your codebase.

Basic Usage

ax-grok
> /init                    # Standard analysis (recommended)
> /init --depth=basic      # Quick scan for small projects
> /init --depth=full       # Deep analysis with architecture mapping
> /init --depth=security   # Include security audit (secrets, dangerous APIs)

Depth Levels

DepthWhat's AnalyzedBest For
basicName, language, tech stack, scriptsQuick setup, small projects
standard+ Code stats, test analysis, documentationMost projects (default)
full+ Architecture, dependencies, hotspots, how-to guidesLarge codebases
security+ Secret scanning, dangerous API detection, auth patternsSecurity-sensitive projects

Adaptive Output

The /init command automatically adjusts output verbosity based on your project's complexity:

Project SizeFilesTypical Output
Small<50 filesConcise, essential info only
Medium50-200 filesStandard documentation
Large200-500 filesDetailed with architecture notes
Enterprise500+ filesComprehensive with all sections

Options

OptionDescription
--depth=<level>Set analysis depth (basic, standard, full, security)
--forceForce complete regeneration (default: auto-refresh if exists)

Note: Running /init when AX.md already exists will automatically refresh it. Use --force for a complete regeneration.

Generated Files

FilePurpose
AX.mdPrimary AI context file (always generated)
.ax/analysis.jsonDeep analysis data (full/security depth only)

How Context Injection Works

When you start a conversation, AX CLI automatically reads your AX.md file and injects it into the AI's context window. This means:

  1. The AI knows your project - Build commands, tech stack, conventions
  2. No repeated explanations - The AI remembers your project structure
  3. Better code suggestions - Follows your existing patterns and rules
You run: ax-grok

System reads: AX.md from project root

AI receives: <project-context source="AX.md">
             # Your Project
             ## Build Commands
             pnpm build
             ...
             </project-context>

AI understands your project before you ask anything!

Priority order (if multiple context files exist):

  1. AX.md (recommended) - New single-file format
  2. ax.summary.json (legacy) - JSON summary
  3. ax.index.json (legacy) - Full JSON index

Migration from Legacy Format

If you have legacy files (.ax-grok/CUSTOM.md, ax.index.json, ax.summary.json), run:

> /init --force

This generates the new single-file AX.md format. Legacy files can then be removed.


Configuration

Config Files

FilePurpose
~/.ax-grok/config.jsonUser settings (encrypted API key)
.ax-grok/settings.jsonProject overrides
AX.mdProject context file (generated by /init)

Environment Variables

# For CI/CD
export XAI_API_KEY=your_key    # Grok

MCP Integration

Extend capabilities with Model Context Protocol (MCP) — an open standard for connecting AI assistants to external tools, APIs, and data sources:

ax-grok mcp add figma --template
ax-grok mcp add github --template
ax-grok mcp list

Available Templates: Figma, GitHub, Vercel, Puppeteer, Storybook, Sentry, Jira, Confluence, Slack, Google Drive, and more.


VSCode Extension

code --install-extension defai-digital.ax-cli-vscode
  • Sidebar chat panel
  • Diff preview for file changes
  • Context-aware commands
  • Checkpoint & rewind system

AutomatosX Integration

AX CLI integrates with AutomatosX - a multi-agent AI system with autonomous bug fixing, intelligent refactoring, and 20+ specialized agents.

In interactive mode (ax-grok), just ask naturally:

> please scan and fix bugs in this codebase

> refactor the authentication module, focus on removing dead code

> use the security agent to audit the API endpoints

> review this PRD and work with the product agent to improve it

> ask the backend and frontend agents to implement user registration together

What you get:

  • Bug fixing: Detects timer leaks, missing cleanup, resource issues - auto-fixes with rollback safety
  • Refactoring: Removes dead code, fixes type safety, reduces complexity - verified by typecheck
  • 20+ agents: Backend, frontend, security, architecture, DevOps, data, and more

See AutomatosX Guide for agent list, advanced options, and configuration


Project Memory

Reduce token costs and improve context recall with intelligent caching that stores and retrieves relevant project information, avoiding redundant processing.

ax-grok memory warmup    # Generate context cache
ax-grok memory status    # View token distribution

Security

  • API Key Encryption: AES-256-GCM with PBKDF2 (600K iterations)
  • No Telemetry: Zero data collection
  • CVSS Protections: Robust safeguards against common vulnerabilities like Command Injection (CVSS 9.8), Path Traversal (CVSS 8.6), and SSRF (CVSS 7.5).

Architecture

AX CLI uses a modular architecture with provider-specific CLIs built on a shared core:

┌─────────────────────────────────────────────────────────────┐
│                      User Installs                          │
├─────────────────────────────────────────────────────────────┤
│                 @defai.digital/ax-grok                      │
│                    (ax-grok CLI)                            │
│                                                             │
│  • Grok 4.1 extended reasoning                              │
│  • xAI API defaults                                         │
│  • Live web search                                          │
│  • ~/.ax-grok/ config                                       │
├─────────────────────────────────────────────────────────────┤
│                   @defai.digital/ax-core                    │
│                                                             │
│  Shared functionality: 17 tools, MCP client, memory,        │
│  checkpoints, React/Ink UI, file operations, git support    │
└─────────────────────────────────────────────────────────────┘

Packages

PackageInstall?Description
@defai.digital/ax-grokYesGrok-optimized CLI with web search, vision, extended thinking
@defai.digital/ax-cliOptionalLocal-first CLI for Ollama/LMStudio/vLLM + DeepSeek Cloud
@defai.digital/ax-coreNoShared core library (auto-installed as dependency)
@defai.digital/ax-schemasNoShared Zod schemas (auto-installed as dependency)

GLM Cloud Users: For GLM cloud API, we recommend OpenCode.


Documentation


Enterprise

For teams requiring advanced capabilities:

  • Compliance reports (SOC2, HIPAA)
  • Advanced audit logging
  • SSO/SAML integration
  • Priority support (24-hour SLA)

Contact: sales@defai.digital


License

MIT License - see LICENSE


Made with ❤️ by DEFAI Digital