docs(setup): document Kilo Code registration and its config layers (#13413)

* docs(setup): document Kilo Code registration and its config layers

Add the missing Kilo Code section to the client configuration guide: the
config root, the user-scope layer order Kilo loads, the last-present-layer
write rule, the entry shape, and the legacy extension MCP files Kilo still
merges at its lowest precedence, which REA does not inspect.

Cover the Windows and macOS default file and a kilo.jsonc round trip that
keeps comments, settings and other servers through setup and uninstall.
Plan the default location with the row's platform path functions, as the
other client helpers do, instead of appending file names with the host's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(setup): say only rea mcp add keeps a disabled Kilo entry

Setup's refresh treats enabled as a managed key and writes Kilo's default
enabled: true; only rea mcp add preserves an existing enabled: false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Akshad JogiandClaude Opus 5.5 authored and GitHub committed 2026-11-22 08:01:36 -05:00
1 parent bd9a7fad7e
commit c445f56ae3
3 files changed
+87 -4

No files matched your search

@@ -935,6 +935,29 @@ relative additional entry depends on
Goose's working directory, so REA refuses it. Goose reads its configuration at
startup; restart it after setup.
## Kilo Code
For [Kilo Code](https://kilo.ai/docs/automate/mcp/using-in-kilo-code), setup
and `rea mcp add` write `mcp.rea` into the last user-scope file Kilo loads.
Kilo's config root is `$XDG_CONFIG_HOME/kilo` when `XDG_CONFIG_HOME` is set,
otherwise `~/.config/kilo`, on every OS including Windows. Kilo reads that
root's `config.json`, `kilo.json`, `kilo.jsonc`, `opencode.json` and
`opencode.jsonc`, then the `KILO_CONFIG` file, then `~/.kilocode`, `~/.kilo` and
`KILO_CONFIG_DIR`, each for `kilo.jsonc`, `kilo.json`, `opencode.jsonc` and
`opencode.json`. When none of those files exists, setup creates `kilo.json` in
the root (or in an empty `KILO_CONFIG_DIR`). A relative Kilo path depends on
Kilo's working directory, so REA refuses it. The entry is
`{ "type": "local", "command": [exe, ...args], "enabled": true }`, plus
`environment` only when it is non-empty. `rea mcp add` preserves an existing
`enabled: false`; `rea setup` sets `enabled: true`.
`KILO_CONFIG_CONTENT` is Kilo's highest layer and is never edited (see
[installation](installation.md)); project registration with `rea mcp add` is in
the [CLI guide](cli.md). Kilo also reads its legacy extension MCP files
(`mcpServers` in the VS Code extension's `mcp_settings.json`, and the project
`.kilocode/mcp.json` and `.kilo/mcp.json`) at the lowest precedence, below any
`kilo.json` layer. REA neither inspects nor removes them, so a `rea` entry added
there by hand stays in effect after uninstall.
## WorkBuddy
For [WorkBuddy](https://www.workbuddy.cn/docs/workbuddy/From-Beginner-to-Expert-Guide/Function-Description/MCP-Guide), setup writes `mcpServers.rea` into the
+5 -3
View File
@@ -175,14 +175,16 @@ export const kiloDefaultLocation = (
const explicit = kiloExplicitFile(context);
const custom = kiloExplicitDirectory(context);
const homes = kiloHomePaths(context);
// The row is planned for its platform, which tests choose apart from the host.
const pathApi = context.root.platform === "win32" ? win32 : posix;
return {
configPath: join(root, "kilo.json"),
configPath: pathApi.join(root, "kilo.json"),
configPaths: [
...KILO_GLOBAL_FILES.map((name) => join(root, name)),
...KILO_GLOBAL_FILES.map((name) => pathApi.join(root, name)),
...(explicit === undefined ? [] : [explicit]),
...[...homes, ...(custom === undefined ? [] : [custom])].flatMap(
(directory) =>
KILO_DIRECTORY_FILES.map((name) => join(directory, name)),
KILO_DIRECTORY_FILES.map((name) => pathApi.join(directory, name)),
),
],
markerPath: root,
@@ -1,7 +1,8 @@
import { registerMcpClientsOnHost } from "../../fixtures/mcpRegistration.js";
import { HOST_PLATFORM } from "../../../src/platform/HostPlatform.js";
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
import { join } from "node:path";
import { join, posix, win32 } from "node:path";
import { parse as parseJsonc } from "jsonc-parser";
import { afterEach, beforeEach, expect, it, vi } from "vitest";
import { readEffectiveClientRegistrationConfiguration } from "../../../src/application/ClientConfigurationFiles.js";
@@ -66,6 +67,63 @@ it("writes Kilo's kilo.json in its config root until another layer exists", asyn
});
});
it.each([
["win32", "C:\\Users\\x", win32],
["darwin", "/Users/x", posix],
] as const)(
"defaults Kilo's file to .config/kilo/kilo.json on %s without XDG_CONFIG_HOME",
(hostPlatform, home, pathModule) => {
const row = supportedClients(home, hostPlatform, {}).find(
({ name }) => name === "kilo",
);
expect(row?.configPath).toBe(
pathModule.join(home, ".config", "kilo", "kilo.json"),
);
},
);
it("keeps comments, settings and other servers through setup and uninstall of kilo.jsonc", async () => {
const home = await createTestTempDirectory("rea-kilo-jsonc-");
const root = join(home, ".config", "kilo");
await mkdir(root, { recursive: true });
const target = join(root, "kilo.jsonc");
await writeFile(
target,
`{
// line comment
"theme": "dark", /* block comment */
"mcp": { "other": { "type": "local", "command": ["x"] } }
}
`,
);
const row = await kiloRow(home);
if (row === undefined) throw new Error("Kilo row is missing");
expect(row.configPath).toBe(target);
expect(await configureClientConfiguration(row, {}, command)).toMatchObject({
status: "configured",
});
const preserved = async () => {
const text = await readFile(target, "utf8");
expect(text).toContain("// line comment");
expect(text).toContain("/* block comment */");
const parsed = parseJsonc(text) as {
theme?: string;
mcp: Record<string, unknown>;
};
expect(parsed.theme).toBe("dark");
expect(parsed.mcp.other).toEqual({ type: "local", command: ["x"] });
return parsed;
};
expect((await preserved()).mcp.rea).toMatchObject({
type: "local",
command,
enabled: true,
});
const { kilo } = await uninstallKilo(home, {});
expect(kilo?.status).toBe("removed");
expect((await preserved()).mcp).not.toHaveProperty("rea");
});
it("selects the last present Kilo layer, as rea mcp add does", async () => {
const home = await createTestTempDirectory("rea-kilo-layers-");
const root = join(home, ".config", "kilo");