rtk-ai/rtk · error · anyhow::Error
Vibe support is global-only. Use: rtk init -g --agent vibe
Error message
Vibe support is global-only. Use: rtk init -g --agent vibe
What it means
Vibe support installs a pre_tool hook into ~/.vibe/hooks.toml (Vibe CLI's global hook registry) and, unless --hook-only, also drops ~/.vibe/prompts/rtk.md. Both are user-global, so run_vibe_mode bails on a project-scoped invocation before resolving or creating anything.
Source
Thrown at src/hooks/init.rs:4470
fn resolve_vibe_dir() -> Result<PathBuf> {
resolve_home_subdir(VIBE_DIR)
}
/// Entry point for `rtk init -g --agent vibe`.
///
/// Installs a `pre_tool` hook into `~/.vibe/hooks.toml` (Vibe CLI's hook
/// registry, see https://docs.mistral.ai/vibe/code/cli/hooks) that routes
/// bash tool calls through the native `rtk hook vibe` binary. When not
/// `hook_only`, also drops an `~/.vibe/prompts/rtk.md` system prompt file
/// as a belt-and-suspenders fallback if the hook is disabled.
pub fn run_vibe_mode(
global: bool,
hook_only: bool,
patch_mode: PatchMode,
ctx: InitContext,
) -> Result<()> {
if !global {
anyhow::bail!("Vibe support is global-only. Use: rtk init -g --agent vibe");
}
let vibe_dir = resolve_vibe_dir()?;
run_vibe_mode_at(&vibe_dir, hook_only, patch_mode, ctx)
}
fn run_vibe_mode_at(
vibe_dir: &Path,
hook_only: bool,
patch_mode: PatchMode,
ctx: InitContext,
) -> Result<()> {
let InitContext { dry_run, .. } = ctx;
if !dry_run {
fs::create_dir_all(vibe_dir)
.with_context(|| format!("Failed to create Vibe config dir: {}", vibe_dir.display()))?;
}
let hooks_path = vibe_dir.join(VIBE_HOOKS_FILE);View on GitHub (pinned to d977e1c316)
Solutions
- Run `rtk init -g --agent vibe`
- Add --hook-only if you only want the hook and not the prompt file: `rtk init -g --agent vibe --hook-only`
Example fix
# before rtk init --agent vibe # error: global-only # after rtk init -g --agent vibe
Defensive patterns
Strategy: validation
Validate before calling
# bash: vibe is global-only rtk init -g --agent vibe --dry-run # preview writes to ~/.vibe
Prevention
- Pair vibe with -g; add --hook-only when you do not want the prompt file
- Back up ~/.vibe/hooks.toml before init if you maintain it by hand
When it happens
Trigger: `rtk init --agent vibe` without `-g` — src/hooks/init.rs:4478.
Common situations: New Vibe users copying a generic init command; automation running without a writable HOME.
Related errors
- Windsurf support is global-only. Use: rtk init -g --agent wi
- Gemini support is global-only. Use: rtk init -g --gemini
- Kilo Code is project-scoped. Use: rtk init --agent kilocode
- Antigravity is project-scoped. Use: rtk init --agent antigra
- Kimi AI is project-scoped. Use: rtk init --agent kimi
AI-assisted analysis of rtk-ai/rtk@d977e1c316 (2026-08-16).
Data as JSON: /api/errors/0d9fc693bac47359.
Report an issue: GitHub.