{"record":{"id":"6dcc5d566279bc8e","repo":"nikivdev/code","slug":"no-command-specified","errorCode":null,"errorMessage":"No command specified","messagePattern":"No command specified","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/env.rs","lineNumber":3897,"sourceCode":"                // Escape for shell\n                let escaped = value.replace('\\\\', \"\\\\\\\\\").replace('\"', \"\\\\\\\"\");\n                println!(\"{}=\\\"{}\\\"\", key, escaped);\n            }\n        }\n    }\n\n    Ok(())\n}\n\n/// Run a command with env vars injected from cloud.\nfn run_with_env(\n    personal: bool,\n    environment: &str,\n    keys: &[String],\n    command: &[String],\n) -> Result<()> {\n    if command.is_empty() {\n        bail!(\"No command specified\");\n    }\n\n    let target = if personal {\n        resolve_personal_target()?\n    } else {\n        resolve_env_target()?\n    };\n    let vars = fetch_env_vars(&target, environment, keys, !personal)?;\n\n    let (cmd, args) = command.split_first().unwrap();\n\n    let mut child = Command::new(cmd);\n    child.args(args);\n\n    // Inject env vars\n    for (key, value) in &vars {\n        child.env(key, value);\n    }","sourceCodeStart":3879,"sourceCodeEnd":3915,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/env.rs#L3879-L3915","documentation":"Raised by the env-run (run-with-env) command when it is invoked without a trailing command to execute. This command fetches env vars and then spawns the given command with them injected, so an empty command list is a usage error caught before any network call.","triggerScenarios":"Running `f env run --personal --environment prod` (or with keys) but omitting the `-- <command>` portion, e.g. missing the `--` separator so the CLI parses no command arguments.","commonSituations":"Forgetting the `--` separator before the command; quotes consuming the command; copying a docs example and dropping the command part.","solutions":["Append the command after `--`: `f env run --environment prod -- node server.js`.","Quote complex commands so the whole argv reaches the runner.","Check shell alias/wrapper isn't stripping trailing arguments."],"exampleFix":"// before\nf env run --environment prod -- node\n// after\nf env run --environment prod -- node server.js","handlingStrategy":"validation","validationCode":"# shell guard: require a command after --\nargs=$(...)\n[ -n \"$CMD\" ] || { echo \"usage: f env run [--env e] -- <command...>\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always separate options from the command with `--`.","Quote commands with flags: `-- \"node server.js --port 3000\"` or pass as separate argv items.","Verify wrapper scripts/aliases don't drop trailing arguments."],"tags":["cli","argument-validation","usage"],"backgroundTag":"invalid-cli-argument","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}