{"record":{"id":"ba851b15f52f88da","repo":"Hmbown/CodeWhale","slug":"project-requires-a-workspace-config-is-the-user-global-lib","errorCode":null,"errorMessage":"--project requires a workspace config ({} is the user-global document)","messagePattern":"--project requires a workspace config \\((.+?) is the user-global document\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":4474,"sourceCode":"                \"config.toml at {} no longer contains api_key entries for migrated providers.\",\n                store.path().display()\n            );\n        }\n    }\n    for w in warnings {\n        eprintln!(\"warning: {w}\");\n    }\n    Ok(())\n}\n\nfn run_config_command(\n    store: &mut ConfigStore,\n    command: ConfigCommand,\n    project_bundle_scope: bool,\n    per_run_overrides: &[String],\n) -> Result<()> {\n    if project_bundle_scope && !codewhale_config::config_path_is_workspace_scoped(store.path()) {\n        bail!(\n            \"--project requires a workspace config ({} is the user-global document)\",\n            store.path().display()\n        );\n    }\n    // A per-run overlay must never leak into the file: commands that write\n    // the store refuse it outright instead of saving a merged document.\n    if !per_run_overrides.is_empty()\n        && matches!(\n            command,\n            ConfigCommand::Set { .. }\n                | ConfigCommand::Unset { .. }\n                | ConfigCommand::Import(_)\n                | ConfigCommand::Telemetry {\n                    accept_notice: Some(_)\n                }\n        )\n    {\n        bail!(","sourceCodeStart":4456,"sourceCodeEnd":4492,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L4456-L4492","documentation":"Config commands accept a `--project` (project bundle) scope flag, but it is only valid when the store's path points at a workspace-scoped config document. When the active store is the user-global document, the flag is refused and the offending path is interpolated into the message.","triggerScenarios":"Running `codewhale config --project <subcommand>` from a context (e.g. outside a workspace, or with an explicit global config path) where the resolved store path is the user-global config.toml.","commonSituations":"Running config --project in $HOME or a non-workspace directory; explicitly passing the global config path; scripts assuming a workspace root that isn't detected.","solutions":["Run the command from inside a workspace directory so a workspace-scoped config is used","Drop `--project` to operate on the user-global document","Point the invocation at a workspace config path explicitly if supported"],"exampleFix":"// before\ncd ~ && codewhale config --project set model gpt-5\n// after\ncd /path/to/workspace && codewhale config --project set model gpt-5","handlingStrategy":"validation","validationCode":"if [ \"$use_project\" = true ] && ! git rev-parse --show-toplevel >/dev/null 2>&1; then echo \"--project requires a workspace\"; exit 1; fi","typeGuard":null,"tryCatchPattern":"try { runConfigCommand(['--project', ...args]) } catch (e) { if (String(e).includes('user-global document')) { runConfigCommand(args); } else { throw e; } }","preventionTips":["Only pass --project from inside a workspace directory","Resolve the workspace root in scripts before invoking config commands"],"tags":["cli","config","scope","workspace"],"backgroundTag":"conflicting-config-options","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}