{"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":"validation","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/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin/src/command/client/account/change_password.rs#L5-L41","documentation":"atuin's `account change-password` command refuses to run when the local settings indicate the user has no saved login session. Before creating an authenticated client, `Cmd::run` calls `settings.logged_in().await?`; if no session token exists on this machine, it bails with this message instead of making a doomed API call. It is a pre-flight guard, not a server rejection.","triggerScenarios":"Running `atuin account change-password` (with or without --current-password/--new-password flags) on a machine where `atuin login` was never run, where the session was removed from the meta store, or where a fresh/blank ATUIN_CONFIG_DIR points at a meta store with no session token.","commonSituations":"CI containers that mount config but never logged in; switching ATUIN_CONFIG_DIR/ATUIN_SESSION so the session is invisible; running the command on a second machine synced only via a record store without a login; after logging out.","solutions":["Run `atuin login` with your username/password first, then retry the password change","Verify you are using the intended config directory (check ATUIN_CONFIG_DIR) so the saved session is actually found","If you believed you were logged in, re-login to refresh a stale/removed session token","Use the web/dashboard to change the password if you cannot log in on this machine"],"exampleFix":"// before (fails when not logged in)\natuin account change-password\n\n// after\natuin login\natuin account change-password","handlingStrategy":"validation","validationCode":"# shell pre-check\natuin status >/dev/null 2>&1 || { echo 'Not logged in: run `atuin login` first'; exit 1; }","typeGuard":null,"tryCatchPattern":"if ! atuin account change-password ...; then\n  echo \"Not logged in — run 'atuin login' and retry\" >&2\nfi","preventionTips":["Run `atuin login` as part of machine setup before any account commands","Pin ATUIN_CONFIG_DIR explicitly so scripts always find the session","Check login state with `atuin status` before scripted account operations","Avoid logging out in shared automation environments"],"tags":["cli","auth","session"],"backgroundTag":"authentication-required","analyzedSha":"c0c717ab04c881764bcad4b3d169a507e2432643","analyzedAt":"2026-09-12T07:40:01.341Z","contentChangedAt":"2026-09-12T07:40:01.341Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}