{"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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/sync/status.rs","lineNumber":11,"sourceCode":"use atuin_client::api_client;\nuse atuin_client::settings::Settings;\nuse atuin_common::time::DurationExt;\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":29,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/sync/status.rs#L1-L29","documentation":"`atuin sync status` requires an authenticated session with a sync server. If settings indicate the user is not logged in (no token/identity), the command bails early because it cannot query sync state.","triggerScenarios":"Running `atuin sync status` before ever running `atuin register` or `atuin login`, or after the local key/session was removed.","commonSituations":"Fresh machine without importing the atuin key, cleared config directory, or a CI/environment where atuin was never registered.","solutions":["Run `atuin register` to create an account or `atuin login` with existing credentials","Import your atuin key (`atuin key` output from the old machine) and log in","Skip `sync status` when offline/not registered - guard scripts with a login check"],"exampleFix":"// before\natuin sync status   # fails when not logged in\n// after\natuin login -u <username> && atuin sync status","handlingStrategy":"try-catch","validationCode":"if !settings.logged_in().await? {\n    eprintln!(\"skipping: not logged in\");\n    return Ok(());\n}\n","typeGuard":null,"tryCatchPattern":"match atuin_sync_status().await {\n    Err(e) if e.to_string().contains(\"not logged in\") => eprintln!(\"not logged in, skipping\"),\n    other => other?,\n}\n","preventionTips":["Run `atuin register`/`atuin login` before scripting sync commands","Back up and restore ~/.local/share/atuin/key when migrating machines"],"tags":["cli","sync","auth"],"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"}