A Go-based AI coding assistant that helps developers write, review, and improve code through natural language interactions.
Note
Rigel is currently a chat interface for AI models. Tool integrations for file operations, code execution, and repository management are not yet implemented. The full coding agent functionality is actively under development.
- AI-powered chat interface for coding assistance
- Multiple LLM providers (Anthropic Claude, Ollama local models)
- Clean terminal-based interactive UI with command completion
- Repository analysis and context generation (
/initcommand) - Provider and model switching during runtime
- Command history and session management
- Sandbox support for safe code execution (macOS only)
- Tool integrations for file operations (read, write, edit files)
- Code execution and testing capabilities
- Git operations and repository management
- Syntax highlighting and code formatting
- Integrated development workflow automation
- Go 1.25 or higher
- Git
# Clone the repository
git clone https://github.com/mizzy/rigel.git
cd rigel
# Download dependencies
go mod download
# Build
go build -o rigel cmd/rigel/main.go
# Install (optional)
go install ./cmd/rigel
# Set up environment variables
cp .env.example .env
# Edit .env with your API keysBy default, Rigel uses Ollama with the gpt-oss:20b model. No API keys are required for the default configuration.
The application works out of the box with Ollama running locally:
- Provider:
ollama - Model:
gpt-oss:20b - Base URL:
http://localhost:11434
Make sure Ollama is installed and running locally:
# Install Ollama (if not already installed)
curl -fsSL https://ollama.com/install.sh | sh
# Pull the default model
ollama pull gpt-oss:20b
# Start Ollama server (if not already running)
ollama serveCreate a .env file to use different providers or models:
# Choose a provider: ollama, anthropic
PROVIDER=anthropic
# AI Model API Keys (required based on provider)
ANTHROPIC_API_KEY=your_anthropic_api_key
# OPENAI_API_KEY=your_openai_api_key # Coming soon
# GOOGLE_API_KEY=your_google_api_key # Coming soon
# AZURE_OPENAI_API_KEY=your_azure_api_key # Coming soon
# Custom model (optional, defaults based on provider)
MODEL=claude-3-5-sonnet-20241022
# Ollama configuration (when using Ollama)
OLLAMA_BASE_URL=http://localhost:11434
# Logging
RIGEL_LOG_LEVEL=infoRigel features a clean and simple chat interface for AI-assisted coding:
# Start Rigel
rigel| Command | Action |
|---|---|
/init |
Analyze repository and generate AGENTS.md |
/model |
Show current model and select from available models |
/provider |
Switch between LLM providers (Anthropic, Ollama, etc.) |
/status |
Show current session status and configuration |
/help |
Show available commands |
/clear |
Clear chat history |
/clearhistory |
Clear command history |
/exit or /quit |
Exit the application |
| Shortcut | Action |
|---|---|
Enter |
Send message |
Alt+Enter |
New line |
Tab |
Complete command |
↑/↓ |
Navigate suggestions |
Ctrl+C (twice) |
Exit |
✦ /init
✅ Repository analyzed successfully! AGENTS.md has been created.
The file contains:
• Repository structure and overview
• Key components and their responsibilities
• File purposes and dependencies
• Testing and configuration information
✦ How do I read a file in Go?
To read a file in Go, you have several options. Here's the most common approach using os.ReadFile():
import (
"os"
"io"
)
func readFile(path string) ([]byte, error) {
return os.ReadFile(path)
}
✦ █ Type a message or / for commands (Ctrl+J for new line)
You can also use Rigel with pipes and scripts:
# Pipe input
echo "Write a hello world in Python" | rigel
# Use with heredocs
rigel << EOF
Explain this code:
$(cat main.go)
EOF
# Read from file
cat prompt.txt | rigelrigel/
├── cmd/
│ └── rigel/ # CLI entry point
└── internal/
├── agent/ # AI agent functionality
├── analyzer/ # Repository analysis
├── command/ # Command processing and definitions
│ ├── commands.go # Command implementations
│ ├── completion.go # Command completion logic
│ ├── definitions.go # Available commands
│ ├── handler.go # Main command handler
│ └── types.go # Command result types
├── config/ # Configuration management
├── history/ # Command history management
├── llm/ # LLM provider integrations
│ ├── anthropic.go # Anthropic Claude integration
│ ├── ollama.go # Ollama local models
│ ├── provider.go # Provider interface
│ └── agents_loader.go # Repository context loader
├── sandbox/ # Sandbox for safe code execution (macOS)
├── state/ # Application state management
│ ├── chat.go # Chat history and session state
│ └── llm.go # LLM configuration and selection
├── tools/ # Tool integrations (planned)
├── ui/ # Terminal UI components
│ └── termflow/ # Termflow chat session (default UI)
└── version/ # Version information
# Install pre-commit (if not already installed)
# macOS
brew install pre-commit
# Linux/Windows (via pip)
pip install pre-commit
# Install git hooks
pre-commit install
# Run hooks manually on all files
pre-commit run --all-files# Run in development mode
go run cmd/rigel/main.go
# Run tests
go test ./...
# Test coverage
go test -cover ./...
# Benchmark tests
go test -bench=. ./...
# Static analysis
staticcheck ./...
# Build
make build- Anthropic (Claude models) - Full support
- Ollama (Local models) - Full support
- OpenAI (GPT models) - Coming soon
- Google (Gemini models) - Coming soon
- Azure OpenAI - Coming soon
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details