Skip to content

fix(cli): say the flag wins in eql install and eql repair --database-url help - #1982

Open
auxesis wants to merge 2 commits into
nextfrom
fix/cli-database-url-help
Open

auxesis wants to merge 2 commits into
nextfrom
fix/cli-database-url-help

Conversation

@auxesis

@auxesis auxesis commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1980

Issue: #1980

What changed

stash eql install --help and stash eql repair --help now say that --database-url wins over a literal databaseUrl in stash.config.ts. Both commands already work that way. Before, they showed the --database-url help text that other database commands share, and that text says the config literal wins.

No command's behaviour changes. This is a help-text fix.

  • src/cli/registry.ts: eql install and eql repair get their own --database-url text, in the same form fix(cli): let --database-url win in stash eql preflight #1967 uses for eql preflight. Each one spreads the shared flag and replaces only its description. The shared text stays on the commands where it is true.
  • eql verify's text, after review: it printed "Also settable via DATABASE_URL." twice, and it did not say that DATABASE_URL on its own does not skip the config. eql install now says that too.
  • src/cli/__tests__/database-url-help.test.ts: a new test. It lists every command that takes --database-url, with the value that wins in that command. It fails if a command's help says otherwise, or if a new command takes the flag and is not in the list.
  • skills/stash-cli/SKILL.md: the resolution section names the commands where the flag wins, and the eql repair flag table says repair never reads stash.config.ts, so with no flag DATABASE_URL wins there.
  • A stash patch changeset.

Which value wins, by command

Command Winner Where
eql install flag main.ts passes scaffoldConfig: 'skip' when the flag is given, so resolveInstallContext never looks for a config (commands/db/install.ts)
eql repair flag resolveRepairDatabaseUrl reads only the flag and DATABASE_URL (commands/eql/repair.ts)
eql verify flag already had its own text
eql preflight config flagWins: false on next. #1967 changes this
eql upgrade, eql status, schema build config loadStashConfig. Tracked in #1979
eql validate, db test-connection config loadStashConfig. Not listed in #1979

Overlap with #1967

#1967 also edits registry.ts, skills/stash-cli/SKILL.md line 159, and the precedence of eql preflight. Whichever PR merges second needs a small conflict fix. If #1967 merges first, move eql preflight to 'flag' in the new test.

How it was checked

  • The new test failed first, for eql install and eql repair only, then passed.
  • pnpm --filter stash build and pnpm --filter stash test: all pass.
  • pnpm run code:check: no errors.
  • stash manifest --json from the build shows the new text on both commands.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk

…url help

Both commands showed the shared --database-url help, which says a literal
databaseUrl in stash.config.ts wins over the flag. Neither loads the config
when the flag is given, so the flag wins. Give each its own help text, and add
a test that holds every command's --database-url help to the value that
command lets win.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
@auxesis auxesis added bug Something isn't working documentation Improvements or additions to documentation JavaScript Pull requests that update JavaScript code Stash CLI labels Nov 27, 2026
@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ccf866f

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

This PR includes changesets to release 11 packages
Name Type
stash Patch
@cipherstash/basic-example Patch
@cipherstash/e2e Patch
@cipherstash/stack-drizzle Patch
@cipherstash/stack-prisma Patch
@cipherstash/stack-supabase Patch
@cipherstash/stack Patch
@cipherstash/wizard Patch
@cipherstash/bench Patch
@cipherstash/prisma-example Patch
@cipherstash/test-kit 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 Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CLI help now distinguishes database URL precedence for eql install and eql repair. A test checks precedence descriptions across commands that accept --database-url. The CLI skill documentation and a patch changeset describe the help updates.

Changes: Database URL precedence help

Layer / File(s) Summary
Precedence descriptions and validation
languages/typescript/packages/cli/src/cli/registry.ts, languages/typescript/packages/cli/src/cli/__tests__/database-url-help.test.ts, skills/stash-cli/SKILL.md, .changeset/cli-database-url-help.md
The registry gives eql install and eql repair command-specific --database-url descriptions. A test checks precedence descriptions for every command that accepts the flag. The skill documentation and changeset describe the updated help.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: coderdan, tobyhede

Merge Risk: Minimal · up to 2bbcf

This updates the help text so it correctly says --database-url wins over a literal config value for eql install and eql repair. Command behavior does not change, and a test now guards the stated precedence. It is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: the help text for stash eql install and stash eql repair --database-url now states that the flag wins over a literal databaseUrl in stash.config.ts. The c…
Linked Issues check Passed Issue #1980 has four coding requirements. Each one is met at the reviewed head.

1. Help text for eql install and eql repair must say the flag wins. The PR gives both commands their own `--databas…
Out of Scope Changes check Passed All changed files serve #1980. registry.ts changes the help text for the affected commands. The new test enforces the precedence rule for every --database-url command. SKILL.md edits repeat the …
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the primary change: the help text for stash eql install and stash eql repair --database-url now states that the flag wins over a literal databaseUrl in stash.config.ts. The changeset, registry comment and per-command flag descriptions, the new test, and the SKILL.md update all support this. The title uses the conventional fix(cli) prefix and is concise and specific.

Full details: Linked Issues check

Explanation

Issue #1980 has four coding requirements. Each one is met at the reviewed head.

  1. Help text for eql install and eql repair must say the flag wins. The PR gives both commands their own --database-url text in src/cli/registry.ts. The install text says the flag bypasses config loading, so EQL installs into the named database. The repair text says the flag applies without reading stash.config.ts.
  2. Other commands keep the shared text only where config precedence is true. DATABASE_URL_FLAG stays on eql preflight, eql upgrade, eql status, eql validate, db test-connection, and schema build. These commands use loadStashConfig or flagWins: false, so the config-wins statement holds. eql verify keeps its own flag-wins text, as before.
  3. skills/stash-cli/SKILL.md and a stash patch changeset are updated, per the PR description and the change summary.
  4. A new test, src/cli/__tests__/database-url-help.test.ts, classifies every command with --database-url. It checks that config-winning commands contain the config-wins sentence and that flag-winning commands do not. It also fails when a command takes the flag but is not classified.

I read commands/eql/repair.ts at head. resolveRepairDatabaseUrl uses only the flag and DATABASE_URL, so the repair help claim is supported by code. The install claim (scaffoldConfig: 'skip' in main.ts) rests on the PR description, the test comment, and the issue's cited doc comment. I did not re-read main.ts in this review. That path is consistent with the evidence, so I do not treat it as a gap.

Full details: Out of Scope Changes check

Explanation

All changed files serve #1980. registry.ts changes the help text for the affected commands. The new test enforces the precedence rule for every --database-url command. SKILL.md edits repeat the corrected precedence, which #1980 asks for. The changeset is the patch note #1980 asks for. The PR does not change command behavior, which the issue also excludes. No unrelated change is evident in the summary. The PR does not implement #1967 preflight work. It leaves eql preflight on the shared text, which matches its current flagWins: false behavior. The overlap with #1967 is a merge-coordination note only.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI; Enforced overrides: Organization
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9354c77f-f0e7-4d67-80a8-4557b5e15ed5
Commits

Reviewing files that changed from the base of the PR and between f7166c3 and 2bbcfc0.

Files selected for processing: 4

  • .changeset/cli-database-url-help.md
  • languages/typescript/packages/cli/src/cli/__tests__/database-url-help.test.ts
  • languages/typescript/packages/cli/src/cli/registry.ts
  • skills/stash-cli/SKILL.md

Limit details: You’ve used all 2 included reviews currently available.

@auxesis
auxesis marked this pull request as ready for review November 27, 2026 06:29
@auxesis
auxesis requested a review from a team as a code owner November 27, 2026 06:29
@auxesis

auxesis commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cipherstash-agent cipherstash-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review attestation

Reviewed 2bbcfc0a · posted from Claude Code · claude-opus-5-5 · effort medium
Sources: code-review (medium) · claude-opus-5-5; mattpocock-skills:code-review (standards, spec sub-agents) · claude-opus-5-5; review-cross-check verification agents · claude-opus-5-5
Skills: code-review, company-skills:rust-security (loaded; not applicable, no Rust in the diff), mattpocock-skills:code-review, company-skills:review-cross-check, company-skills:review-post

Every finding was verified at 2bbcfc0a. The PR had no earlier review findings to cross-check against. The claims in the PR body hold: eql install --database-url never loads the config, eql repair never reads it, and the six commands still on the shared text all load stash.config.ts through loadStashConfig. The new test passes locally (10/10).

Findings (7): 1 major, 6 minor — 6 inline, 1 below.

  • languages/typescript/packages/cli/src/cli/registry.ts:411 (outside diff, pre-existing) minor eql verify's text says it "bypasses config loading entirely", then gets "Also settable via DATABASE_URL.", but only an explicit flag takes the flagWins path (resolve-diagnostic-url.ts), so DATABASE_URL=postgres://a stash eql verify with a config literal postgres://b judges b. The string also already ends with that sentence, so --help prints it twice.

Generated by Claude Code

Comment thread skills/stash-cli/SKILL.md Resolved
Spread the shared flag so name, value and env stay defined once. Drop the
install/verify cross-references, say that DATABASE_URL alone is not a
one-shot, and remove verify's duplicated 'Also settable via DATABASE_URL'.
The test now requires a positive flag-wins sentence. The skill no longer
says a config literal beats DATABASE_URL in eql repair.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk
@auxesis
auxesis requested a review from coderdan November 27, 2026 06:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation JavaScript Pull requests that update JavaScript code Stash CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stash eql install --help and eql repair --help say the config wins over --database-url, but the flag wins

2 participants