The CLI
Every command of npx @sypnia/cases, and its flags.
Creates
cases/ with map.yaml, navigation.yaml (one root) and one example case, with the schema line for your editor.Writes a typed skeleton,
src/cases/<area>/<id>.ts, for every case that has none (it never overwrites code), .sypnia/cases/types.d.ts with every input, outcome and failure, and each area’s service, src/areas/<area>.ts. Run it after each change to the map; --check fails when the types are out of date.Prints the navigation tree with each place’s path and cases.
cases nav path <place> prints one path («Shop › Order for tomorrow»). --from-code reads every data-sypnia-place and data-sypnia-opens in your code and proposes the tree (The navigation map).Prints the event graph: which case starts on which outcome.
--from <event> follows one chain; --json for machines (Outcomes and events).Validates the map and compares it with the code, the plan and production (The check). Code is Sypnorm’s use cases,
Case: <id> trailers of the last 2000 commits and // case: <id> notes in the sources. cases/plan.md gives unbuilt; with Telemetry linked (app.telemetry in map.yaml, or telemetry in the [cases] table) and a read token in SYPNIA_TELEMETRY_TOKEN, it reads the last 30 days of production. Flags: --contract (also the landing’s promises and milestones that name no case), --json, --ci (annotations), --base <git ref> (the commit to compare outcome payloads with, for breaking-change; HEAD by default), --no-telemetry (skip production). Exit 1 on any error.Fills the fields the code owns (data, failure names, allowed actors) from
npx @sypnia/cases map. It edits the case files; review them as any change to the map, and send them with cases propose.Recent deliveries to one listening case (
deliveries.tell-the-baker): state, attempts, wait, last error (Delivery). It reads the app’s database: DATABASE_URL, or --database-url; --json, --limit.list every listener with dead letters; show <listener> its events and errors; replay <listener> [--event <id>] sends them again after a fix; drop <listener> --event <id> --reason "…" removes one, with the reason kept (Dead letters). Like deliveries, it reads DATABASE_URL or --database-url.Runs every area’s service of
src/areas/ on your machine, against your local Postgres (DATABASE_URL), each on its own port from PORT (3000 by default, or --port) up, with events delivered between them and the jobs of scheduled cases on a fast clock (--clock 60x). TypeScript areas run through tsx. cases dev trigger <case> queues a run of a case now; its area’s service runs it.Signs in with your Sypnia account through the device flow of
@sypnia/data (the same session Data’s CLI saves): you approve a code in the browser, and the session stays in ~/.config/sypnia/ (mode 600). Nothing secret is pasted anywhere. The session is bound to a key on this machine; where a command takes a token instead, set SYPNIA_TOKEN.The commands below talk to a Cases server: Sypnia Cloud at https://cases.api.sypnia.com, or your own, named in SYPNIA_CASES_API or in api of the [cases] table. They use SYPNIA_TOKEN (a Sypnia token or a Cases project token), else the login session. The Cases project is --project <map>, or project of the [cases] table.
Writes the approved version of the map into
cases/, or another version with --version 3. A version made from files gives each file back as it was written, byte for byte. Files only on your side are listed, never deleted; cases/plan.md stays yours.Sends the files of
cases/ as a draft proposal against the approved version (--title names it). It never changes an approved version; cases propose opens it for review.Opens a proposal with the local changes against the approved version: each case added, changed or retired.
--title "…" names it, and --reviewers ana@la-espiga.co,owner@la-espiga.co asks those people to review (Versions, proposals and reviews).Shows changes case by case and field by field;
--json for machines. cases diff v3..v4 compares two versions of the Cases project. With a Cases project set, cases diff compares cases/ with the approved version; --base <ref>, or no Cases project, compares it with a commit (HEAD by default).Binds this repository to a Cases project:
cases link <map> writes it into the [cases] table of sypnia.toml, so the commands above and map --upload know where to go. With --data <ref> it also writes the Data project there and links the map with that Data project, both ways (Data).Prints a new case key (
syp_rck_…) for an external case without a signature, once. Keep it in your app’s secrets as SYPNIA_CASE_KEY_<CASE_ID> (SYPNIA_CASE_KEY_RAPPI_ORDER) and give it to the caller (How a case starts).Sypnorm’s commands
Reads your database schema (a Sypnia Data project, or any Postgres through
DATABASE_URL) and writes Sypnorm’s typed tables (Tables and queries).Derives the code side of the map from your use cases into
sypnorm.map.json (--out for another file). Flags: --upload sends the map to the project --project names (by default project, then data, of the [cases] table). Twenty lowercase letters is a Sypnia Data project: the map goes to its «Use cases», and Data forwards it to the Cases map linked with that project, as a draft proposal. Anything else, or any project while SYPNIA_CASES_API or api of the [cases] table names your own server, is a Cases map: the map goes to the Cases server as a draft proposal of what the code changed. A person approves it; a map with errors is not sent unless you add --force. It signs in with SYPNIA_TOKEN, or the login session. --check fails when code and file differ; --json prints it (The map from your code).