Execute Anything. Pure Rust. BYOK. Zero bloat.
xa is a lightning-fast, pure-Rust coding agent CLI. It combines LLM-driven automation with the raw performance of Rust — delivering sub-5ms startup, minimal token consumption via intelligent compression, and complete flexibility in provider selection.
- ~5ms launch time — orders of magnitude faster than Python/Node alternatives
- ~10MB memory footprint — lightweight enough to leave running all day
- Pure Rust — zero Python, zero Node.js, zero dependency overhead
- No vendor lock-in, no forced accounts
- Works with any OpenAI-compatible API: OpenAI, OpenRouter, vLLM, llama.cpp, Ollama, or any self-hosted endpoint
- Multi-provider management — switch between providers seamlessly
- RTK (Real-Time Knowledge) post-processing strips unnecessary tokens from responses, significantly reducing API costs
- Per-tool output filters —
bash,git diff,python,cargo,systemcommands each get smart, loss-aware processing that retains errors, summaries, and structural metadata while dropping noise - Context cap — long outputs are intelligently truncated before entering the model context
- Codex-style terminal interface with streaming markdown rendering
- Shimmer animation over active streaming regions for visual clarity
- Thinking indicators —
</think>/<think>blocks are automatically filtered from the transcript; activity strip shows Waiting → Thinking → Responding → Running tools phases - Virtual scrolling, fuzzy input, and slash-command overlays
- Auto-detecting dark/light theme (supports OSC 11 background query)
xa resume— pick or directly load a saved conversation sessionxa gain— review token usage and tool-output statistics across sessions (daily / weekly / monthly breakdowns)- Sessions stored as individual JSON files for instant listing
- Bash — run shell commands with capped streaming output
- File read/write — safely read and modify files
- Git operations — diff, status, log, commit, and more
- Results are automatically fed back into the conversation context
Process text from the command line without entering the TUI:
# Translate, polish, summarize, rewrite — all as one-liners
echo "hello world" | xa translate en
echo "my code" | xa polish
cat main.rs | xa summarize- Fuzzy command matching — type partial names and let
xafigure out your intent - Clipboard integration — results are automatically copied to your system clipboard
- Secret management — store and search secrets with natural language queries (
xa add-secret,xa search) - Custom prompt templates — define and manage your own prompt configs
Prebuilt native binaries are published to PyPI for Linux (x86_64, ARM64), macOS (Intel, Apple Silicon), and Windows (x86_64, ARM64). The package contains the Rust executable itself; it does not install a Python runtime wrapper.
# Recommended for a globally available CLI without modifying system Python
pipx install xacli
# Or install into the current Python environment / virtual environment
python -m pip install xacliAfter installation, run:
xa --helppip installs the executable into that Python environment's scripts directory:
typically <venv>/bin, ~/.local/bin, or Scripts\\ on Windows. Ensure that
directory is on PATH. A hard-coded /usr/local/xa install location is not
used so that virtual environments, permissions, and pip uninstall xacli all
work correctly.
Pushing a v* tag starts the multi-platform wheel build in GitHub Actions.
After it succeeds, publish all its artifacts from a machine that has your PyPI
credentials configured for Twine:
scripts/publish-pypi-wheels.sh
# Or publish one specific Actions run:
scripts/publish-pypi-wheels.sh <run-id>The script uses gh to download the six wheel-* artifacts and uses Twine's
normal local authentication (~/.pypirc or keyring); it never reads or prints
the token itself. Set TWINE_REPOSITORY=testpypi to target TestPyPI.
# Clone the repository
git clone https://github.com/jinfagang/xa.git
cd xa
# Build (requires Rust toolchain)
cargo build --release
# Install globally (optional)
cargo install --path .
# Binary available at target/release/xa# Interactive login wizard (supports any OpenAI-compatible endpoint)
xa login
# or
xa set openaiYou'll be prompted for:
- Endpoint URL — e.g.
https://api.openai.com/v1,https://openrouter.ai/api/v1, orhttp://localhost:11434/v1 - API Key — your own key (BYOK)
- Model — choose from available models or specify a custom one
# Launch the coding agent (default command — just type `xa`)
xa
# Or explicitly
xa chat
# Force light or dark palette
xa --theme light
xa --theme darkInside the TUI, use slash commands:
| Command | Action |
|---|---|
/login [name] |
Add or update a provider |
/models [name] |
Switch provider or set model |
/clear |
Clear conversation |
/save [title] |
Save current session |
/sessions |
List saved sessions |
/tools |
List available tools |
/new |
Start a new session |
/help |
Show help |
/exit |
Quit |
# Open the interactive session picker
xa resume
# Jump directly to a session by ID
xa resume <session-id># All-time totals
xa gain
# Breakdown by day / week / month
xa gain --daily
xa gain --weekly
xa gain --monthly
xa gain --all# Direct text processing without TUI
echo "fix this bug" | xa polish
cat error.log | xa summarize
echo "translate to Japanese" | xa translate ja| File | Purpose |
|---|---|
~/.config/xa/config.toml |
Default API settings (endpoint, key, model, theme) |
~/.config/xa/providers.toml |
Multi-provider management |
~/.config/xa/prompts.toml |
Custom prompt templates |
~/.config/xa/sessions/ |
Saved conversation sessions |
┌──────────────────────────────────────────────┐
│ xa CLI │
│ │
│ ┌──────────┐ ┌──────────┐ ┌────────────┐ │
│ │ TUI │→ │ LLM │→ │ Token │ │
│ │(ratatui) │ │(stream) │ │(RTK filter)│ │
│ └──────────┘ └──────────┘ └────────────┘ │
│ ↓ ↓ ↓ │
│ HistoryCells Any Provider Minimal Tokens│
└──────────────────────────────────────────────┘
- TUI Layer — Built on
ratatui+crosstermwith virtual scrolling, markdown rendering, shimmer animations, and thinking-phase tracking - Agent Layer — Tool execution (bash, file, git) with streaming output capture and per-tool filtering
- LLM Layer — Abstraction over any OpenAI-compatible chat completions API. Streaming and non-streaming modes
- Token Module — RTK token minimization with per-tool filters (git, python, cargo, bash, system) and universal context capping
xa works with any OpenAI-compatible endpoint:
| Provider | Endpoint |
|---|---|
| OpenAI | https://api.openai.com/v1 |
| OpenRouter | https://openrouter.ai/api/v1 |
| Ollama | http://localhost:11434/v1 |
| vLLM | custom deployment |
| llama.cpp | server mode |
| Any custom endpoint | just configure it |
No hardcoded providers. No restrictions. Your model, your rules.
| Metric | xa | Alternatives |
|---|---|---|
| Startup time | ~5ms | ~200ms+ |
| Memory footprint | ~10MB | ~100MB+ |
| Language | Pure Rust | Python/Node |
| Dependencies | Minimal | Heavy |
MIT

