Metadata-Version: 2.3
Name: slab-cli
Version: 0.13.0
Summary: CLI for the slab trading-card API — catalog, collect, and track your cards from the terminal.
Author: dev_jeb
Requires-Dist: slab-schemas>=0.1.0
Requires-Dist: httpx>=0.27
Requires-Dist: rich>=13.0
Requires-Dist: inquirerpy>=0.3
Requires-Python: >=3.13
Description-Content-Type: text/markdown

# slab-cli

A terminal client for the [slab](https://api.slab.dev-jeb.com) trading-card API — browse the
catalog, price cards against real sales comps, and track your own collection from the command line.

```bash
pip install slab-cli
```

This installs the `slab` command.

## Setup

The CLI talks to the hosted slab API. You need an **API key** — mint one from the
[slab portal](https://app.slab.dev-jeb.com) (sign in → **API Keys** → create). Then:

```bash
export SLAB_API_KEY=sk_live_...        # your key (required)
# optional:
export SLAB_API_URL=https://api.slab.dev-jeb.com   # default; override for a self-hosted API
export SLAB_COLLECTOR=<collector-uuid>             # your active collector, reused across commands
```

## Quickstart

```bash
# Catalog + pricing (no collector needed)
slab card search --subject "Connor Bedard"      # find cards
slab card price <card-uuid>                      # fair-market value from sales comps
slab card comps <card-uuid>                      # the underlying recent sales
slab set "OPC Platinum"                          # a set's sealed FMV + top cards

# Your collection
slab collector create                            # one-time: create your collector profile
slab collection add                              # add an owned copy (grade, cost, acquisition)
slab collection cost                             # log grading/shipping costs on a copy
slab break new                                   # record a box/case break
slab collection dashboard                        # portfolio value, cost basis, P&L
slab collection search                           # search + filter your copies
```

Run `slab` with no arguments for the full command list, or `slab <group>` (e.g. `slab collection`)
to see a group's verbs.

## Configuration reference

| Env var                | Purpose                                    | Default                          |
| ---------------------- | ------------------------------------------ | -------------------------------- |
| `SLAB_API_KEY`         | API key for authentication (**required**)  | —                                |
| `SLAB_API_URL`         | Base URL of the slab API                   | `https://api.slab.dev-jeb.com`   |
| `SLAB_COLLECTOR`       | Active collector UUID, reused per command  | —                                |
| `SLAB_NO_UPDATE_CHECK` | Set to `1` to silence update checks        | —                                |

## Staying up to date

Nothing updates itself. At most once a day the CLI asks PyPI (in the background, while your command
runs) whether there's a newer release, and if so prints one line after the output:

```
▍ slab-cli 0.7.0 is available — you have 0.6.0
  Update when you like: slab update
```

```bash
slab --version         # what you have
slab update check      # ask PyPI right now; installs nothing
slab update            # upgrade, after showing the command and asking
```

`slab update` runs the upgrade that matches how you installed slab — `pipx upgrade`,
`uv tool upgrade`, or `pip install --upgrade` — and prints it first, so you can decline and run it
yourself. To turn the whole thing off: `export SLAB_NO_UPDATE_CHECK=1`.

## What it depends on

Requests and responses are typed against [`slab-schemas`](https://pypi.org/project/slab-schemas/) —
the same pydantic wire contract the API itself uses — so the CLI and API can never drift.

Requires Python 3.13+.
