Skip to main content
The AXON CLI provides a complete toolchain for developing, compiling, and executing AXON programs. All commands follow a consistent pattern and support both interactive and programmatic workflows.

Installation

# From PyPI
pip install axon-lang

# With real tool backends (WebSearch, etc.)
pip install axon-lang[tools]

# Verify installation
axon version

Command Structure

All AXON CLI commands follow this format:
axon <command> [arguments] [options]

Available Commands

check

Validate syntax and semantics without execution

compile

Compile source code to AXON IR JSON

run

Execute AXON programs end-to-end

trace

Visualize execution traces and debug flows

Quick Start

# 1. Validate your program
axon check program.axon

# 2. Compile to IR (optional)
axon compile program.axon --backend anthropic

# 3. Execute with tracing
axon run program.axon --trace --backend openai

# 4. Analyze the trace
axon trace program.trace.json

Global Options

Version Information

axon --version
axon -V
Displays the installed axon-lang version.

Help

axon --help
axon <command> --help
Shows usage information for the CLI or specific commands.

Exit Codes

All AXON CLI commands use consistent exit codes:
CodeMeaning
0Success — operation completed without errors
1Compilation or execution error
2I/O error (file not found, invalid JSON, etc.)

Pipeline Architecture

The AXON compiler follows a multi-stage pipeline: Each CLI command accesses different stages:
  • check: Runs through Type Checker
  • compile: Runs through IR Generator
  • run: Full pipeline including Executor

Environment Variables

The CLI respects standard environment variables for configuration. See API Keys for authentication setup.

Output Formats

Colored Terminal Output

By default, the CLI uses ANSI color codes for enhanced readability:
  • ✓ Green for success
  • ✗ Red for errors
  • Yellow for warnings
  • Cyan for informational output
Disable colors with --no-color (supported by check and trace commands).

JSON Output

For programmatic access, use --stdout with the compile command to output machine-readable JSON.

Examples

Development Workflow

# Iterative development
axon check contract_analyzer.axon
# ... fix errors ...
axon check contract_analyzer.axon
axon run contract_analyzer.axon --trace

CI/CD Integration

# Non-interactive validation
axon check src/**/*.axon --no-color || exit 1
axon compile src/main.axon --stdout > dist/main.ir.json

Production Execution

# Run with production backend and real tools
export ANTHROPIC_API_KEY="sk-ant-..."
export SERPER_API_KEY="..."
axon run main.axon --backend anthropic --tool-mode real

Next Steps

Command Reference

Explore detailed documentation for each command

Configuration

Set up API keys and tool backends

Build docs developers (and LLMs) love