feat(cli): rename stash db install to stash eql install#543
Conversation
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.
🦋 Changeset detectedLatest commit: 6ea704f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
📝 WalkthroughWalkthroughThe PR adds an ChangesCLI command rename to eql install
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 winInclude the migrations directory in the retry hint.
When
subFlagis--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 winDuplicate unknown-subcommand handling between
runEqlCommandandrunDbCommand.Both switch statements now repeat the identical
defaultbranch (log error, blank line, print fullHELP,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
📒 Files selected for processing (45)
.changeset/rename-db-install-to-eql-install.mde2e/tests/package-managers.e2e.test.tspackages/cli/AGENTS.mdpackages/cli/README.mdpackages/cli/src/__tests__/supabase-migration.test.tspackages/cli/src/bin/main.tspackages/cli/src/commands/db/client-scaffold.tspackages/cli/src/commands/db/config-scaffold.tspackages/cli/src/commands/db/detect.tspackages/cli/src/commands/db/install.tspackages/cli/src/commands/db/status.tspackages/cli/src/commands/db/supabase-migration.tspackages/cli/src/commands/db/upgrade.tspackages/cli/src/commands/encrypt/drizzle-helper.tspackages/cli/src/commands/init/__tests__/utils.test.tspackages/cli/src/commands/init/doctrine/AGENTS-doctrine.mdpackages/cli/src/commands/init/lib/setup-prompt.tspackages/cli/src/commands/init/providers/__tests__/base.test.tspackages/cli/src/commands/init/providers/__tests__/drizzle.test.tspackages/cli/src/commands/init/providers/__tests__/prisma-next.test.tspackages/cli/src/commands/init/providers/__tests__/supabase.test.tspackages/cli/src/commands/init/providers/base.tspackages/cli/src/commands/init/providers/drizzle.tspackages/cli/src/commands/init/providers/prisma-next.tspackages/cli/src/commands/init/providers/supabase.tspackages/cli/src/commands/init/steps/build-schema.tspackages/cli/src/commands/init/steps/install-deps.tspackages/cli/src/commands/init/steps/install-eql.tspackages/cli/src/commands/init/utils.tspackages/cli/src/messages.tspackages/cli/tests/e2e/runner-aware-help.e2e.test.tspackages/cli/tests/e2e/smoke.e2e.test.tspackages/migrate/README.mdpackages/migrate/src/eql.tspackages/migrate/src/install.tspackages/wizard/README.mdpackages/wizard/src/__tests__/post-agent.test.tspackages/wizard/src/__tests__/prerequisites.test.tspackages/wizard/src/agent/__tests__/interface.test.tspackages/wizard/src/agent/interface.tspackages/wizard/src/lib/post-agent.tspackages/wizard/src/lib/prerequisites.tspackages/wizard/src/lib/rewrite-migrations.tspackages/wizard/src/run.tsskills/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.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/cli/src/bin/main.ts (1)
84-111: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider surfacing deprecated
db install/upgrade/statusaliases 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
📒 Files selected for processing (11)
.changeset/rename-db-install-to-eql-install.mdpackages/cli/README.mdpackages/cli/src/bin/main.tspackages/cli/src/commands/db/status.tspackages/cli/src/commands/db/upgrade.tspackages/cli/src/commands/init/doctrine/AGENTS-doctrine.mdpackages/cli/src/commands/init/lib/__tests__/setup-prompt.test.tspackages/cli/src/commands/init/lib/setup-prompt.tspackages/cli/src/messages.tspackages/cli/tests/e2e/smoke.e2e.test.tsskills/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
Summary
Renames the EQL-extension commands out of the
dbgroup into a dedicatedeqlcommand group:stash db installstash eql installstash db upgradestash eql upgradestash db statusstash eql statusThese three commands manage the EQL extension itself (install it, upgrade it, report its state), which is why they move together.
dbspellings still work but print a runner-aware deprecation warning pointing at theeqlname, so existing scripts and published docs don't break.initproviders, error messages, the generated Supabase migration header, the setup-prompt agent instructions, the wizard's post-agent steps / prerequisites hint / agent command allowlist (stash eqladded;stash dbremains allowed), READMEs, thestash-cliskill, and agent doctrine.eqlrouting, the unknown-subcommand path, and the deprecation warning on thedb installalias.The remaining
dbsubcommands (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 passedpnpm test:e2e(packages/cli): 29 passedpnpm test(packages/wizard): 140 passedbiome check: clean at error level--helpshows theeqlgroup,db install/db statuswarn then run,eqlcommands run without a warning.Summary by CodeRabbit
eqlcommand group, includingeql install,eql upgrade, andeql status.db install/db upgrade/db statusas deprecated aliases that warn and point to the neweqlcommands.stash eql ....eql.eql, including coverage for the deprecateddbaliases.