atuinsh/atuin · error

You are not logged in to a sync server - cannot show sync st

Error message

You are not logged in to a sync server - cannot show sync status

What it means

`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.

Source

Thrown at crates/atuin/src/command/client/sync/status.rs:10

use atuin_client::api_client;
use atuin_client::settings::Settings;
use colored::Colorize;
use eyre::{Result, bail};

use crate::{SHA, VERSION};

pub async fn run(settings: &Settings) -> Result<()> {
    if !settings.logged_in().await? {
        bail!("You are not logged in to a sync server - cannot show sync status");
    }

    let caps = api_client::caps_client(settings)?;
    let client = api_client::Client::new(
        settings.sync_address.clone(),
        &settings.sync_auth_token().await?,
        settings.network_connect_timeout,
        settings.network_timeout,
        &settings.extra_headers,
        caps,
    )?;

    let me = client.me().await?;
    let last_sync = Settings::last_sync().await?;

    println!("Atuin v{VERSION} - Build rev {SHA}\n");

    println!("{}", "[Local]".green());

View on GitHub (pinned to c0c717ab04)

Solutions

  1. Log in first: `atuin login -u <username>` (or register with `atuin register`).
  2. Verify login state with `atuin status` / `atuin doctor`.
  3. If credentials were wiped but you have a key file, restore it and re-login.
  4. In scripts/CI, guard with a logged-in check before invoking `atuin sync status`.

Example fix

// before
atuin sync status   # fails: not logged in
// after
atuin login -u myuser
atuin sync status
Defensive patterns

Strategy: validation

Validate before calling

# shell
atuin status 2>/dev/null || { echo "not logged in; run 'atuin login'" >&2; exit 1; }
atuin sync status

Try / catch

if ! atuin sync status 2>&1 | grep -q 'not logged in'; then
  : # status output
else
  atuin login -u "$ATUIN_USER"
fi

Prevention

When it happens

Trigger: Running `atuin sync status` before ever running `atuin login` or `atuin register`, or after being logged out / credentials wiped.

Common situations: Fresh machine or new home directory without `~/.local/share/atuin` credentials, clearing config while keeping data, or running sync commands in CI before authenticating.

Related errors


AI-assisted analysis of atuinsh/atuin@c0c717ab04 (2026-09-12). Data as JSON: /api/errors/6c0dfd34574b3af3. Report an issue: GitHub.