This document explains how to install, set up, and use the various commands available in ArchonCLI.
Currently, ArchonCLI is available as a single binary. You can build it from source if you have Go installed:
# Clone the repository
git clone https://github.com/rexreus/archon.git
cd archon
# Build the binary
go build -o archon ./cmd/archon/main.go
# Move to PATH (Optional)
mv archon /usr/local/bin/Before you start asking questions, you need to initialize and authenticate.
Run this command in your project's root directory:
archon initThis will create a .archon.yaml configuration file.
Enter your Google Gemini API Key:
archon auth --key "AIzaSy..."Alternatively, set it via environment variable:
export ARCHON_GEMINI_KEY="AIzaSy..."Note: In this documentation, we use the
archoncommand. If you haven't built the binary yet, usego run cmd/archon/main.goinstead.
Scans the codebase and updates the local vector database.
--force,-f: Force re-indexing of all files.--watch,-w: Monitor file changes in real-time.
Ask a question about your code.
archon ask "Explain how the authentication system works here"Explain a specific file or symbol (function/class).
archon explain ./internal/core/orchestrator.go
archon explain --symbol "LoadConfig"Analyze code and provide improvement suggestions.
# Contoh menggunakan path yang benar sesuai struktur proyek
archon refactor ./internal/adapters/parser/parser.go --goal "improve performance"
archon refactor ./internal/adapters/parser/parser.go --apply # Terapkan perubahan langsungPerform an automated code review on staged changes (git add).
archon reviewAnalyze staged changes and generate a smart commit message, with an option to commit immediately.
archon commitGenerate automated unit tests for the selected file.
archon test ./internal/core/orchestrator.goPerform a deep scan to detect code smells or design pattern violations.
Generate diagram code (Mermaid/PlantUML).
archon diagram --type sequence --focus "OrderProcess"Automatically generate code documentation (docstrings/comments).
Show system health status, vector index statistics, and API quota usage.
Removes the configuration file and local vector database. To remove the binary, use the uninstall script provided in the repository.
View or modify configuration settings.
Start Language Server mode (for IDE integration).
Display build version information.
Simply type archon without arguments to enter interactive mode.
- Arrow Up/Down: Move between menus or scroll chat history.
- Enter: Select menu or send message.
- Tab: Switch between panels (e.g., between Chat and Context panels).
- Esc / Ctrl+C: Return to menu or exit the application.
- Chat Mode: Interactive discussion with AI.
- AI Code Review: Analyze staged changes directly from TUI.
- Smart Commit: Generate commit message suggestions based on staged changes.
- System Status: View vector database statistics and API status.
- Index Progress: Visualized file indexing process.
- Token Monitor: Monitor session token usage in the status bar at the bottom.