{"record":{"id":"d7b7dba8e009ee58","repo":"atuinsh/atuin","slug":"config-key-must-be-non-empty-and-must-not-contain","errorCode":null,"errorMessage":"Config key must be non-empty and must not contain whitespace","messagePattern":"Config key must be non-empty and must not contain whitespace","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/config.rs","lineNumber":58,"sourceCode":"#[derive(Args, Debug)]\npub struct GetCmd {\n    /// The configuration key to get\n    pub key: String,\n\n    /// Print the value after defaults and overrides are applied\n    #[arg(long, short)]\n    pub resolved: bool,\n\n    /// Print both the config file value and the resolved value\n    #[arg(long, short)]\n    pub verbose: bool,\n}\n\nimpl GetCmd {\n    pub async fn run(&self, _settings: &Settings) -> Result<()> {\n        let key = self.key.trim();\n        if key.is_empty() || key.contains(char::is_whitespace) {\n            eyre::bail!(\"Config key must be non-empty and must not contain whitespace\");\n        }\n\n        if self.verbose {\n            println!(\"Config file:\");\n            self.print_current_value(key, \"  \").await?;\n            println!(\"\\nResolved:\");\n            Self::print_effective_value(key, \"  \");\n            return Ok(());\n        }\n\n        if self.resolved {\n            Self::print_effective_value(key, \"\");\n        } else {\n            self.print_current_value(key, \"\").await?;\n        }\n\n        Ok(())\n    }","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/config.rs#L40-L76","documentation":"`atuin config get <key>` validates the requested key after trimming: it must be non-empty and contain no whitespace. Since config keys are TOML paths (optionally dotted), whitespace or an empty string cannot identify a config value, so the command refuses early.","triggerScenarios":"Running `atuin config get \"\"`, `atuin config get \" \"`, or a key containing spaces/tabs such as `atuin config get \"sync address\"`.","commonSituations":"Shell variable interpolation producing an empty value (`atuin config get \"$KEY\"` with KEY unset); copy-pasted keys with stray spaces; mistaking a config description for its actual key name.","solutions":["Use the exact dotted config key, e.g. `atuin config get sync.records_enabled`.","Check `atuin config` (or the docs) for valid key names — no spaces are allowed.","Quote/unquote carefully in shell: ensure the variable holding the key is set and has no spaces.","Trim stray whitespace from shell variables before passing them: `atuin config get \"${KEY// /}\"`.","Inspect the server deployment for an unexpected 2FA-on-register policy if this is your own instance."],"exampleFix":"// before\natuin config get \"sync address\"\natuin config get \"$KEY\"   # KEY is empty\n// after\natuin config get auto_sync\nKEY=auto_sync; atuin config get \"$KEY\"","handlingStrategy":"validation","validationCode":"key=\"$1\"\nif [ -z \"${key// }\" ] || [[ \"$key\" =~ [[:space:]] ]]; then\n  echo \"invalid config key: '$key'\" >&2; exit 1\nfi\natuin config get \"$key\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use documented dotted key names without spaces.","Guard shell variables with : \"${KEY:?unset}\" before interpolation.","Consult `atuin config` output for valid key names.","Trim user-supplied keys before passing them."],"tags":["cli","config","validation"],"backgroundTag":"invalid-cli-argument","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}