booky-cli (0.0.5)

Published 2026-09-08 11:34:34 +00:00 by ivo.zilkenat

Installation

registry=https://gitea.i.ivo-zilkenat.de/api/packages/ivo.zilkenat/npm/
npm install booky-cli@0.0.5
"booky-cli": "0.0.5"

About this package

Booky admin CLI — calls public Convex functions as a real user (token→JWT).

booky-cli

TypeScript CLI for Booky. Calls the public Convex functions — the same the frontend uses — as a real user, authenticated by an opaque bky_… token exchanged for a short-lived JWT at /cli/token. Architecture adopted from Plexus.

Quickstart

pnpm install
pnpm dev config show                 # in-repo (tsx), no build
pnpm dev whoami
pnpm dev tokens create "my machine"  # mint a token (shown once)
pnpm build && pnpm link:global       # → `booky-cli` on PATH

Local dev needs zero config: run from inside a started rdu worktree and the CLI resolves that deployment + bootstraps a token via the rdu admin key. Remote targets need a bky_… token — see .claude/rules/cli.md for the booky.yml schema and the full command reference.

Architecture

core/     brand-neutral framework (transport, auth, jwt-cache, config, output, spec, command)
booky/   branded layer — branding, client (env/auth resolution), command base, commands/, lib/
cli.ts    clipanion bootstrap

core/ never hard-codes a product; booky/branding.ts supplies all product-specific strings. Commands import the backend's generated api (app/convex/_generated), so calls are end-to-end typed and bundled at build.

Escape hatch: booky-cli call <module:fn> [--kind query|mutation|action] k=v … reaches any public function without a typed wrapper.

Buchungsaufteilung — split / unsplit

Eine Bank-Buchung auf mehrere Konten aufteilen (z. B. 70/30-Bewirtung), ohne den rohen call bookings:splitBooking JSON-Umweg:

# Jede Position: "konto:betrag:steuerschluessel[:zusatzangabe]" (>=2, wiederholbar)
# Betrag in EUR: 70, 70.00 oder 70,00 werden string-basiert nach Cent umgerechnet
# (kein Float-Drift). konto/zusatzangabe dürfen leer sein.
booky-cli --env local --tenant test split <bookingId> \
  --line "4930:55,93:0" \
  --line "4980:23,97:0"

# Aufteilung wieder zusammenführen (Geschwisterzeilen löschen, Primärzeile auf den
# vollen Betrag zurücksetzen):
booky-cli --env local --tenant test unsplit <bookingId>

Regeln (fail-loud in bookings:splitBooking — die CLI reicht die Server-Meldung wörtlich durch, kein Schlucken):

  • mind. 2 Positionen, jeder Betrag > 0;
  • Kontrollsumme: Summe der Positionen = Buchungsbetrag (exakt, in Cent);
  • Buchung darf nicht validated (vorher entsperren) und nicht bereits aufgeteilt sein; Periode muss offen sein.

split zeigt danach die entstandenen Geschwisterzeilen (--json für Rohdaten).

Dependencies

Development Dependencies

ID Version
@types/js-yaml ^4.0.9
@types/node ^22.10.0
clipanion 4.0.0-rc.4
convex ^1.38.0
esbuild 0.27.0
js-yaml ^4.2.0
tsx ^4.21.0
typescript ^6.0.3
Details
npm
2026-09-08 11:34:34 +00:00
0
462 KiB
Assets (1)
Versions (7) View all
0.0.7 2026-09-21
0.0.6 2026-09-08
0.0.5 2026-09-08
0.0.4 2026-09-08
0.0.3 2026-09-08