{"record":{"id":"939f9c4525b8a19b","repo":"atuinsh/atuin","slug":"you-are-not-logged-in","errorCode":null,"errorMessage":"You are not logged in","messagePattern":"You are not logged in","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/account/change_password.rs","lineNumber":23,"sourceCode":"use rpassword::prompt_password;\n\n#[derive(Parser, Debug)]\npub struct Cmd {\n    #[clap(long, short)]\n    pub current_password: Option<String>,\n\n    #[clap(long, short)]\n    pub new_password: Option<String>,\n\n    /// The two-factor authentication code for your account, if any\n    #[clap(long, short)]\n    pub totp_code: Option<String>,\n}\n\nimpl Cmd {\n    pub async fn run(&self, settings: &Settings) -> Result<()> {\n        if !settings.logged_in().await? {\n            bail!(\"You are not logged in\");\n        }\n\n        let client = auth::auth_client(settings).await;\n\n        let current_password = self.current_password.clone().unwrap_or_else(|| {\n            prompt_password(\"Please enter the current password: \")\n                .expect(\"Failed to read from input\")\n        });\n\n        if current_password.is_empty() {\n            bail!(\"please provide the current password\");\n        }\n\n        let new_password = self.new_password.clone().unwrap_or_else(|| {\n            prompt_password(\"Please enter the new password: \").expect(\"Failed to read from input\")\n        });\n\n        if new_password.is_empty() {","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/account/change_password.rs#L5-L41","documentation":"`atuin account change-password` refuses to run because the local settings indicate no logged-in user. `Settings::logged_in()` checks for a stored session token; without one there is no authenticated session to change a password for, so the command bails early with a guidance message.","triggerScenarios":"Running `atuin account change-password` before ever running `atuin register` or `atuin login`, or after the session token was removed from the meta store (e.g. `atuin logout` or a wiped config/data directory).","commonSituations":"Fresh machine or CI container where the user copied settings.toml but never logged in; running the command with ATUIN_HOME pointing at an empty directory; after logout expecting password change to still work.","solutions":["Run `atuin login` (or `atuin register`) first to establish a session","Verify you are pointing at the intended home: check ATUIN_HOST/ATUIN_HOME env vars so the session token is actually visible","Confirm `~/.local/share/atuin` (or the configured data dir) still contains session state"],"exampleFix":"// before\natuin account change-password\n// after\natuin login -u myuser\natuin account change-password","handlingStrategy":"validation","validationCode":"# shell: ensure a session exists before changing password\natuin login -u \"$USER\" || { echo 'not logged in'; exit 1; }","typeGuard":null,"tryCatchPattern":"atuin account change-password ... || { echo 'Run atuin login first'; exit 1; }","preventionTips":["Always pair account-management commands with a prior `atuin login` in scripts","Pin ATUIN_HOME/data-dir env vars so session state is found","Check `atuin status`/sync success as a session smoke test"],"tags":["cli","authentication","session"],"backgroundTag":"authentication-required","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"}