Skip to main content

Kilo CLI

Kilo CLI is an open source, terminal-based AI coding tool. Connect it to Openference to use high-quality models directly from your terminal. With Kilo CLI, you can:
  • Edit code across multiple files without leaving the terminal
  • Generate, explain, and refactor code with AI assistance
  • Automate repetitive tasks such as writing unit tests, fixing bugs, and reviewing changes
  • Switch between models based on task complexity

Prerequisites

Before you begin:
  • An Openference account and API key (create one at openference.com)
  • Node.js 18.0 or later

Install Kilo CLI

Install Kilo CLI globally:
Verify the installation:
A version number confirms successful installation.

Get your API key

Create an API key in the Openference dashboard. Copy it — it is shown only once. You will use the OPENFERENCE_API_KEY environment variable.

Configure the connection

Edit the Kilo CLI configuration file:
Create or edit ~/.config/kilo/kilo.jsonc:
Tip: the limit block tells Kilo each model’s real context window and max output. Without it, coding agents assume a small default (~128k) and start compacting the session around ~100k tokens. Current values are advertised as context_length and max_output_tokens in GET /v1/models.
Export your API key in the shell (add to your profile for persistence):

Select a model and start coding

  1. Run /models in Kilo CLI and select the Openference provider.
  2. Pick a model (e.g. openference/GLM-5.2).
Example prompts:
When configuring or picking a default model, use the models in this order:
  1. GLM-5.2 — top tier (most capable for complex reasoning, agents, and architecture)
  2. Kimi K2.6 — all rounder (strong general-purpose choice for most tasks)
  3. DeepSeek-V4-Pro — medium (balanced performance and value)
  4. Qwen3.7 Plus — Vision (use when you need image / multimodal understanding)
  5. DeepSeek-V4-Flash — instant (fast and lightweight responses)
Always verify the exact IDs available to your key:

FAQ

I get an error or no response after connecting

  • Verify that OPENFERENCE_API_KEY is exported in the current shell.
  • Confirm the model name exactly matches an ID from GET /v1/models (including spaces and casing).
  • Check JSON syntax in config.json (missing commas are a common cause).

How do I switch models?

Run /models inside Kilo CLI, search for Openference, and select a different model. You can also edit the models block in config.json and restart.

Can I use the same key for other tools?

Yes. The same Openference API key works in Cursor, Claude Code, Codex, OpenCode, Cline, Python/Node SDKs, and Kilo CLI. See the Compatibility Matrix.

Next steps