Skip to content

deck

Interactively build a deck by adding cards to named sections. This is the deck-building counterpart to the collection and wanted managers: it shares the same name/collector entry modes, session filters, and menu actions, and adds deck-specific section targeting.

Terminal window
./ritual deck [options]
FlagDescription
-s, --sets <codes>Filter by set codes (comma-separated, e.g., "FDN, SPG")
-f, --finish <finish>Default finish: nonfoil, foil, or etched
-c, --condition <condition>Default condition: NM, LP, MP, HP, or DMG
--section <name>Add every card to this section (otherwise you are prompted)
--collectorStart in collector number mode
--allow-digital-only-cardsInclude digital-only sets (e.g., Alchemy) in results

When --section is omitted, the target section defaults to “prompt every time”: you choose a section (or create one) for each card. You can change the target section at any time from the menu or via ⚙️ Configure Session Filters.

On startup you select an existing deck or create a new one. Existing decks are listed by their display name (the name: front matter field), not their slugified file name, sorted alphabetically. A new deck is created with the same YAML front matter as new-deck (display name preserved, file name slugified, default commander format).

The following options are available in the menu when no search text is typed:

OptionDescription
💾 Save N change(s) (keep editing)Write the deck file and changelog without leaving the session
🚪 ExitLeave the session (asks to save, discard, or cancel when unsaved)
🗂️ Set Target SectionPin a section, create a new one, or prompt for each card
⚙️ Configure Session FiltersAdjust default sets, finish, condition, and target section
🔢 Switch to Collector Number ModeSwitch to collector number entry mode
📦 Manage Set CodesAdd, remove, or switch active sets (collector mode)
🔤 Switch to Name ModeSwitch back to name entry mode (collector mode)
🛠️ Switch to Edit ModeBrowse and edit the deck’s existing lines (see Edit Mode)
➕ Add Another CopyIncrement the quantity of the last added card
📝 Add NoteAttach a note to the last added card
✏️ Edit Previous CardRe-pick the printing/finish/condition for the last card
↩️ Undo Last AddTake back the most recently added card
↩️ Undo Last EditRevert the most recent edit-mode operation
📋 View Session Changes (N)Review every change this session and optionally discard individual ones

The ↩️ Undo Last Add option appears only after you have added at least one card this session, and 📋 View Session Changes once the session has any change to show. The viewer lists everything done this session — adds, edits, and removals — and selecting an entry offers to discard just that change (see Reviewing Session Changes).

Like the admin Deck Editor, the session keeps every change in memory until you save: nothing is written to the deck file as you add or edit cards. 💾 Save writes the file and appends the session changelog while you keep working (everything saved this way is committed — the undo and discard menus reset). 🚪 Exit leaves the session: with unsaved changes it opens a menu to Save and exit, Exit without saving (throws away all unsaved changes), or Cancel (keep editing). Pressing Esc/Ctrl-C at the main prompt behaves like 🚪 Exit.

Every card is added under a ## Section Name (H2) header. The target section controls where new cards land:

  • Prompt every time (default) — you pick an existing section or create a new one per card.
  • A pinned section — set with --section, the 🗂️ Set Target Section menu, or the session filters. All subsequent cards go there until you change it.

Adding a card whose printing already exists anywhere in the deck increments that entry’s quantity instead of creating a new line (matching the admin Deck Editor and the add-card command). A different printing of the same card is kept as its own entry.

Like the collection manager, the deck manager supports two entry modes you can toggle during a session:

Autocomplete-driven card name entry. Session filters (sets, finish, condition) are applied automatically; append ! to a card name to force the finish/condition prompts for that entry. If no printings can be found for a chosen card, it is added name-only rather than dropped.

Look up cards by collector number within one or more loaded sets, managed via 📦 Manage Set Codes.

🛠️ Switch to Edit Mode repurposes the search prompt: instead of the card database, it autocompletes over the deck’s existing lines (e.g. 2 Sol Ring (C19:221) — Main &5). Selecting a line opens an action menu:

ActionDescription
🖼️ Change PrintingPick a new printing, finish, and condition for the line
➕ Add a CopyIncrement the line’s quantity
➖ Remove a CopyDecrement the line’s quantity (multi-copy lines only); keeps the &N id
🗂️ Move to SectionMove the line to another section (or a new one)
📝 Edit NoteEdit or clear the line’s note
🗑️ Remove CardDelete a single-copy line (asks for confirmation); releases its &N id
🗑️ Remove All Copies (N)Delete all N copies of a multi-copy line (asks for confirmation); releases the id

Every edit is undoable with ↩️ Undo Last Edit (a linear stack, newest first); undoing a full-line removal restores the line with its original &N id when the id has not been reused. Edits are folded into the session changelog with “latest wins” semantics — changing a line and then changing it back leaves no changelog entry. Removing copies that were added this session simply cancels their adds. ➕ Switch to Add Mode returns to the regular add flow; you can toggle between the two modes freely within one session.

📋 View Session Changes opens a picker listing every change made this session — copy adds, ✏️ field edits (printing, section, note), and 🗑️ removals. Selecting an entry asks whether to discard that change, reverting just it while keeping the rest of the session intact:

  • Discarding an add cancels that copy (decrementing or removing the line). When the discard fully removes a line first created this session, its &N id is freed and the remaining session-added lines keep dense, in-order ids (each later line slides down one, and the highest id returns to the pool). Because the re-pack renumbers ids, it also clears the edit-undo history. Decrementing a multi-copy line keeps its id.
  • Discarding an edit or removal reverts that operation in place. When several changes touch the same line, they must be discarded newest-first — older ones are blocked until the newer change is discarded (the picker tells you which one).

Everything already saved with 💾 Save is committed and no longer appears in the viewer.

Cards are written to a markdown deck file in the decks/ directory under their section headers:

---
name: "Winota Stax"
format: "commander"
---
## Commander
1 Winota, Joiner of Forces (IKO:215) &1
## Main
1 Sol Ring (LTC:284) &2
4 Lightning Bolt (LEA:161) &3

The leading number is the card quantity. Non-foil finish and NM condition are omitted for brevity. The &N suffix is a persistent card ID used internally for change tracking and is auto-assigned. Decrementing a quantity keeps the ID; only removing the whole line releases it.

Start the deck manager:

Terminal window
./ritual deck

Add everything to a specific section without per-card prompts:

Terminal window
./ritual deck --section Sideboard

Start in collector number mode with sets pre-loaded:

Terminal window
./ritual deck --collector --sets "FDN, SPG"