Skip to content

Five stash commands ignore --database-url when stash.config.ts sets a database #1979

Backlog

Description

@auxesis

Background

stash is the CipherStash CLI, in languages/typescript/packages/cli. Most of its database commands take --database-url, to name the database for one run. A project can also name a database in stash.config.ts, with databaseUrl. The CLI looks for that file in the current folder and in every folder above it.

#1967 made --database-url win over the config in stash eql preflight, as it already did in stash eql verify, eql install, and eql repair.

Problem

Some commands still let a literal databaseUrl in stash.config.ts win over --database-url. The #1967 agent named three: eql upgrade, eql status, and schema build. Each loads the config, and uses its literal databaseUrl even when the user passes the flag.

Two more commands do the same: eql validate and db test-connection.

So a user who names database B with the flag, from inside a project whose config names database A, works on database A. For eql upgrade, that changes a database the user did not name.

The CLI now has two rules for the same flag. A user cannot tell which rule a command follows without reading its code.

eql validate and db test-connection also fail when there is no stash.config.ts. Each one stops with exit code 1, even when the user passes --database-url. eql verify uses the flag in that case.

Proposal

  1. List every command that takes --database-url, and record which value wins in each today.
  2. Decide, for each command, whether the flag should win. The flag winning everywhere is the simplest rule to explain.
  3. Change the commands that need it, with a test for each, and a stash changeset. This changes CLI behaviour, so say so in the changeset.
  4. Make eql validate and db test-connection use --database-url when there is no stash.config.ts, as eql verify does.
  5. Update skills/stash-cli/SKILL.md and each command's help text.

Evidence

  • From the fix(cli): let --database-url win in stash eql preflight #1967 agent's report, not checked here: the three commands above let the config win.
  • Checked on next: eql validate and db test-connection also let the config win. Each passes --database-url only into loadStashConfig, and then uses the config's databaseUrl. The flag reaches that value only when the config calls resolveDatabaseUrl(), so a literal databaseUrl in the config wins.
    • eql validate: languages/typescript/packages/cli/src/commands/eql/validate.ts:843-846 loads the config with the flag, and line 858 uses config.databaseUrl.
    • db test-connection: languages/typescript/packages/cli/src/commands/db/test-connection.ts:16 loads the config with the flag, and line 19 connects to config.databaseUrl.
    • loadStashConfig (languages/typescript/packages/cli/src/config/index.ts:109-148) passes the flag only to resolveDatabaseUrl() calls inside the config file.
  • Checked on next: with no stash.config.ts, loadStashConfig exits with code 1 (languages/typescript/packages/cli/src/config/index.ts:115-131). It does this even when --database-url is given. eql verify falls back to the flag in resolve-diagnostic-url.ts:61.
  • stash eql preflight ignores --database-url when stash.config.ts sets a database — let the flag win #1966 asked whether other commands share preflight's old precedence. The answer is yes, for these five.

Activity

  1. added
    bug
    JavaScript
    on Nov 27, 2026
  2. self-assigned this
    on Nov 27, 2026
  3. changed the title [-]`stash eql upgrade`, `eql status` and `schema build` ignore `--database-url` when `stash.config.ts` sets a database[/-] [+]Five `stash` commands ignore `--database-url` when `stash.config.ts` sets a database[/+] on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

JavaScriptStash CLIbug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions