A terminal-based AI assistant with local knowledge management, built with Firebase Genkit.
- Local Knowledge Base - Index your documents for context-aware conversations
- Session Persistence - Conversations are saved and can be resumed
- Built-in Tools - File operations, system commands, and HTTP requests
- MCP Integration - Works with Claude Desktop, Cursor, and Gemini CLI
- HTTP API - Programmatic access for automation
Prerequisites: Go 1.25+, Node.js 20+, Docker, Gemini API key
git clone https://github.com/koopa0/koopa-cli.git
cd koopa-cli
# Install Task (build tool)
go install github.com/go-task/task/v3/cmd/task@latest
# Install dependencies and build
task install # Install frontend deps and templ
task build # Build binary with all assets
# Start database
docker-compose up -d
# Run
export GEMINI_API_KEY=your-api-key
./koopa$ ./koopa
Koopa - Your terminal AI personal assistant
> Hello!
Koopa> Hi! How can I help you today?
> /help
Other modes:
./koopa serve # HTTP API server (requires HMAC_SECRET)
./koopa mcp # MCP server for external tools| Variable | Required For | Description | Configuration |
|---|---|---|---|
GEMINI_API_KEY |
All modes | Google AI API key | Environment variable only |
hmac_secret |
serve mode |
CSRF token secret (min 32 chars) | Set in ~/.koopa/config.yaml |
postgres_* |
All modes | Database connection | Set in ~/.koopa/config.yaml |
Example config.yaml:
# ~/.koopa/config.yaml
postgres_host: "localhost"
postgres_port: 5432
postgres_user: "koopa"
postgres_password: "" # or set KOOPA_POSTGRES_PASSWORD env var
postgres_db_name: "koopa"
postgres_ssl_mode: "disable"
hmac_secret: "your-32-char-secret" # Generate with: openssl rand -base64 32Example usage:
export GEMINI_API_KEY=your-api-key
./koopa serveSee config.example.yaml for all configuration options.
# Build frontend assets (required before tests)
task css
# Generate templ files
task generate
# Run tests
task test
# Run tests with race detector
task test:race
# Development server (auto-reload)
task devThe web interface is available when running in serve mode:
# Set API key (required)
export GEMINI_API_KEY=your-api-key
# Configure database in ~/.koopa/config.yaml:
# postgres_host: localhost
# postgres_port: 5432
# postgres_user: koopa
# postgres_password: "" # or set KOOPA_POSTGRES_PASSWORD env var
# postgres_db_name: koopa
# postgres_ssl_mode: disable
#
# hmac_secret: "..." # Generate with: openssl rand -base64 32
./koopa serve
# Visit http://localhost:3400/genui- Fork and create a feature branch
- Build assets:
task generate css - Ensure tests pass:
task test:race - Submit a pull request