rtk-ai/rtk · error

Kimi AI is project-scoped. Use: rtk init --agent kimi

Error message

Kimi AI is project-scoped. Use: rtk init --agent kimi

What it means

The Kimi AI integration is project-scoped, so rtk rejects `--global` up front. Part of the same scope-validation ladder in main.rs: global-only agents (windsurf, cursor, opencode, gemini, vibe) require -g, project-only agents (kilocode, antigravity, kimi) forbid it.

Source

Thrown at src/main.rs:2070

                    hooks::init::run_copilot(ctx)?;
                }
            } else if agent == Some(AgentTarget::Pi) {
                hooks::init::run_pi_mode(global, ctx)?
            } else if agent == Some(AgentTarget::Kilocode) {
                if global {
                    anyhow::bail!("Kilo Code is project-scoped. Use: rtk init --agent kilocode");
                }
                hooks::init::run_kilocode_mode(ctx)?;
            } else if agent == Some(AgentTarget::Antigravity) {
                if global {
                    anyhow::bail!(
                        "Antigravity is project-scoped. Use: rtk init --agent antigravity"
                    );
                }
                hooks::init::run_antigravity_mode(ctx)?;
            } else if agent == Some(AgentTarget::Kimi) {
                if global {
                    anyhow::bail!("Kimi AI is project-scoped. Use: rtk init --agent kimi");
                }
                hooks::init::run_kimi_mode(ctx)?;
            } else if agent == Some(AgentTarget::Hermes) {
                hooks::init::run_hermes_mode(ctx)?;
            } else if agent == Some(AgentTarget::Droid) {
                hooks::init::run_droid_mode(global, ctx)?;
            } else if agent == Some(AgentTarget::Vibe) {
                let patch_mode = if auto_patch {
                    hooks::init::PatchMode::Auto
                } else if no_patch {
                    hooks::init::PatchMode::Skip
                } else {
                    hooks::init::PatchMode::Ask
                };
                hooks::init::run_vibe_mode(global, hook_only, patch_mode, ctx)?;
            } else {
                let install_opencode = opencode;
                let install_claude = !opencode;

View on GitHub (pinned to d977e1c316)

Solutions

  1. Run `rtk init --agent kimi` from the project root, without -g
  2. Centralize the agent→scope mapping in your setup scripts (see prevention tips)

Example fix

# before
rtk init -g --agent kimi   # error: project-scoped

# after
rtk init --agent kimi
Defensive patterns

Strategy: validation

Validate before calling

# bash: kimi is project-scoped
rtk init --agent kimi   # from the project root, no -g

Prevention

When it happens

Trigger: `rtk init -g --agent kimi` (or --global) — the bail at src/main.rs:2072.

Common situations: Reusing a '-g for everything' provisioning script; copy-paste between agent init commands.

Related errors


AI-assisted analysis of rtk-ai/rtk@d977e1c316 (2026-08-16). Data as JSON: /api/errors/f157abb6e26dd03a. Report an issue: GitHub.