opencode-kilocode-auth
v1.0.18
Published
OpenCode plugin for Kilo Code authentication with support for various models including Giga Potato
Readme
OpenCode Kilo Code Auth Plugin
An OpenCode plugin for authenticating with Kilo Code and accessing various AI models, including the Giga Potato model - a stealth model optimized for agentic programming.
Features
- Kilo Code Authentication: Login via browser-based device auth or manual token entry
- 300+ AI Models: Access to Claude, GPT, Gemini, DeepSeek, Llama, and more
- Giga Potato Model: Free stealth model optimized for agentic programming with vision support
- Model Selection: Browse and select from available models
- Zero Configuration: Automatic request routing through Kilo Code API
Installation
Method 1: Add to opencode.json (Recommended)
Add the plugin to your OpenCode configuration file (~/.config/opencode/opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-kilocode-auth"
],
"provider": {
"kilocode": {
"models": {
"giga-potato": {}
}
}
},
"model": "kilocode/giga-potato"
}Method 2: Local Plugin Directory
- Copy the plugin to your OpenCode plugins directory:
# Create plugins directory
mkdir -p ~/.config/opencode/plugins
# Copy plugin file
cp path/to/opencode-kilocode-auth/src/plugin.ts ~/.config/opencode/plugins/kilocode.ts- OpenCode will automatically load plugins from the
~/.config/opencode/plugins/directory.
Method 3: Install via npm/bun
# Navigate to your opencode config directory
cd ~/.config/opencode
# Install the plugin
bun add opencode-kilocode-auth
# Or using npm
npm install opencode-kilocode-authThen add to your opencode.json:
{
"plugin": ["opencode-kilocode-auth"]
}Authentication
When you run OpenCode, you'll see "kilocode" as an available provider. Select it and choose an auth method:
- Login with Kilo Code (OAuth): Opens browser for secure device auth
- Enter Kilo Code API Token: Enter your API token directly
Getting a Kilo Code Token
- Go to https://kilo.ai
- Sign up or log in
- Navigate to Settings → API Keys
- Generate a new API key
Giga Potato Model
The Giga Potato model is a stealth model deeply optimized for agentic programming:
| Feature | Value |
|---------|-------|
| Model ID | giga-potato |
| Context Window | 256K tokens |
| Max Output | 32K tokens |
| Vision Support | Yes (can analyze images) |
| Tool Support | Yes (write_file, edit_file) |
| Reasoning | Yes |
| Price | FREE |
Using Giga Potato
Set it as your default model in opencode.json:
{
"model": "kilocode/giga-potato"
}Or select it interactively when prompted for a model.
Available Models
Free Models
| Model | Description |
|-------|-------------|
| giga-potato | Stealth model for agentic programming (256K context, vision) |
| x-ai/grok-code-fast-1 | xAI Grok optimized for fast code generation |
| mistralai/devstral-2512:free | Mistral's development model |
| corethink:free | CoreThink reasoning model |
Premium Models (via Kilo Code subscription)
| Model | Description |
|-------|-------------|
| anthropic/claude-opus-4.5 | Latest Claude Opus |
| anthropic/claude-sonnet-4.5 | Latest Claude Sonnet |
| openai/gpt-5.2 | Latest GPT model |
| google/gemini-3-pro-preview | Gemini 3 Pro |
| deepseek/deepseek-r1 | DeepSeek reasoning model |
Configuration Example
Full opencode.json example:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-kilocode-auth"
],
"provider": {
"kilocode": {
"models": {
"giga-potato": {
"name": "Giga Potato",
"contextLength": 256000,
"maxTokens": 32000
},
"anthropic/claude-sonnet-4": {},
"openai/gpt-4o": {}
}
}
},
"model": "kilocode/giga-potato",
"agent": {
"build": {
"model": "kilocode/giga-potato"
}
}
}Environment Variables
| Variable | Description |
|----------|-------------|
| KILOCODE_TOKEN | Pre-set your Kilo Code API token |
| KILOCODE_BACKEND_BASE_URL | Custom backend URL (for development) |
How It Works
- Authentication: Uses device auth flow (like GitHub CLI) or direct token entry
- Request Routing: Intercepts AI requests and routes them through Kilo Code's OpenRouter-compatible API
- Model Access: Provides access to 300+ models through a single authentication
- Cost Tracking: Billing is handled by Kilo Code, costs show as $0 in OpenCode
Troubleshooting
Plugin not loading
Make sure the plugin is properly installed:
# Check if plugin is in node_modules
ls ~/.config/opencode/node_modules/opencode-kilocode-auth
# Or check plugins directory
ls ~/.config/opencode/plugins/Authentication failing
- Check your internet connection
- Try logging in at https://kilo.ai first
- Generate a new API token if the old one expired
Model not found
Make sure you're using the correct model ID format: kilocode/model-name
For example:
kilocode/giga-potatokilocode/anthropic/claude-sonnet-4
Development
# Clone the repo
git clone <repo-url>
cd opencode-kilocode-auth
# Install dependencies
bun install
# Test the API
bun run test/api-test.ts
# Build
bun run buildLicense
MIT
Credits
Ported from Kilo Code for OpenCode integration.
