deck-sync
Sync deck card lists between local files and Archidekt.
./ritual deck-sync [decks...] --download-changes./ritual deck-sync [decks...] --upload-changesArguments
Section titled “Arguments”| Argument | Description | Required |
|---|---|---|
[decks...] | Deck names to sync (matched case-insensitively, no .md). If omitted, syncs all Archidekt-sourced decks. | No |
Each name is matched case-insensitively with a unique-substring fallback; an ambiguous name is reported and skipped. See List Resolution.
Options
Section titled “Options”| Option | Description |
|---|---|
--download-changes | Pull remote changes from Archidekt into local deck files |
--upload-changes | Push local changes to Archidekt |
One of --download-changes or --upload-changes is required. They cannot be used together.
How It Works
Section titled “How It Works”Prerequisites
Section titled “Prerequisites”You must be signed into Archidekt before syncing:
./ritual login archidektDecks must have been imported from Archidekt (i.e., they have sourceUrl and sourceId in their YAML front matter).
Download Changes (--download-changes)
Section titled “Download Changes (--download-changes)”- Fetches the current deck state from Archidekt
- Compares cards and quantities against the local deck file, per board (Main, Commander, Sideboard, Maybeboard) and by card name
- Applies any differences to the local file, respecting each card’s board:
- New cards are added to the section matching their remote board (e.g. a card in
the Archidekt maybeboard is added to the local
## Maybeboardsection, creating that section if it does not exist). A newly created section is inserted in canonical board order (Commander, Main, Sideboard, Maybeboard) without reordering your existing sections - Removed cards are deleted from the board they were removed from
- Quantity changes are applied in-place within the matching board
- A card that moved between boards on Archidekt is removed from its old board and added to the new one
- New cards are added to the section matching their remote board (e.g. a card in
the Archidekt maybeboard is added to the local
- Records all changes in the deck’s
.changes.mdchangelog. Card names are written quoted, and changes that target a non-main board are annotated with the destination, e.g.Added "Cavern-Hoard Dragon" to MaybeboardorRemoved "Lightning Bolt" from Sideboard - Sets
lastSyncedtimestamp in front matter
Upload Changes (--upload-changes)
Section titled “Upload Changes (--upload-changes)”- Verifies you own the Archidekt deck (skips non-owned decks with a warning)
- Fetches the current Archidekt deck state
- Compares local cards and quantities against the remote state (by card name only, across all boards — see note below)
- Pushes differences to Archidekt via their batch API:
- New cards are resolved by name and added
- Removed cards are set to quantity 0
- Quantity changes are set to the new absolute value
- Sets
lastSyncedtimestamp in front matter
What Is Compared
Section titled “What Is Compared”Sync compares card names and quantities. Downloads additionally respect the board a card lives in (Main, Commander, Sideboard, Maybeboard), so cards land in the right section locally.
The following are intentionally ignored at this time:
- Specific printings (set code, collector number)
- Card finish (foil, etched)
- Labels and categories (beyond mapping to a board)
- Card condition
Note on uploads: uploads ignore board placement. The Archidekt batch API path used here cannot yet target a specific remote board/category, so moving a card between boards locally is not pushed (it would otherwise re-add the card to the default mainboard on Archidekt). Board-aware behavior currently applies to
--download-changesonly.
Front Matter
Section titled “Front Matter”After a successful sync, a lastSynced field is added or updated in the deck’s YAML front matter:
---name: 'My Deck'sourceId: '12345'sourceUrl: 'https://archidekt.com/decks/12345'lastSynced: '2026-04-02T12:00:00.000Z'---Examples
Section titled “Examples”Download changes for a specific deck:
./ritual deck-sync black-panther --download-changesUpload changes for multiple decks:
./ritual deck-sync black-panther oops-all-soldiers --upload-changesSync all Archidekt decks (download):
./ritual deck-sync --download-changes