USE WHEN: checking card ownership, importing collections, searching collection by type/color/cmc/text, checking deck ownership, exporting collection, adding cards, enhancing collection metadata. COVERS: all collection commands, search syntax, import/export formats, integration with deck building.
The collection system tracks physical Magic card collection and checks deck ownership.
Location: collection/user-collection.json - JSON with counts, conditions, foil status, pricing, metadata
{
"cards": [
{
"name": "Lightning Bolt",
"edition": "M21",
"collector_number": "123",
"conditions": [
{
"condition": "near_mint",
"count": 4,
"tradelist_count": 0,
"foil": false,
"language": "English",
"tags": "burn",
"last_modified": "2023-01-15",
"purchase_price": 1.5
}
],
"total_count": 4,
"total_tradelist_count": 0
}
],
"last_updated": "2025-11-30T20:06:20.135Z",
"total_cards": 11,
"unique_cards": 5
}
Import (supports CSV from Moxfield/Archidekt and text formats):
npm run collection import ~/Downloads/my-collection.csvnpm run collection import --file <path>Analysis:
npm run collection stats - Collection statistics (total cards, unique, value breakdown)npm run collection find "Card Name 1" "Card Name 2" - Find specific cardsAdding cards:
npm run collection add "Card Name" - Add single card (qty 1)npm run collection add "Card Name" --count 4 - Add multiple copiesEnhancing metadata (REQUIRED before searching):
npm run collection:enhance - Add Scryfall metadata (colors, oracle_text, type_line, cmc)Searching (requires collection:enhance first):
npm run collection:search-type vampire - Search by creature typenpm run collection:search-colors G U - Green OR blue cards (space-separated!)npm run collection:search-cmc 3 - Search by CMCnpm run "collection:search-cmc" -- 2 --range 4 - CMC 2-4 rangenpm run collection:search-text "sacrifice" - Search oracle textnpm run collection:search-name "bolt" - Search card names⚠️ Search syntax:
npm run collection:search-colors G U (space-separated)npm run collection:search-colors "G,U" (wrong - treats as single string)Deck ownership:
npm run collection check-deck <deck-file> - Check owned vs needednpm run collection check-deck <deck-file> --missing-only - Show only missingExport:
npm run collection export --format csv --output filename.csvnpm run collection export --format moxfield --output filename.txtnpm run collection export --format json --output filename.jsonManagement:
npm run collection clear --confirm - Clear collectionnpm run collection help - Show all commandsCSV (Moxfield/Archidekt export), simple text (4 Card Name), or plain list (assumes qty 1)
ALWAYS check collection ownership when:
npm run collection check-deck <deck-file> - See ownership status