{"record":{"id":"6c0dfd34574b3af3","repo":"atuinsh/atuin","slug":"you-are-not-logged-in-to-a-sync-server-cannot-sh","errorCode":null,"errorMessage":"You are not logged in to a sync server - cannot show sync status","messagePattern":"You are not logged in to a sync server - cannot show sync status","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/sync/status.rs","lineNumber":10,"sourceCode":"use atuin_client::api_client;\nuse atuin_client::settings::Settings;\nuse colored::Colorize;\nuse eyre::{Result, bail};\n\nuse crate::{SHA, VERSION};\n\npub async fn run(settings: &Settings) -> Result<()> {\n    if !settings.logged_in().await? {\n        bail!(\"You are not logged in to a sync server - cannot show sync status\");\n    }\n\n    let caps = api_client::caps_client(settings)?;\n    let client = api_client::Client::new(\n        settings.sync_address.clone(),\n        &settings.sync_auth_token().await?,\n        settings.network_connect_timeout,\n        settings.network_timeout,\n        &settings.extra_headers,\n        caps,\n    )?;\n\n    let me = client.me().await?;\n    let last_sync = Settings::last_sync().await?;\n\n    println!(\"Atuin v{VERSION} - Build rev {SHA}\\n\");\n\n    println!(\"{}\", \"[Local]\".green());","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/atuinsh/atuin/blob/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin/src/command/client/sync/status.rs#L1-L28","documentation":"`atuin sync status` reports this machine's sync state against the server, which requires credentials. If `settings.logged_in()` returns false (no recorded auth token / login), the command bails instead of querying an unauthenticated API. It's a precondition check, not a network failure.","triggerScenarios":"Running `atuin sync status` before ever running `atuin login` or `atuin register`, or after being logged out / credentials wiped.","commonSituations":"Fresh machine or new home directory without `~/.local/share/atuin` credentials, clearing config while keeping data, or running sync commands in CI before authenticating.","solutions":["Log in first: `atuin login -u <username>` (or register with `atuin register`).","Verify login state with `atuin status` / `atuin doctor`.","If credentials were wiped but you have a key file, restore it and re-login.","In scripts/CI, guard with a logged-in check before invoking `atuin sync status`."],"exampleFix":"// before\natuin sync status   # fails: not logged in\n// after\natuin login -u myuser\natuin sync status","handlingStrategy":"validation","validationCode":"# shell\natuin status 2>/dev/null || { echo \"not logged in; run 'atuin login'\" >&2; exit 1; }\natuin sync status","typeGuard":null,"tryCatchPattern":"if ! atuin sync status 2>&1 | grep -q 'not logged in'; then\n  : # status output\nelse\n  atuin login -u \"$ATUIN_USER\"\nfi","preventionTips":["Always `atuin login`/`atuin register` on new machines before sync commands.","In CI, provision credentials (ATUIN_* env vars or key file) before calling sync commands.","Check login state with `atuin doctor` in setup scripts."],"tags":["cli","authentication","sync"],"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"}