For many players of Magic: the Gathering, keeping tabs on their ever-expanding collection of cards can seem like a herculean task. Not only may they want to remember what cards are in which deck, they may also want to keep an eye on their “spare” or unused cards, for future deck-building and theorycrafting. Everyone has their own system, be it boxes filled with random cards, meticulously-organized binders, or anything in between.

This is where websites like Moxfield.com come into play; it’s a single place where players can store information about their collection, keep track of their wish lists, and share their deck builds with one another for advice. It has a huge user base and is a great way to both plan future purchases and keep track of what exactly is in one’s collection and where it is stored located—be it in a deck, in a particular binder, however a player organizes their cards.

Magic has a huge online community, particularly within sanctioned programs like MTG Arena or MTG Online, but other, “alternative” ways to play online also exist. One such platform is called Cockatrice, a free software platform where players are not limited to using cards they physically or virtually own; they can build decks using any card from any era of Magic‘s history, no matter how new, how old, how rare, or how expensive it may be.

Often players on Cockatrice will want to playtest decks they’ve built in the real world, or play decks they’ve theorycrafted, but the process for adding new decks and cards to those decks can be laborious within that software. If only there were a way to connect the decks already built within Moxfield to Cockatrice, so they can be kept in sync, and also new decks can be automatically imported!

But wait, there is?

Enter Moxtrice, an open-source software package that can download Commander decks from Moxfield and automatically convert them into a format that Cockatrice reads, meaning any updates—either as a deck is edited or new decks are added—are swiftly and seamlessly reflected in the play area.

Several of my friends have expressed interest in having this type of syncing set up, and so rather than walk each through the process, I thought I’d create this blog entry and help a wider range of players who may be interested in the same thing. This post is not a guide on how to configure or use Cockatrice, or how to manage decks within Moxfield, but it will help you set everything up so the two platforms talk to one another.

First, some “ground rules”

Neither the author of this post nor the site on which it appears is promoting copyright infringement, trademark violation, or any other breach of legal statute. I do not believe Wizards of the Coast has given their blessing to Cockatrice or other such programs, and this blog post is not the place for me to speculate on the same. I am not your lawyer, don’t break the law, and this post is presented for informational and entertainment purposes only.

Next, getting the sync between Moxfield and Cockatrice involves the installation of software on your computer, namely the Python scripting language and the Moxtrice tool itself. It is up to you to decide whether or not to install these software packages, and neither the author of this post nor the site on which it appears is responsible for any use or misuse of said software packages. The above paragraph is asking WOTC not to sue me, this paragraph is asking you not to sue me. I’m not associated with any of these software packages in any way and cannot provide technical support for any of them.

And finally, the rest of this post assumes you have both an account on Moxfield (or at least an account you want to pull the decks from) and already have Cockatrice setup and running. Because some of the following instructions need to be entered on the command line, I will use %COCKATRICE% as a shortcut for “whatever directory Cockatrice is installed in”.

It’s time to code—be not afraid!

Because the code that makes Moxtrice work uses the Python scripting language, we have to make sure your computer can understand this language in order to run the code. Head over to Python.org and hover over the “Downloads” menu, selecting the proper installer for your computer system. Linux users likely already have Python installed, or can get it directly through their distribution’s respective package manager. Grab the latest release (the one at the top of the page), and install it.

Next, open a command prompt. On Windows you can open the Start Menu and type cmd, while on Mac and Linux you would open a Terminal window to do the same. Type the following command, which tells your computer to install Moxtrice, using the Python code language you just installed: pip install moxtrice git+https://github.com/fecet/moxtrice.git

Don’t worry, we’re almost done with the command line!

Now, in order to grab the correct decks, we need to tell Moxtrice how to find them. Type the following to create the configuration file, replacing {YOURNAME} with your Moxfield user name: moxtrice --config.username {YOURNAME}

This will create a file called .moxtrice.yml in your home directory (C:\Users\Username in Windows and /home/Username in Mac/Linux), which contains directions for Moxtrice; namely, which decks to keep updated and which users to pull decks from.

At this point we just have to run Moxtrice any time we want to sync everything from Moxfield into Cockatrice. Run the following command, replacing %COCKATRICE% with the directory you installed it in: moxtrice --deckpath "%COCKATRICE%/data/decks"

This command pulls the decks previously defined in the configuration file into a format that Cockatrice can understand, and puts them directly into the default Cockatrice decks directory. Reload Cockatrice and all your decks will be available for loading!

Run the above command any time you want to re-sync your decks and everything will stay up to date.

Advanced Tricks

Looking at the format of the .moxtrice.yml file, it provides a lot of flexibility. Perhaps you don’t want to pull all of your public decks, or perhaps you would like to get the decks of a different user. Luckily, moxtrice makes that very easy. The Usage section of its github repo provides some options and reasonable explanations of how to use the file. Put simply, list any users from whom you want to pull all of their decks, and list any codes for single decks you want to keep updated. This is a great way to not have a cluttered deck list in Cockatrice while still keeping an eye on decks you’d like to try playing!

The second trick is to automate the running of moxtrice, so you don’t have to remember to do it. All versions of Windows have a “Task Scheduler” program, which allows you to run a command on a specific time frame, say every day. Mac and Linux operating systems utilize the “crontab” program to the same effect. Set the above command to run once a day, or when you boot up your computer, and you’ll never have to worry about running it manually, unless you immediately want to play with some changes you’ve just uploaded to Moxfield.

And there we go!

With any luck the above guide serves as an easy-to-follow walk-through of how to get Cockatrice to sync with your favorite Moxfield decks, and installing these tools will help safe hours of meticulously clicking through menus and card catalogs! A big thank you to the Seattle MTG crew for their interest in this project and for encouraging me to write up the instructions for all to enjoy.

Happy gaming!


Header Image by Pexels from Pixabay, a great resource for royalty-free stock images