{"record":{"id":"0d9fc693bac47359","repo":"rtk-ai/rtk","slug":"vibe-support-is-global-only-use-rtk-init-g-ag","errorCode":null,"errorMessage":"Vibe support is global-only. Use: rtk init -g --agent vibe","messagePattern":"Vibe support is global-only\\. Use: rtk init -g --agent vibe","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hooks/init.rs","lineNumber":6204,"sourceCode":"fn resolve_vibe_dir() -> Result<PathBuf> {\n    resolve_home_subdir(VIBE_DIR)\n}\n\n/// Entry point for `rtk init -g --agent vibe`.\n///\n/// Installs a `pre_tool` hook into `~/.vibe/hooks.toml` (Vibe CLI's hook\n/// registry, see https://docs.mistral.ai/vibe/code/cli/hooks) that routes\n/// bash tool calls through the native `rtk hook vibe` binary. When not\n/// `hook_only`, also drops an `~/.vibe/prompts/rtk.md` system prompt file\n/// as a belt-and-suspenders fallback if the hook is disabled.\npub fn run_vibe_mode(\n    global: bool,\n    hook_only: bool,\n    patch_mode: PatchMode,\n    ctx: InitContext,\n) -> Result<()> {\n    if !global {\n        anyhow::bail!(\"Vibe support is global-only. Use: rtk init -g --agent vibe\");\n    }\n    let vibe_dir = resolve_vibe_dir()?;\n    run_vibe_mode_at(&vibe_dir, hook_only, patch_mode, ctx)\n}\n\nfn run_vibe_mode_at(\n    vibe_dir: &Path,\n    hook_only: bool,\n    patch_mode: PatchMode,\n    ctx: InitContext,\n) -> Result<()> {\n    let InitContext { dry_run, .. } = ctx;\n    if !dry_run {\n        fs::create_dir_all(vibe_dir)\n            .with_context(|| format!(\"Failed to create Vibe config dir: {}\", vibe_dir.display()))?;\n    }\n\n    let hooks_path = vibe_dir.join(VIBE_HOOKS_FILE);","sourceCodeStart":6186,"sourceCodeEnd":6222,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/hooks/init.rs#L6186-L6222","documentation":"Like Gemini, Vibe agent integration in rtk is global-only: setup_vibe bails unless `global` is true, because Vibe is configured in the user's home directory (~/.vibe via resolve_vibe_dir), not per project. The error states the corrected command using the newer --agent syntax.","triggerScenarios":"Calling `rtk init --agent vibe` without -g, or `rtk init --vibe` without -g, i.e. any run where setup_vibe receives global=false. Also triggered by scripts calling the init path programmatically with global=false and patch_mode set.","commonSituations":"Trying to scope Vibe hooks to one repo; copying an init command from a teammate who already had it globally; upgrading rtk and re-running an old project-local init script.","solutions":["Rerun with the global flag: `rtk init -g --agent vibe`","Remove any stale local hook config expecting per-project Vibe support","If different behavior per project is needed, gate via Vibe's own config rather than rtk's"],"exampleFix":"// before\nrtk init --agent vibe\n// after\nrtk init -g --agent vibe","handlingStrategy":"validation","validationCode":"// shell check before invoking\nif ! [[ \"$*\" == *\" -g\"* ]]; then echo \"Vibe requires global: rtk init -g --agent vibe\" >&2; exit 2; fi","typeGuard":null,"tryCatchPattern":"rtk init --agent vibe || { echo \"retrying globally\"; rtk init -g --agent vibe; }","preventionTips":["Never script `--agent vibe` without -g","Verify the init flag syntax after upgrading rtk (old --vibe flag may have moved under --agent)","Per-project Vibe scoping is unsupported; plan configurations accordingly"],"tags":["cli","init","vibe","global-only"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"0924356b4caba4989607227b7c8824d3d8098719","analyzedAt":"2026-09-19T19:25:29.612Z","contentChangedAt":"2026-09-19T19:25:29.612Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}