Commander intelligence for your decks, your collection, and your real pod meta.
Scrybase is a local-first Commander workbench for deck building, collection management, pod tracking, matchup notes, and long-term tuning. It helps you build from the cards you already own, record what actually happens on game night, and make better decisions with data from your own playgroup.
- Import and analyze decks with mana curve, pip, category, combo, and cut/upgrade insight
- Track your collection and see owned versus missing cards across your lists
- Run sessions, check in players, seat pods, record results, and review history
- Keep matchup notes tied to decks, commanders, opponents, and sessions
- Review deck, player, commander, and pod trends over time
- Use the browser app for day-to-day work, the TUI scaffold for terminal snapshots, and the CLI for operator workflows
Most Commander tools stop at deck lists or card inventories. Scrybase connects the parts that matter together:
- what you play
- what you own
- who you play against
- what actually wins
That means better upgrade decisions, cleaner pod context, and tuning that reflects your real meta instead of generic averages.
Import decks, inspect mana and role balance, track revisions, review combos, and spot cuts or upgrades.
Import your collection, compare it against every deck, and see card demand across your lists.
Create sessions, register players and decks, generate fair pods, record results, and review game-night history.
Store notes for commanders, opponents, decks, and sessions so you have context before the next game starts.
Review performance trends, recurring threats, win conditions, and deck changes over time.
- Python 3.12+
- uv
- Bun
- Docker for the easiest local PostgreSQL bootstrap, or an existing PostgreSQL 16+ instance
Scrybase still ships on a PostgreSQL-backed Python runtime while the approved rewrite target in BUILD.md moves the repo toward Bun + TypeScript + Astro + Vue + Elysia + Zod + PostgreSQL + Docker Compose + Caddy.
The rewrite foundation now also exists under apps/, packages/, and deploy/, but that skeleton is not the shipped runtime yet.
What ships today:
src/appis the live FastAPI backend, JSON contract layer, compatibility HTML surface, SQLAlchemy model set, and CLI sourcefrontend/webis the Bun-managed Astro + Vue browser shell and the primary browser entrypointfrontend/tuiis the Bun-managed OpenTUI operator scaffoldmigrations/is the Alembic schema history for the live PostgreSQL databasetests/is the verification lane for routes, contracts, CLI flows, and domain services
The current Python backend, Python CLI expansion, legacy template surface, and OpenTUI scope are feature-frozen except for migration blockers and release-critical fixes.
Current-state reference docs:
docs/legacy-runtime-baseline.mdfor shipped runtime ownership and feature-freeze rulesdocs/postgresql-inventory.mdfor the live schema, constraints, indexes, and token-bearing tablesdocs/operations.mdfor environment variables, startup commands, backup paths, and operator commandsdocs/smoke-flows.mdfor the parity smoke list that must survive the rewritedocs/frontend-migration-inventory.mdfor the detailed route and contract discovery map
Bring up a disposable local PostgreSQL instance:
docker run --name scrybase-postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=scrybase \
-p 5432:5432 \
-d postgres:16-alpineThen configure Scrybase and start the Python backend:
uv sync
export SCRYBASE_DATABASE_URL=postgresql+psycopg://postgres:[email protected]:5432/scrybase
uv run alembic upgrade head
uv run uvicorn app.main:app --host 127.0.0.1 --port 8000 --reloadOpen http://127.0.0.1:8000 if you want the compatibility FastAPI UI.
In a second terminal, install the Bun workspace dependencies and start the browser shell against the running backend:
bun install
SCRYBASE_BACKEND_URL=http://127.0.0.1:8000 bun run dev-webOpen http://127.0.0.1:4321 for the primary browser entrypoint.
The full Astro-owned route list and the remaining compatibility cleanup details are frozen in docs/legacy-runtime-baseline.md and docs/frontend-migration-inventory.md.
With the backend running locally, start the terminal scaffold in a third terminal:
bun install
SCRYBASE_BACKEND_URL=http://127.0.0.1:8000 bun run dev-tuiThe current TUI scaffold signs in against the backend contract layer and renders authenticated overview, sessions, decks, and help screens. Setup still starts in the browser, and richer operator workflows have not been cut over.
If you do not set SCRYBASE_DATABASE_URL, Scrybase defaults to:
postgresql+psycopg://postgres:[email protected]:5432/scrybase
Environment variables use the SCRYBASE_ prefix. The short version is:
SCRYBASE_DATABASE_URLsets the primary SQLAlchemy database URL.SCRYBASE_SECRET_KEYshould be changed from the development default before any real deployment.SCRYBASE_DEBUGenables debug mode.SCRYBASE_HOSTandSCRYBASE_PORTare available if you wrap startup in your own launcher.SCRYBASE_BACKEND_URLpoints the Astro and OpenTUI frontends at the backend.
See docs/operations.md for the full operational inventory, backup paths, and smoke commands.
Point the CLI at the same PostgreSQL database URL as the app:
export SCRYBASE_DATABASE_URL=postgresql+psycopg://postgres:[email protected]:5432/scrybase
uv run scrybasectl version
uv run scrybasectl --database-url "$SCRYBASE_DATABASE_URL" deck list
uv run scrybasectl --database-url "$SCRYBASE_DATABASE_URL" collection stats
uv run scrybasectl --database-url "$SCRYBASE_DATABASE_URL" session list
uv run scrybasectl --database-url "$SCRYBASE_DATABASE_URL" system status
uv run scrybasectl --database-url "$SCRYBASE_DATABASE_URL" system backupThe CLI keeps version and help commands read-only. It will not create a database just to print version or usage.
--data-dir controls backup file destinations.
Use the operator status command against the same database URL that the app uses:
uv run scrybasectl --database-url "$SCRYBASE_DATABASE_URL" system statusThat prints the backend, resolved database URL with secrets redacted, schema revision when present, database size, and core object counts for users, decks, collection cards, sessions, and matchup notes.
Create a backup with the built-in operator command:
uv run scrybasectl --database-url "$SCRYBASE_DATABASE_URL" system backupThis writes a plain SQL dump under ~/.scrybase/backups/ by default, using local pg_dump when available and a Dockerized fallback when it is not.
You can always choose an explicit output path:
uv run scrybasectl --database-url "$SCRYBASE_DATABASE_URL" system backup \
--output /srv/scrybase/backups/scrybase-$(date +%Y%m%d-%H%M%S).sqlRestore a backup into a target database with psql or the PostgreSQL Docker image:
psql postgresql://postgres:[email protected]:5432/scrybase < /path/to/backup.sqlWith the backend running locally:
curl http://127.0.0.1:8000/healthz
uv run scrybasectl versionExpected results:
/healthzreturns{"status":"ok"}scrybasectl versionprints the installed Scrybase version
For a cheap end-to-end migration smoke path that bootstraps a disposable Docker PostgreSQL instance, migrates it, starts the FastAPI backend plus the Astro web shell, and exercises first-run auth, deck import plus detail, session create plus check-in plus detail, and CLI status plus backup flow:
./scripts/smoke-local.shBackend checks:
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytestWeb frontend checks:
bun run check-web
bun run test-web
bun run build-webTUI frontend checks:
bun run check-tui
bun run test-tuiuv run pytest expects PostgreSQL. It will use SCRYBASE_TEST_DATABASE_URL when set, or start a disposable local Docker PostgreSQL container automatically.
A production deployment is one application process plus a PostgreSQL database.
export SCRYBASE_DATABASE_URL=postgresql+psycopg://scrybase:[email protected]:5432/scrybase
export SCRYBASE_SECRET_KEY=replace-this-before-production
uv run alembic upgrade head
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000Put it behind your preferred edge service or private network path.
MIT. See LICENSE.