No description
This repository has been archived on 2025-11-09. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2025-11-09 20:41:24 +01:00
cmd feat: add CLI capabilities with extract command 2025-07-14 21:52:32 +02:00
database ♻️ refactor: major codebase simplification and restructuring 2025-07-25 11:34:51 +02:00
db ♻️ refactor: major codebase simplification and restructuring 2025-07-25 11:34:51 +02:00
generated ♻️ refactor: major codebase simplification and restructuring 2025-07-25 11:34:51 +02:00
models ♻️ refactor: major codebase simplification and restructuring 2025-07-25 11:34:51 +02:00
ui card to decks/collection navigation 2025-11-09 20:39:01 +01:00
utils gofmt 2025-07-16 07:16:21 +02:00
.envrc card to decks/collection navigation 2025-11-09 20:39:01 +01:00
.gitignore card to decks/collection navigation 2025-11-09 20:39:01 +01:00
AGENTS.md card to decks/collection navigation 2025-11-09 20:39:01 +01:00
flake.lock init 2025-07-14 21:16:00 +02:00
flake.nix init 2025-07-14 21:16:00 +02:00
go.mod feat: add CLI capabilities with extract command 2025-07-14 21:52:32 +02:00
go.sum feat: add CLI capabilities with extract command 2025-07-14 21:52:32 +02:00
LICENSE LICENSE 2025-07-15 14:24:54 +02:00
main.go feat: add CLI capabilities with extract command 2025-07-14 21:52:32 +02:00
NAVIGATION_FEATURE_DOCS.md card to decks/collection navigation 2025-11-09 20:39:01 +01:00
README.md 📝docs: add deprecation notice and link to new repository in README 2025-11-09 20:41:24 +01:00

MTG Deck Manager

THIS REPOSITORY WILL NOT GET MORE UPDATES. CURRENTLY REWRITTING FROM SCRATCH ON https://forgejo.fairlabs.dev/ferrumboll/taplands

A terminal-based Magic: The Gathering deck management application built with Go and Bubble Tea.

Features

  • Card Search: Search through the entire MTG card database
  • Deck Management: Create, edit, and manage multiple decks
  • Collection Management: Organize your card collection
  • Commander Support: Full support for Commander/EDH deck building
  • Standard Format: Support for Standard format deck building
  • Card Previews: Detailed card information with mana costs, text, and artwork info
  • Terminal UI: Beautiful terminal interface with keyboard navigation
  • Contextual Navigation: Seamlessly add cards to collections/decks from their card view

Installation

Prerequisites

  • Go 1.21 or higher
  • SQLite3

Build from Source

Clone the repository

git clone cd mtg-deck-manager

Install dependencies

go mod download

Build the application

go build -o mtg-deck-manager ./cmd/main.go

Usage

On first run, the application will download the MTG card database (~80MB) from mtgjson.com. This is a one-time process.

Navigation

  • Main Menu: Use ↑/↓ arrow keys to navigate, Enter to select
  • Search: Press 'f' or '/' to start searching for cards
  • Collections: Press 'a' to add selected card to a collection
  • Decks: Press 'd' to add selected card to a deck

Contextual Card Addition Workflow

The application supports a seamless workflow for adding cards to collections and decks:

  1. View Collection/Deck: Navigate to a collection or deck and press Enter to view its cards
  2. Add More Cards: While viewing cards, press Enter to search for more cards to add
  3. Direct Addition: In the search view, press Enter on any card to add it directly to the source collection/deck
  4. Auto-Return: After adding a card, you're automatically returned to the collection/deck view
  5. Updated View: The collection/deck view refreshes to show your newly added card

This workflow eliminates the need to manually select collections/decks when adding cards, making deck building faster and more intuitive.

Keyboard Shortcuts

Global

  • q or ctrl+c: Quit application or return to previous screen
  • ↑/k: Move cursor up
  • ↓/j: Move cursor down
  • Enter: Select item

Navigation

  • Main Menu: Use ↑/↓ arrow keys to navigate, Enter to select
  • Search: Press 'f' or '/' to start searching for cards
  • Collections: Press 'a' to add selected card to a collection
  • Decks: Press 'd' to add selected card to a deck

Search Mode

  • f or /: Start searching
  • a: Add card to collection (when not navigated from a collection)
  • d: Add card to deck (when not navigated from a deck)
  • Enter: Add card to source collection/deck (when navigated from collection/deck view)
  • q: Return to source view

Note: When you navigate to search from a collection or deck, the help text at the bottom shows which collection/deck cards will be added to. For example: "Enter to add to My Collection"

Deck Management

  • n: Create new deck
  • e: Edit deck name
  • t: Edit deck type
  • d: Delete deck
  • Enter: View deck contents
    • When viewing cards: Press Enter to search and add more cards
    • ←/→: Adjust card quantity
    • d: Remove card from deck

Collection Management

  • n: Create new collection
  • e: Edit collection name
  • d: Delete collection
  • Enter: View collection contents
    • When viewing cards: Press Enter to search and add more cards
    • ←/→: Adjust card quantity
    • d: Remove card from collection

Deck Types

Standard

  • Minimum 60 cards
  • Maximum 4 copies of any card (except basic lands)
  • 15-card sideboard (optional)

Commander

  • Exactly 100 cards
  • Only 1 copy of any card (except basic lands)
  • Must have a legendary creature as commander
  • Color identity restrictions apply

Database

The application uses two SQLite databases:

  • MTG Database: Contains all MTG card information (downloaded from mtgjson.com)
  • User Database: Stores your collections and decks

Development

Project Structure

├── cmd/ # Application entry point ├── database/ # Database layer │ ├── config/ # Database configuration │ ├── generated/ # Auto-generated database models │ ├── mtg_db/ # MTG card database operations │ └── user_db/ # User data operations ├── run_models/ # Runtime data models ├── ui/ # Terminal user interface └── utils/ # Utility functions

Adding New Features

  1. Database Changes: Update migrations in database/migrations/
  2. Models: Add new models in run_models/
  3. UI: Create new UI components in ui/
  4. Database Operations: Add new queries in database/user_db/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License

  • see the LICENSE file for details.

Acknowledgments

  • MTGJSON for providing the card database
  • Bubble Tea for the terminal UI framework
  • Jet for SQL query generation