kj agents
kj agents is the role → provider map. Every pipeline role (coder, reviewer, planner, …) is backed by some AI provider (Claude, Codex, Gemini, Aider, OpenCode); this command shows that mapping and changes it without re-running the kj init wizard.
What it does
Section titled “What it does”kj agents reads the role-to-provider assignments from your config and either lists them (kj agents / kj agents list) or sets one (kj agents set <role> <provider>). By default kj agents set writes the panel of the repo you are in, .karajan/kj.config.yml (--local); --global writes the shared ~/.karajan/kj.config.yml, used by repos without a panel of their own. Outside a repo with a .karajan/ folder, kj agents set without --global stops and says so.
This is the “I want Gemini reviewing instead of Codex from now on” command.
A human act
Section titled “A human act”The panel is yours: it decides who writes the code, who reviews it and who arbitrates. kj agents set is a human act (ADR 0009, ADR 0018), like kj hooks set. kj refuses it when it runs inside an agent session or descends from an agent process, and you confirm it by typing back the code it shows at your terminal. At the critical level (the default) and at max your phone signs it too; at normal, only when a phone is enrolled. Type it in your own terminal, never in a script.
The MCP tool kj_agents lists the panel; its set action refuses and names the kj agents set command for you to type. kj agents (the listing) stays free.
When to use
Section titled “When to use”- Switching a role’s provider permanently —
kj agents set reviewer gemini. - Inspecting the current map —
kj agentsbefore a run to confirm who’s backing what. - After installing a new agent CLI — point a role at it without the full
kj initwizard. - Cost/quality tuning — move the coder to a cheaper provider, keep the reviewer on a strong one.
When NOT to use
Section titled “When NOT to use”- From an agent session — kj refuses it; the agent tells you the command and you type it.
- First-time setup —
kj initdetects what’s installed and walks every role;kj agentsassumes you already know the provider name. - Enabling/disabling a role — that’s pipeline toggles (
--enable-X/ config), not provider mapping.kj agentsonly answers “which provider”, not “does this role run”. - Reading what a role does — that’s
kj roles, notkj agents.
Options & subcommands
Section titled “Options & subcommands”| Form | Effect |
|---|---|
kj agents / kj agents list |
Print every role and its assigned provider. |
kj agents set <role> <provider> |
Reassign one role: kj agents set coder claude. |
| Flag | Default | When to flip it |
|---|---|---|
--local |
on | Write this repo’s .karajan/kj.config.yml. |
--global |
off | Write the shared ~/.karajan/kj.config.yml, for repos without a panel of their own. Exclusive with --local. |
Examples
Section titled “Examples”Inspect the current map
Section titled “Inspect the current map”kj agentsWhat happens: prints the role→provider table (e.g. coder → claude, reviewer → codex, planner → claude). The fastest way to answer “who reviews here?”.
Permanently switch the reviewer
Section titled “Permanently switch the reviewer”kj agents set reviewer geminiWhat happens: kj shows a code, you type it back, and this repo’s .karajan/kj.config.yml gets reviewer: gemini; kj review in this repo uses Gemini until you change it again. No other role is touched.
Cost tuning
Section titled “Cost tuning”kj agents set coder codexkj agents set reviewer claudeWhat happens: coding moves to one provider, review to another — a deliberate cross-provider pair set as the persistent default.
How it works internally
Section titled “How it works internally”kj agents set checks the role and the provider, runs the human act, and only then writes the config file of its scope. A refused act writes nothing. The provider must be one kj knows or a binary on your PATH.
Keeping kj agents (the provider behind a role) distinct from kj roles (what the role is) keeps two independent questions apart: who backs a role, and what the role does.
Related
Section titled “Related”kj roles— what each role is;kj agentsonly sets who backs it.kj init— the wizard that establishes the initial mapping.kj config— view the underlyingkj.config.yml.- Pipeline roles — the full catalogue of roles you can reassign.
Karajan Code™ · AGPL-3.0