Kilo CLI Coding Assistant - Token Efficient
Use when you need to delegate coding tasks to Kilo CLI, an autonomous AI coding assistant that works in the terminal. Provides step-by-step guidance for setup, configuration, and usage with minimal token overhead.
Trigger Conditions (Token-Optimized)
- User wants to use an AI coding assistant in the terminal/command line
- User specifically mentions "Kilo" or references the Kilo CLI
- User needs help configuring API keys for AI coding assistants
- User wants to run autonomous coding tasks from the command line
Setup and Configuration (Minimal)
1. Check if Kilo is Installed
kilo --version
2. Configure API Credentials (One-Time)
Kilo requires API credentials to access AI models. Use environment variables for token efficiency:
# Set API key once (avoids repeated prompts)
export KILO_API_KEY="sk-..."
# Or configure in ~/.config/kilo/kilo.jsonc
3. Verify Configuration
kilo auth list
Usage Patterns (Token-Saving)
Interactive Mode (Use Sparingly)
Start Kilo in interactive mode only when multi-turn conversation is needed:
kilo
With a Specific Prompt (PREFERRED - One-Shot)
Run Kilo with a direct instruction - single call, gets result:
kilo "Create a Python script that calculates Fibonacci numbers"
Continue Previous Session (When Needed)
kilo --continue
Specify Model (Token-Efficient)
kilo --model anthropic/claude-3-5-sonnet-20241022 "Explain quantum computing"
Work with Specific Project
kilo ./my-project "Refactor this code to use dependency injection"
Common Workflows (Token-Efficient)
Code Generation (One-Shot)
- Navigate to project directory
- Run:
kilo "Create a REST API endpoint for user management" - Review generated code (single output)
- Iterate with follow-up ONLY if needed
Debugging Assistance (One-Shot)
- Run:
kilo "Why is this function returning null when input is valid?" - Share relevant code snippets when prompted
- Implement suggested fixes
Code Review (One-Shot)
- Run:
kilo "Review this code for security vulnerabilities and performance issues" - Implement feedback if valid
Token Optimization Tips
- One-shot is preferred - Most tasks complete in a single Kilo call
- Specify model explicitly - Use cheaper models for simple tasks
- Limit scope - Be specific in prompts to reduce token usage
- Cache successful prompts - Repeat patterns can reuse previous results
- Avoid interactive mode unless truly needed - each turn adds overhead
- Use
--allowedToolsequivalent - Though Kilo doesn't have this flag, being specific in prompts serves the same purpose