{"record":{"id":"c313234c59f2dc2c","repo":"atuinsh/atuin","slug":"please-provide-a-password","errorCode":null,"errorMessage":"please provide a password","messagePattern":"please provide a password","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/account/register.rs","lineNumber":67,"sourceCode":"            let provided = [self.username.is_some(), self.email.is_some(), self.password.is_some()]\n                .iter()\n                .filter(|&b| *b)\n                .count();\n            if provided < required_for_headless {\n                println!(\n                    \"Username, password, and email are all required for headless registration. \\\n                     Continuing with interactive registration.\\n\"\n                );\n            }\n\n            if let (Some(username), Some(email), Some(password)) =\n                (&self.username, &self.email, &self.password)\n            {\n                // Headless registration via v0 API (for CI / scripting).\n                let client = auth::auth_client(settings).await;\n\n                if password.is_empty() {\n                    bail!(\"please provide a password\");\n                }\n\n                let response = client.register(username, email, password).await?;\n\n                match response {\n                    AuthResponse::Success { session, auth_type } => {\n                        let meta = Settings::meta_store().await?;\n                        let is_hub_token =\n                            auth_type.as_deref() == Some(\"hub\") || session.starts_with(\"atapi_\");\n\n                        if is_hub_token {\n                            meta.save_hub_session(&session).await?;\n                        } else {\n                            meta.save_session(&session).await?;\n                            println!(\n                                \"\\nNote: Your account has not been fully migrated to Atuin Hub.\"\n                            );\n                            println!(","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/account/register.rs#L49-L85","documentation":"Headless registration via the legacy v0 API (when username, email and password are all supplied to `atuin register`) rejects an empty password. The password is the only secret in headless mode, so an empty string is invalid and `run` bails before calling `client.register`.","triggerScenarios":"Running `atuin register -u user -e email --password ''` or with an unset env var in CI/scripting headless registration.","commonSituations":"CI provisioning scripts with unset PASSWORD vars; YAML/TOML config where the password key is present but empty; shell quoting dropping the value.","solutions":["Supply a non-empty password via the password flag/env var in your registration script","Fail fast in the script if the password variable is empty before invoking atuin","Use interactive registration (omit flags) so the password is prompted, if a TTY is available"],"exampleFix":"// before\natuin register -u ci -e ci@example.com --password \"$REG_PW\"  # REG_PW empty\n// after\n: \"${REG_PW:?REG_PW must be set}\"\natuin register -u ci -e ci@example.com --password \"$REG_PW\"","handlingStrategy":"validation","validationCode":": \"${REG_PW:?registration password must be set}\"\n[ -n \"$REG_PW\" ] || exit 1","typeGuard":null,"tryCatchPattern":"atuin register -u \"$U\" -e \"$E\" --password \"$REG_PW\" || { echo 'registration failed'; exit 1; }","preventionTips":["Validate all headless-registration inputs before invoking atuin","Use ${VAR:?msg} for every credential var in CI scripts","Test provisioning scripts with deliberately empty secrets to catch this early"],"tags":["cli","validation","register","password"],"backgroundTag":"empty-required-field","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"}