Docs

Sync and backups

Sync and backups solve different problems. Sync coordinates local and remote state; backups are the rollback path when a human or agent makes a mistake.

Copy this guide

Paste it into Claude, Codex, or OpenClaw for structured context.

Paste this page into your LLM chat for structured context.

When to use this

  • You want to confirm credentials and backend readiness before a real sync.
  • You want a local recovery path before risky mutations or explicit restore work.

What the agent should know

  • Use `sync status` as the preflight step before `sync run`.
  • Never treat sync as a replacement for backups; backup creation and restore are local safety workflows.

Check auth and sync readiness first

Start with auth status and sync status before assuming remote state is safe to touch.

Sync preflight

ankicli --json auth status
ankicli auth login
ankicli --json sync status

Backups are the rollback tool

Use backup commands before risky operations or whenever a human wants a straightforward local recovery point.

Local backup flow

ankicli --json backup status
ankicli --json backup list
ankicli --json backup create

Caveats

The sync backend is standalone for python-anki. Credentials are stored locally through the supported credential store on each platform, not in ~/.ankicli/workspaces/<name>/config.json.

  • Use `sync pull` and `sync push` only when you explicitly want expert-level direction control.
  • Use `backup restore` only when the operator clearly intends a local rollback and understands the safety implications.