Skip to content

feat(cli): rename stash db install to stash eql install#543

Open
coderdan wants to merge 2 commits into
mainfrom
dan/cip-3362-rename-npx-stash-db-install-command-to-npx-stash-eql-install
Open

feat(cli): rename stash db install to stash eql install#543
coderdan wants to merge 2 commits into
mainfrom
dan/cip-3362-rename-npx-stash-db-install-command-to-npx-stash-eql-install

Conversation

@coderdan

@coderdan coderdan commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Renames the EQL-extension commands out of the db group into a dedicated eql command group:

Old New
stash db install stash eql install
stash db upgrade stash eql upgrade
stash db status stash eql status

These three commands manage the EQL extension itself (install it, upgrade it, report its state), which is why they move together.

  • Deprecated aliases: the old db spellings still work but print a runner-aware deprecation warning pointing at the eql name, so existing scripts and published docs don't break.
  • All references updated: help text, command intros, next-step hints from init providers, error messages, the generated Supabase migration header, the setup-prompt agent instructions, the wizard's post-agent steps / prerequisites hint / agent command allowlist (stash eql added; stash db remains allowed), READMEs, the stash-cli skill, and agent doctrine.
  • Tests: existing suites updated; smoke coverage for eql routing, the unknown-subcommand path, and the deprecation warning on the db install alias.

The remaining db subcommands (push, activate, validate, migrate, test-connection) operate on the encryption schema/config rather than the extension and stay where they are.

A companion docs PR updates the pages on cipherstash/docs.

Test plan

  • pnpm test (packages/cli): 323 passed
  • pnpm test:e2e (packages/cli): 29 passed
  • pnpm test (packages/wizard): 140 passed
  • biome check: clean at error level
  • Manually exercised the built CLI: --help shows the eql group, db install/db status warn then run, eql commands run without a warning.

Summary by CodeRabbit

  • New Features
    • Added a new eql command group, including eql install, eql upgrade, and eql status.
    • Kept db install/db upgrade/db status as deprecated aliases that warn and point to the new eql commands.
  • Bug Fixes
    • Updated install, upgrade, status, and Supabase migration guidance to consistently reference stash eql ....
  • Documentation
    • Refreshed CLI, wizard, and skills docs (including help text and wizard output) to use eql.
  • Tests
    • Updated smoke, runner-aware, and migration/wizard test expectations for eql, including coverage for the deprecated db aliases.

The install command scaffolds stash.config.ts and installs the EQL
extensions, so it now lives under a dedicated `eql` command group.
`stash db install` keeps working as a deprecated alias that prints a
warning pointing at the new name.

- Add `eql` command group to the CLI with `install` as its first
  subcommand; `db install` forwards to the same implementation after a
  deprecation warning.
- Update help text, next-step hints, error messages, and the generated
  Supabase migration header to reference `stash eql install`.
- Allow `stash eql` in the wizard agent command allowlist (alongside the
  still-allowed `stash db`) and shell out to `stash eql install` in the
  wizard's post-agent steps and prerequisites hint.
- Update READMEs, the stash-cli skill, agent doctrine, and all tests;
  add smoke coverage for the new group and the deprecated alias.
@coderdan coderdan requested a review from a team as a code owner July 3, 2026 06:04
@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6ea704f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
stash Minor
@cipherstash/wizard Minor
@cipherstash/e2e Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds an eql command group alongside db, updates user-facing command text to stash eql install/upgrade/status, keeps db spellings as deprecated aliases, and refreshes init, wizard, migration, test, and documentation references to the renamed command.

Changes

CLI command rename to eql install

Layer / File(s) Summary
CLI routing and command messages
packages/cli/src/bin/main.ts, packages/cli/src/messages.ts, packages/cli/tests/e2e/smoke.e2e.test.ts
Adds eql dispatch, deprecates db aliases, updates help text, and adds unknown-subcommand and routing smoke coverage.
CLI install, status, and migration header text
packages/cli/src/commands/db/*.ts, packages/cli/src/commands/encrypt/drizzle-helper.ts, packages/cli/src/__tests__/supabase-migration.test.ts
Updates CLI intro/error strings and generated migration header wording to reference eql install, eql upgrade, and eql status.
Init providers, steps, and prompt text
packages/cli/src/commands/init/providers/..., packages/cli/src/commands/init/steps/..., packages/cli/src/commands/init/lib/setup-prompt.ts, packages/cli/src/commands/init/doctrine/AGENTS-doctrine.md, packages/cli/src/commands/init/utils.ts, packages/cli/src/commands/init/lib/__tests__/setup-prompt.test.ts
Updates init flow command strings, prompt guidance, doctrine notes, and provider tests to use eql install and eql status.
Wizard allowlists and post-agent flow
packages/wizard/src/agent/interface.ts, packages/wizard/src/lib/*.ts, packages/wizard/src/run.ts, packages/wizard/src/__tests__/*, packages/wizard/src/agent/__tests__/interface.test.ts, packages/wizard/README.md
Permits stash eql, updates post-agent and prerequisite messaging, and rewrites wizard docs and tests to use the renamed install command.
Documentation and changeset updates
.changeset/rename-db-install-to-eql-install.md, packages/cli/README.md, packages/cli/AGENTS.md, packages/migrate/README.md, packages/migrate/src/*.ts, skills/stash-cli/SKILL.md
Rewrites command references in package docs, skill docs, and migration docs to eql install, eql upgrade, and eql status, including the deprecated alias note.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

Suggested reviewers: calvinbrewer, auxesis

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: renaming the CLI install command from db to eql.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dan/cip-3362-rename-npx-stash-db-install-command-to-npx-stash-eql-install

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/cli/src/commands/db/install.ts (1)

494-504: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Include the migrations directory in the retry hint.

When subFlag is --migrations-dir, the suggested rerun command is incomplete because it omits the path value. That makes the error message non-copy-pasteable.

🔧 Suggested fix
   if (subFlag !== null && options.supabase !== true) {
-    return `\`${subFlag}\` requires \`--supabase\`. Re-run with \`eql install --supabase ${subFlag}\`.`
+    const retryFlag =
+      subFlag === '--migrations-dir'
+        ? `--migrations-dir ${options.migrationsDir}`
+        : subFlag
+    return `\`${subFlag}\` requires \`--supabase\`. Re-run with \`eql install --supabase ${retryFlag}\`.`
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/commands/db/install.ts` around lines 494 - 504, The retry
hint in the db install command is incomplete when `subFlag` is
`--migrations-dir`, because the suggested rerun omits the directory value.
Update the message built in `install.ts` around the `subFlag` check so the
`--migrations-dir` case includes `options.migrationsDir` in the returned `eql
install --supabase ...` suggestion, while keeping the existing behavior for
`--migration` and `--direct`.
🧹 Nitpick comments (1)
packages/cli/src/bin/main.ts (1)

216-251: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate unknown-subcommand handling between runEqlCommand and runDbCommand.

Both switch statements now repeat the identical default branch (log error, blank line, print full HELP, process.exit(1)). Could extract a small helper (e.g., exitWithUnknownSubcommand(label, sub)) to avoid drift as more command groups are added.

♻️ Proposed helper extraction
+function exitWithUnknownSubcommand(unknownMessage: string, sub: string | undefined) {
+  p.log.error(`${unknownMessage}: ${sub ?? '(none)'}`)
+  console.log()
+  console.log(HELP)
+  process.exit(1)
+}
+
 async function runEqlCommand(
   sub: string | undefined,
   flags: Record<string, boolean>,
   values: Record<string, string>,
 ) {
   switch (sub) {
     case 'install':
       await runInstall(flags, values)
       break
     default:
-      p.log.error(`${messages.eql.unknownSubcommand}: ${sub ?? '(none)'}`)
-      console.log()
-      console.log(HELP)
-      process.exit(1)
+      exitWithUnknownSubcommand(messages.eql.unknownSubcommand, sub)
   }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/bin/main.ts` around lines 216 - 251, The unknown-subcommand
handling is duplicated in runEqlCommand and runDbCommand, so extract the shared
default-branch behavior into a small helper such as exitWithUnknownSubcommand
and call it from both switch statements. Keep the helper responsible for logging
the messages.*.unknownSubcommand error, printing the blank line and HELP output,
and exiting, so future command groups reuse the same behavior without drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/cli/src/commands/db/install.ts`:
- Around line 494-504: The retry hint in the db install command is incomplete
when `subFlag` is `--migrations-dir`, because the suggested rerun omits the
directory value. Update the message built in `install.ts` around the `subFlag`
check so the `--migrations-dir` case includes `options.migrationsDir` in the
returned `eql install --supabase ...` suggestion, while keeping the existing
behavior for `--migration` and `--direct`.

---

Nitpick comments:
In `@packages/cli/src/bin/main.ts`:
- Around line 216-251: The unknown-subcommand handling is duplicated in
runEqlCommand and runDbCommand, so extract the shared default-branch behavior
into a small helper such as exitWithUnknownSubcommand and call it from both
switch statements. Keep the helper responsible for logging the
messages.*.unknownSubcommand error, printing the blank line and HELP output, and
exiting, so future command groups reuse the same behavior without drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 25e7f054-a56c-41dd-8d3b-fab54d6efd3f

📥 Commits

Reviewing files that changed from the base of the PR and between b650a8c and 64fdeb2.

📒 Files selected for processing (45)
  • .changeset/rename-db-install-to-eql-install.md
  • e2e/tests/package-managers.e2e.test.ts
  • packages/cli/AGENTS.md
  • packages/cli/README.md
  • packages/cli/src/__tests__/supabase-migration.test.ts
  • packages/cli/src/bin/main.ts
  • packages/cli/src/commands/db/client-scaffold.ts
  • packages/cli/src/commands/db/config-scaffold.ts
  • packages/cli/src/commands/db/detect.ts
  • packages/cli/src/commands/db/install.ts
  • packages/cli/src/commands/db/status.ts
  • packages/cli/src/commands/db/supabase-migration.ts
  • packages/cli/src/commands/db/upgrade.ts
  • packages/cli/src/commands/encrypt/drizzle-helper.ts
  • packages/cli/src/commands/init/__tests__/utils.test.ts
  • packages/cli/src/commands/init/doctrine/AGENTS-doctrine.md
  • packages/cli/src/commands/init/lib/setup-prompt.ts
  • packages/cli/src/commands/init/providers/__tests__/base.test.ts
  • packages/cli/src/commands/init/providers/__tests__/drizzle.test.ts
  • packages/cli/src/commands/init/providers/__tests__/prisma-next.test.ts
  • packages/cli/src/commands/init/providers/__tests__/supabase.test.ts
  • packages/cli/src/commands/init/providers/base.ts
  • packages/cli/src/commands/init/providers/drizzle.ts
  • packages/cli/src/commands/init/providers/prisma-next.ts
  • packages/cli/src/commands/init/providers/supabase.ts
  • packages/cli/src/commands/init/steps/build-schema.ts
  • packages/cli/src/commands/init/steps/install-deps.ts
  • packages/cli/src/commands/init/steps/install-eql.ts
  • packages/cli/src/commands/init/utils.ts
  • packages/cli/src/messages.ts
  • packages/cli/tests/e2e/runner-aware-help.e2e.test.ts
  • packages/cli/tests/e2e/smoke.e2e.test.ts
  • packages/migrate/README.md
  • packages/migrate/src/eql.ts
  • packages/migrate/src/install.ts
  • packages/wizard/README.md
  • packages/wizard/src/__tests__/post-agent.test.ts
  • packages/wizard/src/__tests__/prerequisites.test.ts
  • packages/wizard/src/agent/__tests__/interface.test.ts
  • packages/wizard/src/agent/interface.ts
  • packages/wizard/src/lib/post-agent.ts
  • packages/wizard/src/lib/prerequisites.ts
  • packages/wizard/src/lib/rewrite-migrations.ts
  • packages/wizard/src/run.ts
  • skills/stash-cli/SKILL.md

`upgrade` and `status` manage the EQL extension itself, so they move to
`stash eql upgrade` / `stash eql status` alongside `eql install`. The
old `db` spellings keep working as deprecated aliases that print a
warning, matching the `db install` treatment. Generalise the deprecation
message factory, update help text, intros, setup-prompt references,
README, skill, doctrine, and tests.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/cli/src/bin/main.ts (1)

84-111: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider surfacing deprecated db install/upgrade/status aliases in --help.

The help text no longer mentions these subcommands at all, so users won't discover the aliases exist unless they hit the runtime deprecation warning. A one-line "(deprecated, use eql ...)" note could aid discoverability for existing scripts/docs during the transition.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/bin/main.ts` around lines 84 - 111, The help output in
main.ts is missing the deprecated db install/upgrade/status aliases, so update
the command सूची shown by the CLI help to include those legacy subcommands with
a brief deprecation note pointing to the eql equivalents. Keep the change in the
help-rendering/command-list section around the existing db and eql entries so
users can discover the aliases from --help without relying on runtime warnings.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/cli/src/bin/main.ts`:
- Around line 84-111: The help output in main.ts is missing the deprecated db
install/upgrade/status aliases, so update the command सूची shown by the CLI help
to include those legacy subcommands with a brief deprecation note pointing to
the eql equivalents. Keep the change in the help-rendering/command-list section
around the existing db and eql entries so users can discover the aliases from
--help without relying on runtime warnings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bf7d6aa4-9435-4b29-a9ea-b731cb195c07

📥 Commits

Reviewing files that changed from the base of the PR and between 64fdeb2 and 6ea704f.

📒 Files selected for processing (11)
  • .changeset/rename-db-install-to-eql-install.md
  • packages/cli/README.md
  • packages/cli/src/bin/main.ts
  • packages/cli/src/commands/db/status.ts
  • packages/cli/src/commands/db/upgrade.ts
  • packages/cli/src/commands/init/doctrine/AGENTS-doctrine.md
  • packages/cli/src/commands/init/lib/__tests__/setup-prompt.test.ts
  • packages/cli/src/commands/init/lib/setup-prompt.ts
  • packages/cli/src/messages.ts
  • packages/cli/tests/e2e/smoke.e2e.test.ts
  • skills/stash-cli/SKILL.md
✅ Files skipped from review due to trivial changes (2)
  • packages/cli/src/commands/db/status.ts
  • packages/cli/src/commands/init/lib/setup-prompt.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/cli/src/commands/db/upgrade.ts
  • packages/cli/src/commands/init/doctrine/AGENTS-doctrine.md
  • packages/cli/README.md
  • packages/cli/tests/e2e/smoke.e2e.test.ts

@coderdan coderdan requested a review from calvinbrewer July 3, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant