sync
Copy AnkiWeb API data into a local SQLite database for offline search and analysis, with incremental refreshes and selectable resources.
Instructions
Sync API data to local SQLite for offline search and analysis
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csv | No | Output as CSV (table and array responses) (default: false) | |
| yes | No | Skip confirmation prompts (explicit confirmation for scripts) (default: false) | |
| full | No | Full resync (ignore previous checkpoint) (default: false) | |
| json | No | Output as JSON (default: false) | |
| agent | No | Set agent-friendly output defaults (--json --compact --no-input --no-color) (default: false) | |
| param | No | Extra query param to inject into flat-list sync requests (repeatable, key=value). Skipped on path-scoped dependent requests so a top-level scope like workspace=<id> does not double up on /parents/<id>/children calls. Use --global-param to inject everywhere. Avoid pagination keys (limit/since/cursor) — overriding them corrupts resume state. | |
| plain | No | Output as plain tab-separated text (default: false) | |
| quiet | No | Bare output, one value per line (default: false) | |
| since | No | Incremental sync duration (e.g. 7d, 24h, 1w, 30m) | |
| select | No | Comma-separated fields to include in output (e.g. --select id,notetype_id,deck_id) | |
| strict | No | Exit non-zero on any per-resource failure (default: only critical failures or all-resource failure exit non-zero). (default: false) | |
| compact | No | Return only key fields (id, name, status, timestamps) for minimal token usage (default: false) | |
| dry-run | No | Show request without sending (default: false) | |
| max-age | No | Maximum acceptable age of local-store data before a stderr hint suggests sync; 0 disables (default: 30m0s) | |
| receipt | No | Write an atomic private run receipt (default: false) | |
| timeout | No | Request timeout (default: 1m0s) | |
| no-cache | No | Bypass response cache (default: false) | |
| no-color | No | Disable colored output (default: false) | |
| no-input | No | Disable all interactive prompts (for CI/agents) (default: false) | |
| no-learn | No | Disable the teach/recall learning loop for this invocation (default: false) | |
| no-prune | No | Disable deletion reconciliation on --full (by default a full sync prunes local rows the API no longer returns after a complete walk) (default: false) | |
| max-pages | No | Maximum pages to fetch per resource (0 = unlimited; cap-hit emits a sync_warning event) (default: 0) | |
| resources | No | Comma-separated resource types to sync. Naming a parent also runs its parent-keyed dependents (see Long help for scoping). | |
| idempotent | No | Treat already-existing create results as a successful no-op (default: false) | |
| rate-limit | No | Max requests per second (0 to disable; default auto — pace to server rate-limit headers) (default: auto) | |
| concurrency | No | Number of parallel sync workers (default: 4) | |
| data-source | No | Data source for read commands: auto (live with local fallback), live (API only), local (synced data only) (default: auto) | |
| latest-only | No | Refresh head of each resource only; clears resume cursor and caps pages at 1. Mutually exclusive with --since (--since wins). (default: false) | |
| global-param | No | Extra query param to inject into every sync request including dependent path-scoped calls (repeatable, key=value). Use when an API requires a scope on every call regardless of path nesting. | |
| client-profile | No | Select the tenant-gated client profile (env: ANKIWEB_CLIENT_PROFILE) | |
| human-friendly | No | Enable colored output and rich formatting (default: false) | |
| resource-param | No | Per-resource extra query param (repeatable, resource:key=value). Wins over --param and --global-param when keys conflict. | |
| allow-partial-failure | No | Downgrade response-body partial-failure (e.g. partialFailureError) to a warning instead of a non-zero exit (default: false) |