Skip to content

card

Look up a single card by name using Scryfall.

Terminal window
./ritual card [name] [options]
ArgumentDescriptionRequired
[name]Card name to search forConditional (required unless using --stdin or --from-file)
OptionDescription
--fuzzyUse fuzzy matching instead of exact
--set <code>Filter by set code
--stdinRead card names from stdin (one per line)
--from-file <path>Read card names from a file (one per line)
--fields <list>Comma-separated fields for json/ndjson output
--output <format>Output format (json, ndjson, or text)

card registers no --quiet: everything it prints is either a card or an error, so there would be nothing for the flag to suppress (shared convention).

--stdin and --from-file look up every name in the input. The output shape depends only on the flag you passed, never on how many lines the input happened to hold:

  • --output json (the default) emits one JSON array of cards for the whole batch — the same contract scry gives a multi-page search. A run where some lookups failed still emits the cards that were found (the failures go to stderr and set the exit code), and a run where all of them failed emits []. A single-name lookup, batch or not, emits a bare card object.
  • --output ndjson streams one JSON object per card as it arrives — the opt-in streaming mode for large inputs.
  • --output text prints one Name (SET) line per card.

Look up a card by exact name:

Terminal window
./ritual card "Sol Ring"

Use fuzzy matching for approximate names:

Terminal window
./ritual card "sol rng" --fuzzy

Look up a specific printing by set:

Terminal window
./ritual card "Lightning Bolt" --set lea

Get plain text output:

Terminal window
./ritual card "Sol Ring" --output text

Batch lookup from stdin as one JSON array:

Terminal window
printf "Sol Ring\nArcane Signet\n" | ./ritual card --stdin --output json

Stream a large batch as NDJSON instead:

Terminal window
./ritual card --from-file cards.txt --output ndjson --fields name,set,prices.usd
CodeMeaning
0All requested cards were found and printed
1Request failure (network error or a Scryfall server error)
2Usage error (missing card name, --stdin with --from-file, invalid fields)
3Not found (a card does not exist, or the --from-file file could not be read)

In batch mode each failure is reported individually; if both a request failure and a not-found occur, the exit code is 1.