Skip to content

fix(pwa): the CLI hint printed commands that no longer run - #110

Merged
ralyodio merged 1 commit into
masterfrom
fix/stale-teams-cli-hint
Jul 30, 2026
Merged

fix(pwa): the CLI hint printed commands that no longer run#110
ralyodio merged 1 commit into
masterfrom
fix/stale-teams-cli-hint

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The teams dashboard's "Connect the CLI" card was handing out commands that fail on paste.

LOGICSRC_API=https://app.logicsrc.com logicsrc login
logicsrc teams push <team> prod --env .env
logicsrc teams pull <team> prod --env .env

Wrong arity. Since #109 addressed vaults as <team> <project> <env>, push/pull take three positionals. The hint passes two, so it exits with a missing-argument error.

Redundant prefix. LOGICSRC_API=https://app.logicsrc.com sets the variable to DEFAULT_API_URL (#107) — a no-op on the hosted app that reads like a required step. Now emitted only when the origin isn't the default, i.e. the self-hosted case it exists for.

--env .env restates the option's own default, and next to the new <env> positional it made a flag and an argument look like one thing. Dropped.

Same stale two-arg form also fixed in install.sh's post-install hint, the accept-invite message, and the empty-vault prompt on the card.

CLI_HINT moves to src/lib/cli-hint.mjs so it can be tested without booting express + the database, matching how the other lib-level views are covered.

Verification

  • apps/pwa: 13/13 pass (9 pre-existing + 4 new).
  • Rendered both branches: hosted → logicsrc login; self-hosted → LOGICSRC_API=http://localhost:8080 logicsrc login.
  • node --check on pages.mjs, bash -n on install.sh.
  • Swept the tree for remaining two-arg forms — none; the docs/credential-sharing.md hits are already the correct acme web prod.

The new tests assert the argument count, not the prose, so restyling the card stays free while dropping an argument fails CI.

🤖 Generated with Claude Code

The "Connect the CLI" card handed out:

    LOGICSRC_API=https://app.logicsrc.com logicsrc login
    logicsrc teams push <team> prod --env .env
    logicsrc teams pull <team> prod --env .env

Two things are wrong with that, and both survived a release.

Since #109 addressed vaults as <team> <project> <env>, push and pull take
three positionals. The hint passes two, so pasting it exits with a missing-
argument error -- the card is not merely stale, it is broken.

The LOGICSRC_API prefix sets the variable to the value the CLI already
defaults to (DEFAULT_API_URL, #107), so on the hosted app it does nothing
while reading like a required step. It is now emitted only when the origin
is not the default, which is the case it exists for: self-hosting.

`--env .env` is dropped for the same reason -- it restates the option's own
default, and sitting next to the new <env> positional it made one flag and
one argument look like the same thing.

Same stale two-argument form fixed in the post-install hint (install.sh) and
the accept-invite message, and in the empty-vault-list prompt on the card.

CLI_HINT moves to src/lib/cli-hint.mjs so a test can assert on the rendered
commands without standing up express and the database, matching how the
other lib-level views are covered. The tests pin the argument count rather
than the prose: restyling the card stays free, dropping an argument does not.

apps/pwa: 13/13 pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit aa4a690 into master Jul 30, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

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