Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/invvd/mtg-cheaper-deck/llms.txt

Use this file to discover all available pages before exploring further.

Interactive mode is the middle ground between the web app and the one-shot CLI report. It walks you through your deck one card at a time in the terminal, prints a rich suggestion table for each card, and lets you press a single key to accept or skip — no browser required for the main workflow. Choose it when you are working in a terminal-only environment, want to move through the deck deliberately, or prefer to keep the browser closed until you specifically need to inspect a card image.

Usage

Pass your Moxfield deck URL (or raw deck ID) as the first argument. If you omit it, the tool will prompt you to paste it interactively.
python interactive.py "https://moxfield.com/decks/YOUR-DECK-ID"

Interactive flow

1

Fetch and sync the deck

The tool calls the Moxfield API to download the deck, then runs each card through match_deck_cards() to find the corresponding local database entry. Cards that have no match or no known price are noted and skipped automatically. The commander is always skipped — no replacements are suggested for it. The remaining cards are sorted from most expensive to least expensive, so the highest-impact choices come first.
2

Review each card's suggestion table

For every card that has at least one cheaper alternative, the tool prints a rich table with up to five rows. Each row shows the suggestion number, card name, suggested price, savings percentage, similarity score, and the plain-text reason string. Savings and scores are color-coded (see Score color coding below).
3

Enter a number to replace, Enter to skip, or 'i' to view images

Below each table the prompt reads Elige una opción:. Type the number next to a suggestion and press Enter to accept that replacement. Press Enter (or type 0) to leave the card unchanged and move on. Type i to open a browser-based side-by-side image comparison without leaving the interactive loop (see Card image comparison below). Type q to exit early — the plain-text list is printed before the process ends.
4

Updated deck list printed after each replacement

Every time you accept a replacement, build_plain_text() is called on the current state of the entries list and the result is printed inside a cyan Panel. The list is always ready to copy — you do not need to wait until the end of the session.
5

Final plain-text list at the end

After the last card is reviewed, a ─── Fin del mazo ─── rule is printed, followed by one final copyable deck list that reflects all replacements made during the session.

Card image comparison

Typing i at any prompt calls card_images.open_comparison(local, suggestions). The function:
  1. Builds a self-contained HTML page showing the original card on the left and all suggestions to the right, each with its price, savings percentage, and similarity score as a caption.
  2. Writes the file to ./data/compare.html (relative to the working directory), creating the data/ directory if it does not exist.
  3. Opens the file in your default browser using webbrowser.open().
The browser tab updates each time you press i on a new card — the file is overwritten in place. No images are downloaded locally; every <img> tag points directly to the Scryfall API endpoint for that card’s scryfall_id.

Score color coding

The Puntaje column in the suggestion table is colored based on how functionally similar the candidate is to the original card.
Score rangeColorMeaning
3.0 or aboveBold greenStrong match — candidate shares real mechanics (keywords and/or significant oracle text overlap).
1.5 – 3.0YellowModerate match — some text or CMC similarity, but not a direct functional copy.
Below 1.5WhiteWeak match — mainly shares card type, color identity, and EDHREC popularity.
The same thresholds apply to the Ahorro column: green at ≥ 50 %, yellow at ≥ 20 %, white below 20 %.

Output format

The plain-text list printed after each replacement (and at the end of the session) uses the Commander/Deck format from plain_text.build_plain_text():
Commander
1 Atraxa, Praetors' Voice

Deck
1 Cultivate
1 Swords to Plowshares
...
The Commander section appears first when a commander is present, separated from the Deck section by a blank line. Each line is quantity name with no extra punctuation.
Run python interactive.py on a budget deck the first time to get a feel for the scoring system before you start making replacements on a deck you care about. Budget decks tend to generate suggestions with higher savings percentages and a wider spread of scores, making it easier to understand what a score of 1.0 vs. 3.5 looks like in practice.

Build docs developers (and LLMs) love