{"record":{"id":"297aeb127f362f0f","repo":"atuinsh/atuin","slug":"you-are-not-logged-in-297aeb","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/delete.rs","lineNumber":21,"sourceCode":"use clap::Parser;\nuse eyre::{Result, bail};\n\nuse super::login::{or_user_input, read_user_password};\n\n#[derive(Parser, Debug)]\npub struct Cmd {\n    #[clap(long, short)]\n    pub 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 password = self.password.clone().unwrap_or_else(read_user_password);\n\n        if password.is_empty() {\n            bail!(\"please provide your password\");\n        }\n\n        let mut totp_code = self.totp_code.clone();\n\n        loop {\n            let response = client.delete_account(&password, totp_code.as_deref()).await?;\n\n            match response {\n                MutateResponse::Success => break,\n                MutateResponse::TwoFactorRequired => {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/atuinsh/atuin/blob/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin/src/command/client/account/delete.rs#L3-L39","documentation":"`atuin account delete` checks `settings.logged_in().await?` before constructing an authenticated client. If this machine has no saved login session in the meta store, the command bails with this message because account deletion requires server authentication.","triggerScenarios":"Running `atuin account delete` on a machine where `atuin login` was never executed, after logging out, or in an environment with a different/empty ATUIN_CONFIG_DIR that has no session token stored.","commonSituations":"Fresh CI containers or Docker images where config was not carried over; switching users or config dirs; trying to delete an account from a second machine that was never logged in.","solutions":["Run `atuin login` with the account credentials, then retry `atuin account delete`","Confirm ATUIN_CONFIG_DIR points at the directory containing your session","Re-login to restore a session that was cleared or expired","Delete the account via the web dashboard if local login is not possible"],"exampleFix":"// before (fails when not logged in)\natuin account delete\n\n// after\natuin login\natuin account delete","handlingStrategy":"validation","validationCode":"atuin status >/dev/null 2>&1 || { echo 'Not logged in: run `atuin login` first'; exit 1; }","typeGuard":null,"tryCatchPattern":"if ! atuin account delete ...; then\n  echo \"Not logged in or wrong config dir — run 'atuin login' first\" >&2\nfi","preventionTips":["Log in before running destructive account commands","Keep ATUIN_CONFIG_DIR consistent across automation","Confirm the target account before deletion","Guard scripts with a login-state check"],"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-14T05:17:10.506Z"}