Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/boldandbrad/mpl-cli

๐ŸŽฒ Manage local board game stashes and interact with BoardGameGeek from your terminal.
https://github.com/boldandbrad/mpl-cli

board-game boardgamegeek cli collections meeple rust

Last synced: 7 days ago
JSON representation

๐ŸŽฒ Manage local board game stashes and interact with BoardGameGeek from your terminal.

Awesome Lists containing this project

README

        

*This is a reimagination and reimplementation of my other project
[meeple-cli](https://github.com/boldandbrad/meeple-cli).*

---

# mpl

[![Crates.io](https://img.shields.io/crates/v/mpl-cli)](https://crates.io/crates/mpl-cli)

> **mpl**; short for **meeple** [`/mipel/`] *noun* - a board game player
> token. (E.g., meeple icon)

**mpl** is a local board game collection management CLI tool built in rust and
powered by [BoardGameGeek](https://boardgamegeek.com) (BGG) public APIs.

**Jump to:**
[Features](#features) |
[Installation](#install) |
[Getting Started](#getting-started) |
[Command Reference](#cmd-ref) |
[Configuration](#config) |
[Resources](#resources) |
[Legal](#legal) |
[Documentation](https://boldandbrad.github.io/mpl/) ๐Ÿ”—

> [!WARNING]

> **mpl** is currently in **ALPHA**. This means it is generally unstable and may
> be missing key features. Please track the progress of features throughout this
> README with the following symbols:
> | Symbol | Status |
> | - | - |
> | โœ… | Implemented - stable |
> | โœณ๏ธ | Implemented - unstable |
> | ๐Ÿšง | Work in Progress |
> | โŒ | Not Started |

## ๐ŸŽฅ Demo

> Coming soon.

## โœจ Features

- Get started quickly with BGG user collection import โŒ
- Discover new titles via BGG Hotness, new releases, active crowdfunding
campaigns, and BGG search ๐Ÿšง
- Grow your collection by searching and opening Geek Market listings โŒ
- Flexible local stash maintainance and customization ๐Ÿšง
- Powerful cross-stash search to find the best title for game night โŒ
- Create and manage personal ratings โŒ
- Log and view game playthroughs โŒ
- Multiple user support with profiles ๐Ÿšง
- Written in Rust ๐Ÿฆ€ โœ…

## ๐Ÿ“ฆ Installation

Install **mpl** with your favorite of the methods below, or read the
[docs](https://boldandbrad.github.io/mpl/) for more info. Then run
`mpl --version` to verify installation.

**Jump to:** [Homebrew](#install-homebrew) | [Scoop](#install-scoop) |
[Cargo](#install-cargo) | [Remote](#install-remote) |
[GitHub Release](#install-release) | [Source](#install-source)

### Install via [Homebrew](https://brew.sh) ๐Ÿบ (macOS/Linux) โŒ

1. Add tap:

```sh
brew tap boldandbrad/tap
```

1. Install formula:

```sh
brew install mpl-cli
```

### Install via [Scoop](https://scoop.sh) ๐Ÿฆ (Windows) โŒ

1. Add bucket:

```sh
scoop bucket add boldandbrad_scoop-bucket https://github.com/boldandbrad/scoop-bucket
```

1. Install manifest:

```sh
scoop install boldandbrad_scoop-bucket/mpl-cli
```

### Install via [Cargo](https://crates.io) ๐Ÿ“ฆ โœ…

> [!NOTE]
> In order to install pre-releases (alpha/beta/pre) you must run `cargo install`
> with `--version=`.

- Install crate:

```sh
cargo install mpl-cli
```

### Install via remote install script ๐Ÿ“œ โŒ

> [!NOTE]
> The [remote install script](scripts/install.sh) explains what it will do and
> prompts before doing so.

- Run script:

```sh
curl -LSfs https://raw.githubusercontent.com/boldandbrad/mpl-cli/main/ci/install.sh | sh -s -- --git boldandbrad/mpl-cli
```

### Manual install from GitHub Release โฌ‡๏ธ ๐Ÿšง

1. Download the [latest GitHub Release](https://github.com/boldandbrad/mpl-cli/releases)
for your platform
2. Extract contents and install to a location in your `$PATH`

### Manual install from source ๐Ÿ‘ฉโ€๐Ÿ’ป โœ…

1. Install [Rust](https://www.rust-lang.org/tools/install)
2. Run `git clone https://github.com/boldandbrad/mpl-cli` and `cd mpl-cli`
3. Run `cargo install --path .`
4. Ensure `~/.cargo/bin` or `$CARGO_HOME/bin` is in your `$PATH`

## ๐Ÿš€ Getting Started

Using **mpl** is as easy as:

```sh
mpl
```

To get you started, on first run `mpl` creates a default profile with the same
name as your user `$HOME` directory containing a stash called `collection`.

> [!TIP]
> If you prefer, you can rename these later with `mpl profile rename` and
> `mpl stash rename` respectively.

### Import BGG user collections ๐Ÿšข

Initiate an import:

> [!TIP]
> Try it with `--dry-run` to *simulate* the import without actually making
> changes.

```sh
mpl bgg import --user=boldandbrad
```

**mpl** will guide you through the import process. When done, see your imported
stash(es):

```sh
mpl stash list --verbose
```

### Start fresh ๐Ÿงผ

**mpl** relies on BoardGameGeek item IDs to manage titles in your stashes. The
easiest way to get these is by searching BoardGameGeek:

```sh
mpl bgg search "wingspan"
```

Copy a title ID from the output and use it in another command:

```sh
mpl add -s=collection 266192
```

You've added Wingspan ๐Ÿฆœ to the `collection` stash!

Now let's see what's in your stash:

```sh
mpl list -s=collection
```

Run `mpl --help` or read the [docs](https://boldandbrad.github.io/mpl/) to
discover what to do next!

## ๐Ÿ“– Command Reference

> [!TIP]

> You can discover **mpl** commands and options with `mpl --help`.

### Root ๐Ÿšง

- `mpl add` โœณ๏ธ - add titles to a stash
- `-s`/`--stash` [Opt] โŒ - stash to add titles to
- `-v`/`--verbose` [Flg] โŒ - include additional output
- `mpl drop` โœณ๏ธ - drop titles from a stash
- `-s`/`--stash` [Opt] โŒ - stash to drop titles from
- `-f`/`--force` [Flg] โŒ - drop titles without confirmation
- `-v`/`--verbose` [Flg] โŒ - include additional output
- `mpl list` ๐Ÿšง - list stashed titles
- `--sort` [Opt] โŒ - sort titles by provided value. values: [rank, rating,
weight, year, name, id, time]. default: rating
- `-g`/`--games-only` [Flg] โŒ - list only games
- `-e`/`--expansions-only` [Flg] โŒ - list only expansions
- `--group` [Opt] โŒ - group expansions below their parent game. default: true
- `--players` [Opt] โŒ - list only games that support the given player count
- `--max-time` [Opt] โŒ - list only games that fit the given play time (Min.)
- `--weight` [Opt] โŒ - list only games that match the given weight class. options:
[1,2,3,4]. ex: 2 -> 2.00-2.99
- `-v`/`--verbose` [Flg] โŒ - include additional columns in output
- `mpl move` โŒ - move titles to another stash
- `-s`/`--from-stash` [Opt] โŒ - source stash
- `-d`/`--to-stash` [Opt] โŒ - destination stash
- `-v`/`--verbose` [Flg] โŒ - include additional output

### Profiles ๐Ÿšง

Manage user profiles.

- `mpl profile list` โœณ๏ธ - list all existing profiles
- `-v`/`--verbose` [Flg] โŒ - include additional columns in output
- `mpl profile active` โœ… - show the current active profile
- `-v`/`--verbose` [Flg] โŒ - include additional columns in output
- `mpl profile switch` โœณ๏ธ - switch the active profile
- `mpl profile create` โœณ๏ธ - create a new profile
- `--active` [Flg] โœณ๏ธ - make the new profile the active profile
- `mpl profile delete` โœณ๏ธ - delete an existing profile
- `-f`/`--force` [Flg] โŒ - delete profile without confirmation
- `mpl profile rename` โŒ - rename an existing profile

### Stashes ๐Ÿšง

Manage local stashes in the active profile.

#### Flags/Options

- `-p/--profile` - the profile to perform actions in (default: active profile)

#### Commands

- `mpl stash create` โœณ๏ธ - create new stashes
- `mpl stash delete` โœณ๏ธ - delete existing stashes
- `-f`/`--force` [Flg] โŒ - delete stash without confirmation
- `mpl stash list` โœณ๏ธ - list existing stashes
- `-v`/`--verbose` [Flg] โŒ - list stats for stashes
- `mpl stash rename` โŒ - rename an existing stash
- `mpl stash info` โŒ - view details of a stash
- `mpl stash move` โŒ - move stashes to another profile

### BoardGameGeek ๐Ÿšง

Perform BoardGameGeek related actions.

- `mpl bgg search` โœณ๏ธ - search boardgamegeek for titles
- `--market` [Flg] โŒ - search geek market listings
- `-v`/`--verbose` [Flg] โŒ - include additional columns in output
- `mpl bgg info` โœณ๏ธ - view title details
- `mpl bgg open` โŒ - open links in the web browser
- `--page` [Opt] - open a title's boardgamegeek page(s)
- `--campaign` [Opt] - open a title's crowdfunding campaign page
- `--listing` [Opt] - open a geek market listing
- `mpl bgg import` โŒ - import bgg user collections
- `-u`/`--user` [Opt] โŒ - bgg user to import collections from
- `--dry-run` [Flg] โŒ - simulate import without persisting changes
- `mpl bgg hotness` โœณ๏ธ - view bgg hotness list
- `-v`/`--verbose` [Flg] โŒ - include additional columns in output
- `mpl bgg campaigns` โŒ - list active crowdfunding campaigns
- `mpl bgg releases` โŒ - list recent title releases
- `-v`/`--verbose` [Flg] โŒ - include additional columns in output

### Config ๐Ÿšง

Manage configurations.

> Profile level configs override global ones by default.

#### Flags/Options

- `-g`/`--global` โŒ - apply config actions to the global scope. When not
present, the action applies to the active profile options.
- `--show-scope` โŒ - augment output with the scope
- `-F`/`--force` โŒ - used in combination with `-g`, changes default config
value for all profiles with overwrite of profile values

#### Commands

- `mpl config list` โŒ - list all config options and their current values
- `--name-only` โŒ - output only config option names
- `mpl config get` โŒ - get the current value of the given config option
- `--default` โŒ - get the default value of the given config option
- `--all-values` โŒ - get all valid values of the given config option
- `mpl config set` โŒ - set the value of the given config option
- `mpl config unset` โŒ - revert the value of the given option to its default
- `-a`/`--all` โŒ - revert all option values to their default
- `mpl config complete` ๐Ÿšง - setup tab-completions for the given shell

### Ratings โŒ

> Needs more thought and design.

Manage personal title ratings.

- `mpl rating rate` โŒ - rate a title
- `mpl rating unrate` โŒ - unrate a title
- `mpl rating tiers` โŒ - list rated titles in tiers

### Plays โŒ

> Needs more thought and design.

Log and manage title plays.

- `mpl play log`/`create` โŒ - log a new play
- `mpl play delete` โŒ - delete an existing play
- `mpl play list` โŒ - list all logged plays
- Arg BGG_ID โŒ - list title logged plays
- `mpl play stats` โŒ - view title play stats

## โš™๏ธ Configuration

### Environment Variables

**mpl** respects the following env variables to modify default behavior. In
cases where multiple variables control the same behavior, **mpl** obeys the
left-most present variable.

- `MPL_CONFIG_HOME`/`XDG_CONFIG_HOME` โŒ - change where **mpl** configs are
stored. Default: `~/.config/mpl/`
- `MPL_STATE_HOME`/`XDG_STATE_HOME` โŒ - change where **mpl** state is stored.
Default: `~/.local/state/mpl/`

### Config options

> Needs more thought and design.

These options can be managed with `mpl config`.

> Global configs are stored in `.mpl/config.toml`.
> Profile level configs are stored in `.mpl//config.toml`

- `quiet_success` โŒ - force `--quiet` on all supported commands on success
[Default `false`]
- `pretty_format` โŒ - format outputs with table borders and emojis [Default
`true`]
- `default_stash_name` โŒ - the default name to use when creating new stashes
[Default `collection`]
- `abbreviated_format` โŒ - ?

### Completions

**mpl** supports tab completions for `bash`, `zsh`, and `fish`. For
setup, run `mpl config completions `.

## ๐Ÿ“š Resources

- [Changelog](docs/CHANGELOG.md) - See a history of implemented
features/changes.
- [Roadmap](https://github.com/boldandbrad/mpl-cli/milestones) - See a list of
planned features and milestones.
- [FAQ](docs/faq.md) - Find answers to common questions.
- [Contributor Guide](docs/CONTRIBUTING.md) โŒ - Find out how to get involved.

## โš–๏ธ Legal

> [!NOTE]

> Neither **mpl** nor its maintainers are affiliated with
> [BoardGameGeek](https://boardgamegeek.com).

Copyright (c) 2023 Bradley Wojcik. Released under the MIT License. See
[LICENSE](LICENSE) for details.