{"record":{"id":"030624522dd7eb4d","repo":"xai-org/grok-build","slug":"provide-the-source-name-git-url-or-local-path-to","errorCode":null,"errorMessage":"Provide the source name, git URL, or local path to remove.","messagePattern":"Provide the source name, git URL, or local path to remove\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-pager/src/plugin_cmd.rs","lineNumber":1010,"sourceCode":"            let names: Vec<&str> = sources.iter().map(|s| s.name.as_str()).collect();\n            if names.is_empty() {\n                format!(\"Marketplace source \\\"{input}\\\" not found; no sources are configured.\")\n            } else {\n                format!(\n                    \"Marketplace source \\\"{input}\\\" not found. Configured sources: {}\",\n                    names.join(\", \")\n                )\n            }\n        })\n}\n\nfn marketplace_remove(\n    sources: &[xai_grok_plugin_marketplace::MarketplaceSource],\n    name_or_url: &str,\n) -> Result<()> {\n    let input = name_or_url.trim();\n    if input.is_empty() {\n        bail!(\"Provide the source name, git URL, or local path to remove.\");\n    }\n    let cwd = std::env::current_dir().unwrap_or_default();\n    let source = find_removal_source(sources, input, &cwd).map_err(|e| anyhow::anyhow!(\"{e}\"))?;\n\n    let identity = source_identity(source);\n\n    let uninstalled = plugin::uninstall_marketplace_source_plugins(&identity);\n\n    let config_path = xai_grok_config::grok_home().join(xai_grok_config::USER_CONFIG_FILENAME);\n    let mut removed_from_config = false;\n    if let Ok(content) = std::fs::read_to_string(&config_path)\n        && let Some(new) = plugin::remove_toml_marketplace_block(&content, &identity)\n    {\n        if let Err(e) = std::fs::write(&config_path, new) {\n            tracing::warn!(\"failed to write config.toml: {e}\");\n        } else {\n            removed_from_config = true;\n        }","sourceCodeStart":992,"sourceCodeEnd":1028,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-pager/src/plugin_cmd.rs#L992-L1028","documentation":"The marketplace `remove` command requires an argument identifying the source to remove. When the trimmed argument is empty (empty string or whitespace only), it bails immediately before any lookup. The library throws this to fail fast rather than guessing a source.","triggerScenarios":"Calling marketplace_remove with name_or_url that is empty or whitespace-only after trim — e.g. `grok marketplace remove \"\"` or `grok marketplace remove \"  \"`.","commonSituations":"Shell variable interpolation producing an empty value (unset env var in a script); accidentally passing a bare flag; copy-paste dropping the argument.","solutions":["Pass the source name, git URL, or local path: `grok marketplace remove <name-or-url>`.","Run `grok marketplace list` to see valid identifiers.","In scripts, guard the argument: `[ -n \"$SRC\" ] || { echo 'missing source'; exit 1; }` before invoking."],"exampleFix":"// before\ngrok marketplace remove \"$SRC\"   # SRC empty\n// after\n[ -n \"$SRC\" ] && grok marketplace remove \"$SRC\"","handlingStrategy":"validation","validationCode":"if src.trim().is_empty() {\n    eprintln!(\"usage: grok marketplace remove <name|git-url|local-path>\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass a non-empty positional argument to `marketplace remove`.","In shell scripts, quote and check variables before use: `[ -n \"$SRC\" ]`.","Avoid `set -u` pitfalls by defaulting: SRC=\"${1:-}\" and validating."],"tags":["cli","missing-argument","marketplace"],"backgroundTag":"missing-required-argument","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}