CLI Config Schema
Kilo config has two related but separate paths:
- Kilo CLI runtime loads and merges config locally.
- Cloud-served JSON Schema gives editors validation and completion for
kilo.jsonandkilo.jsonc.
JSON Schema does not load, apply, or override runtime config.
{
"$schema": "https://app.kilo.ai/config.json"
}
Two separate paths
Changing runtime config precedence affects first path. Adding or changing config key affects both paths because editor schema must describe keys CLI accepts. See CLI Runtime config precedence for runtime merge order.
Source of truth
Canonical CLI config source is Effect Schema Config.Info in packages/opencode/src/config/config.ts in Kilo-Org/kilocode. CLI derives .zod compatibility surface from Effect Schema for plugin and SDK consumers. Do not maintain separate handwritten Zod definition for Kilo config fields.
Cloud schema endpoint
Static source review of Kilo-Org/cloud shows this route behavior:
- Editor fetches
https://app.kilo.ai/config.jsonbecause config file references$schema. - Cloud route
apps/web/src/app/config.json/route.tsfetcheshttps://opencode.ai/config.json. - Route runs
merge()and returns upstream schema with Kilo additions and overrides. merge()overlays buckets fromapps/web/src/app/config.json/extras.ts.
Cloud source defines 1-hour upstream revalidation and edge-cache headers. This describes checked-in route behavior, not live deployment or cache state.
Overlay buckets
Reviewed cloud source overlays:
| Bucket | Purpose |
|---|---|
top | Top-level Kilo keys and overrides |
agents | Kilo primary agents under agent |
experimental | Kilo experimental keys under experimental |
Nested CLI fields outside these buckets need dedicated overlay bucket and matching merge() logic.
Failure mode
If cloud overlay misses valid CLI field, CLI can accept config while editor reports unknown property. Opposite drift is also possible: cloud schema can advertise field that runtime no longer accepts.
Treat schema synchronization as cross-repository contract. Tests should detect both missing valid fields and stale overlay entries. Keep branch-specific drift findings in tracked issues or test output, not this architecture page.
Adding or changing Kilo-only config key
- Add or update Effect Schema field with
kilocode_changemarker inpackages/opencode/src/config/config.ts. - Generate JSON Schema shape:
bun --bun packages/opencode/script/schema.ts /tmp/kilo.json jq '.properties.<new_key>' /tmp/kilo.json
- Update matching bucket in
apps/web/src/app/config.json/extras.tsin cloud repo. - Extend
merge()inapps/web/src/app/config.json/route.tswhen new nested bucket is required. - Add assertion in
apps/web/src/tests/cli-config-schema.test.ts. - Audit stale overlay entries as well as missing additions.
CLI schema source lives in Kilo-Org/kilocode. Public editor schema overlay lives in Kilo-Org/cloud. Config-key change is incomplete until both repositories agree.
Source map
Repository column identifies source root for each relative path.
| Repository | Source path | Role |
|---|---|---|
Kilo-Org/kilocode | packages/opencode/src/config/config.ts | Canonical Effect Schema and derived .zod surface |
Kilo-Org/cloud | apps/web/src/app/config.json/route.ts | Cloud overlay route |
Kilo-Org/cloud | apps/web/src/app/config.json/extras.ts | Kilo overlay buckets |
Kilo-Org/cloud | apps/web/src/tests/cli-config-schema.test.ts | Cloud schema assertions |
Related pages
- CLI Runtime - runtime config loading and precedence
- Development Patterns - shared-file markers, Kilo-owned boundaries, and cross-repository contributor workflow