Skip to content

Commit afe37a5

Browse files
committed
docs(stack,cli): reconcile living docs to stash eql install + document --eql-version
Update the stash-cli skill and @cipherstash/migrate README to the renamed `stash eql install` command (keeping `stash db install` documented as the deprecated alias), and document the new `--eql-version <2|3>` install flag and its v3 direct-install-only constraints in the skill. Re-expressed from james/cip-3291-bigint-stack 64fdeb2/d15414a5 docs. Historical CHANGELOGs and dated design docs are left as point-in-time records; the base already migrated the domain surface to public.*.
1 parent e9c60a4 commit afe37a5

2 files changed

Lines changed: 25 additions & 20 deletions

File tree

packages/migrate/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Each column walks through these phases:
1212
schema-added → dual-writing → backfilling → backfilled → cut-over → dropped
1313
```
1414

15-
State is tracked in an append-only `cipherstash.cs_migrations` table installed by `stash db install`. The EQL intent (which indexes, which cast_as) continues to live in `eql_v2_configuration` so Proxy continues to work against the same database.
15+
State is tracked in an append-only `cipherstash.cs_migrations` table installed by `stash eql install`. The EQL intent (which indexes, which cast_as) continues to live in `eql_v2_configuration` so Proxy continues to work against the same database.
1616

1717
## API
1818

@@ -32,7 +32,7 @@ import {
3232

3333
### `installMigrationsSchema(client)`
3434

35-
Creates `cipherstash.cs_migrations` idempotently. Normally called by `stash db install`.
35+
Creates `cipherstash.cs_migrations` idempotently. Normally called by `stash eql install`.
3636

3737
### `runBackfill({ db, encryptionClient, tableSchema, tableName, plaintextColumn, encryptedColumn, pkColumn, schemaColumnKey, chunkSize?, signal?, onProgress? })`
3838

skills/stash-cli/SKILL.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default defineConfig({
9090
})
9191
```
9292

93-
`db install` will scaffold this file for you if it's missing.
93+
`eql install` will scaffold this file for you if it's missing.
9494

9595
### Config options
9696

@@ -130,7 +130,7 @@ Init is the **scaffold** save-point. It does mechanical setup only — no agent
130130
2. **Resolve database** — picks up `DATABASE_URL` from `.env`/`.env.local` or prompts for it. Verifies the connection.
131131
3. **Build schema** — auto-detects your framework (Drizzle from `drizzle.config.*` / `drizzle-orm` / `drizzle-kit` in `package.json`; Supabase from the `DATABASE_URL` host) and silently writes a placeholder client to `./src/encryption/index.ts`. Only prompts you if a file already exists at that path.
132132
4. **Install dependencies** — single combined prompt for `@cipherstash/stack` and `stash`. Skipped entirely when both are already in `node_modules`.
133-
5. **Install EQL** — runs the equivalent of `stash db install` against the resolved database (Drizzle migration, Supabase migration, or direct, per detection). Skipped if EQL is already installed.
133+
5. **Install EQL** — runs the equivalent of `stash eql install` against the resolved database (Drizzle migration, Supabase migration, or direct, per detection). Skipped if EQL is already installed.
134134
6. **Gather context** — detects available coding agents (Claude Code, Codex, Cursor, Windsurf, Cline) and writes `.cipherstash/context.json` with integration, package manager, schemas, env keys, and detected agents.
135135
136136
When init finishes, it prints a checkmark panel of completed phases and an interactive **chain prompt** (default-yes): *"Continue to `stash plan` now to draft your encryption plan?"* Yes auto-launches `stash plan`. No prints "Next: run `stash plan` to draft your encryption plan." Non-TTY (CI, pipes) skips the prompt and prints the hint.
@@ -257,20 +257,22 @@ stash auth login
257257
258258
Opens a browser-based device code flow and saves a token to `~/.cipherstash/auth.json`. Database-touching commands check for this file before running.
259259
260-
### `db install` — Configure the database and install EQL extensions
260+
### `eql install` — Configure the database and install EQL extensions
261261
262262
```bash
263-
stash db install
264-
stash db install --supabase
265-
stash db install --supabase --migration
266-
stash db install --supabase --direct
267-
stash db install --drizzle
268-
stash db install --force
263+
stash eql install
264+
stash eql install --supabase
265+
stash eql install --supabase --migration
266+
stash eql install --supabase --direct
267+
stash eql install --drizzle
268+
stash eql install --force
269269
```
270270
271-
`stash init` runs `db install` automatically as part of its EQL install phase. Run `db install` directly when you skipped init, when you need flags init doesn't expose (`--migration`, `--migrations-dir`, `--exclude-operator-family`), or when re-installing/upgrading EQL on its own.
271+
`stash db install` is a deprecated alias for this command — it still works but prints a deprecation warning. Always use `eql install` in new instructions.
272272
273-
`db install` is the single command that gets a project from zero to installed EQL:
273+
`stash init` runs `eql install` automatically as part of its EQL install phase. Run `eql install` directly when you skipped init, when you need flags init doesn't expose (`--migration`, `--migrations-dir`, `--exclude-operator-family`), or when re-installing/upgrading EQL on its own.
274+
275+
`eql install` is the single command that gets a project from zero to installed EQL:
274276
275277
1. Scaffolds `stash.config.ts` if missing (auto-detects an existing client file at common locations, otherwise prompts).
276278
2. Loads the config.
@@ -295,10 +297,13 @@ stash db install --force
295297
| `--migration` | Write the EQL SQL into a Supabase migration file (requires `--supabase`) |
296298
| `--direct` | Run the EQL SQL directly against the database (requires `--supabase`; mutually exclusive with `--migration`) |
297299
| `--migrations-dir <path>` | Override the Supabase migrations directory (requires `--supabase`; default: `supabase/migrations`) |
300+
| `--eql-version <2\|3>` | EQL generation to install (default: `2`). `3` installs the native concrete-domain schema (`public.*` type domains, `eql_v3` operators, `eql_v3_internal` constructors) |
298301
299302
`--migration`, `--direct`, and `--migrations-dir` only make sense in the Supabase flow and require `--supabase` to be passed explicitly. They never auto-enable `--supabase`.
300303
301-
#### `db install --drizzle`
304+
`--eql-version 3` currently installs via the direct path only — it rejects `--drizzle`, `--migration`, `--migrations-dir`, and `--latest`. Bundles are vendored (no public v3 release artifacts yet), so `--latest` is v2-only.
305+
306+
#### `eql install --drizzle`
302307
303308
When `--drizzle` is passed, the CLI:
304309
1. Runs `drizzle-kit generate --custom --name=<name>` to scaffold an empty migration.
@@ -307,7 +312,7 @@ When `--drizzle` is passed, the CLI:
307312
308313
You then run `npx drizzle-kit migrate` to apply it. Requires `drizzle-kit` as a dev dependency.
309314
310-
#### `db install --supabase --migration`
315+
#### `eql install --supabase --migration`
311316
312317
Writes the EQL SQL to `supabase/migrations/00000000000000_cipherstash_eql.sql`. The all-zero timestamp ensures this migration runs before any user migrations that reference `eql_v2_encrypted`. Run `supabase db reset` (local) or `supabase migration up` (remote) to apply it.
313318
@@ -331,7 +336,7 @@ stash db upgrade --latest
331336
| `--exclude-operator-family` | Skip operator family creation |
332337
| `--latest` | Fetch latest EQL from GitHub instead of bundled |
333338
334-
The EQL install SQL is idempotent and safe to re-run. The command checks the current version, re-runs the install SQL, then reports the new version. If EQL is not installed, it suggests running `db install` instead.
339+
The EQL install SQL is idempotent and safe to re-run. The command checks the current version, re-runs the install SQL, then reports the new version. If EQL is not installed, it suggests running `eql install` instead.
335340
336341
### `db validate` — Validate encryption schema
337342
@@ -437,7 +442,7 @@ Reports:
437442
stash db test-connection
438443
```
439444
440-
Verifies the database URL in your config is valid and the database is reachable. Reports the database name, connected role, and PostgreSQL server version. Useful for debugging connection issues before running `db install`.
445+
Verifies the database URL in your config is valid and the database is reachable. Reports the database name, connected role, and PostgreSQL server version. Useful for debugging connection issues before running `eql install`.
441446
442447
### `db migrate` — Run pending encrypt config migrations
443448
@@ -451,7 +456,7 @@ Not yet implemented — placeholder for future encrypt-config migration tooling.
451456
452457
The `encrypt` group is the cutover-step toolset: it runs the database-side work that takes an existing plaintext column the rest of the way to encrypted, after the encryption-rollout PR is deployed and dual-writes are live in production. The internal event log uses `schema-addeddual-writingbackfillingbackfilledcut-overdropped` as machine-readable phase names; the user-facing story is the rollout/cutover model documented in the `stash-encryption` skill.
453458
454-
It drives the `@cipherstash/migrate` library, which records every transition in a `cipherstash.cs_migrations` table (installed by `stash db install`) and reads the user's intent from `.cipherstash/migrations.json`. This section documents the CLI surface.
459+
It drives the `@cipherstash/migrate` library, which records every transition in a `cipherstash.cs_migrations` table (installed by `stash eql install`) and reads the user's intent from `.cipherstash/migrations.json`. This section documents the CLI surface.
455460
456461
The examples below show the bare `stash` form, which works after `stash init` adds the CLI as a project dev dep. See the "CLI Usage" section above for how to invoke it through your package manager before that.
457462
@@ -639,7 +644,7 @@ if (await installer.isInstalled()) {
639644

640645
- Node.js >= 22
641646
- PostgreSQL database with sufficient permissions (see `checkPermissions()`)
642-
- A `stash.config.ts` file with a valid `databaseUrl` (or run `stash init` / `stash db install` to scaffold it)
647+
- A `stash.config.ts` file with a valid `databaseUrl` (or run `stash init` / `stash eql install` to scaffold it)
643648
- Peer dependency: `@cipherstash/stack` >= 0.6.0
644649

645650
## Common issues
@@ -650,7 +655,7 @@ The database role needs `CREATE` privileges on the database and public schema, o
650655

651656
### Config not found
652657

653-
`stash.config.ts` must be in the project root or a parent directory. The file must `export default defineConfig(...)`. The fastest fix is `stash init`, which scaffolds the config (and authenticates, installs deps, installs EQL, and writes `.cipherstash/context.json` in the same run). For a CLI-only setup, `stash db install` also scaffolds the config.
658+
`stash.config.ts` must be in the project root or a parent directory. The file must `export default defineConfig(...)`. The fastest fix is `stash init`, which scaffolds the config (and authenticates, installs deps, installs EQL, and writes `.cipherstash/context.json` in the same run). For a CLI-only setup, `stash eql install` also scaffolds the config.
654659

655660
### Supabase environments
656661

0 commit comments

Comments
 (0)