Skip to content

list-all-cards

Print a deduplicated, alphabetically sorted manifest of every card in your decks, collections, and wanted lists. Its main job is to serve as a deterministic cache key for CI builds: the output changes only when the set of unique (name, set, collector number) tuples in your lists changes.

The manifest excludes quantities, finishes, conditions, notes, and card IDs. A card that appears in several lists, or with the same printing in different decks, collapses into a single entry.

The command is strictly read-only. It never writes to list files (it is exempt from the card-ID backfill), so running it in CI never dirties the checkout.

Terminal window
ritual list-all-cards [options]
Option Description Default
--out <file> Write the manifest to this file instead of stdout (- means stdout) (stdout)
--output <format> Output format: text, json, or ndjson text
--quiet Suppress the Wrote N cards to <path> confirmation false

Without --out, the manifest is the command’s stdout, so pipe or redirect it wherever you like. With --out, the file is written (parent directories are created as needed) and a Wrote N cards to <path> confirmation is printed instead. A relative path is resolved against the base directory.

text (the default) is the markdown manifest:

# All cards
- Black Lotus (LEA:232)
- Lightning Bolt
- Lightning Bolt (LEA:161)
- Sol Ring (CMR:472)
- Sol Ring (ECC:57)

Each line is a - name (SET:CN) entry. The parenthesized printing is omitted when a card has no set/collector number.

json emits the raw entry array (set codes lowercase; absent fields are omitted):

Terminal window
ritual list-all-cards --output json
[
{ "name": "Black Lotus", "set": "lea", "collectorNumber": "232" },
{ "name": "Lightning Bolt" },
{ "name": "Sol Ring", "set": "cmr", "collectorNumber": "472" }
]

ndjson emits the same entries one JSON object per line. --out writes whichever format was selected to the file.

A list file that cannot be read or parsed (for example a deck with broken YAML front matter) does not abort the run. The file is skipped, a warning: skipped <file>: <reason> line goes to stderr, the manifest is still emitted from the remaining files, and the command exits 1 so CI can tell the manifest is incomplete.

Non-fatal parser warnings (a malformed card line, prose, or a comment inside an otherwise readable file) also go to stderr but do not affect the exit code. The manifest is still deterministic over the lines that did parse.

Code Meaning
0 Success
1 One or more files were skipped (manifest incomplete), or the write failed
2 Usage error (e.g. an invalid --output format)

The generated GitHub Actions workflow uses this file as the cache key for the Scryfall data cache:

- name: Generate card manifest
run: ./ritual list-all-cards --out all-cards.md
- name: Restore Scryfall cache
uses: actions/cache@v5
with:
path: cache/
key: ritual-cache-${{ hashFiles('all-cards.md') }}

The cache is reused across builds whenever the set of cards in your lists hasn’t changed, even if you change finishes, conditions, notes, or quantities, or move existing cards between files.

all-cards.md is added to the .gitignore generated by ritual init-site. You don’t need to commit it.

Print the manifest to stdout:

Terminal window
ritual list-all-cards

Write the CI cache-key file:

Terminal window
ritual list-all-cards --out all-cards.md

Feed the unique cards to a script:

Terminal window
ritual list-all-cards --output ndjson | jq -r .name | sort -u

Use with --base-dir:

Terminal window
ritual --base-dir ~/mtg list-all-cards