Skip to content

CLI polish: help layout, security confirmations, error copy, ID value names, login onboarding (DX-5694)#31

Merged
johnpmitsch merged 11 commits into
mainfrom
dx-5694-cli-polish
Jun 12, 2026
Merged

CLI polish: help layout, security confirmations, error copy, ID value names, login onboarding (DX-5694)#31
johnpmitsch merged 11 commits into
mainfrom
dx-5694-cli-polish

Conversation

@johnpmitsch

Copy link
Copy Markdown
Collaborator

Batch of small UX fixes surfaced during manual use. One commit per item.

Linear: DX-5694

Changes

  • Help layout: -h/--help and -V/--version now list under "Global options" with the other global flags, instead of a lone "Options" section.
  • Security confirmations: all six endpoint security … remove verbs (referrer, ip, jwt, domain-mask, request-filter, ip-header) are now gated behind the mild confirmation — --yes skips, a TTY prompts, non-TTY without --yes exits 5 before any request is sent. Previously only token delete was gated. 12 new tests.
  • 5xx error copy: replaced "Quicknode API is having issues (HTTP {code})…" with a neutral "something went wrong (HTTP {code}). Please try again; if the problem persists, contact support at https://support.quicknode.com."
  • ID value names: positional ids render as <ENDPOINT_ID>, <STREAM_ID>, <WEBHOOK_ID>, <TEAM_ID> instead of a generic <ID>. Convention documented in CLAUDE.md.
  • Login onboarding: interactive qn auth login prints a short welcome with links to get an API key (dashboard.quicknode.com/api-keys) or sign up (quicknode.com/signup). Suppressed by --quiet.
  • --fix-block-reorgs: documented form is now true/false (boolish parser; 0/1 still accepted).
  • Wording: usage … --to help "Omit for now." → "Defaults to now."
  • kv naming: kv set list / kv list list are the primary verbs with ls as visible alias, matching the rest of the CLI.

Verified during triage, no change needed

  • The stale "use `qn tag` for account-wide tag management" comment exists only in an old packaged artifact under target/; current source already has the corrected text.
  • No delete-all/remove-all commands exist; tests already assert they don't parse and CLAUDE.md documents the policy.

Testing

  • cargo test — all suites pass (13 new tests: 12 confirmation gating, 1 fix-block-reorgs parsing)
  • cargo clippy --all-targets -- -D warnings, cargo fmt --check, cargo build --release — clean
  • Manual help-output checks for the layout, value names, and alias rendering

The auto-generated help/version flags rendered under a lone "Options"
heading on every help screen, separate from the real global flags.
Disable clap's built-ins and re-declare them as global args so they
list with the rest of the globals. Behavior is unchanged: -h prints
the summary, --help the long form, and -V works on subcommands via
propagate_version.
Only 'security token delete' asked for confirmation; the other six
remove verbs (referrer, ip, jwt, domain-mask, request-filter,
ip-header) deleted protection rules immediately. All now use the mild
confirmation: --yes skips, a TTY prompts, and non-TTY without --yes
exits 5 before any request is sent. Prompts name the resource and
endpoint.

Adds 12 tests (with/without --yes per command, the latter asserting
zero requests reach the mock).
"Quicknode API is having issues" assigned blame for what can be a
transient failure. Replace with a neutral message that keeps the HTTP
code for debugging and points at support:
"something went wrong (HTTP {code}). Please try again; if the problem
persists, contact support at https://support.quicknode.com."
Bare 'id' positionals rendered as a generic <ID> in usage lines.
Every id positional now declares value_name — <ENDPOINT_ID>,
<STREAM_ID>, <WEBHOOK_ID>, <TEAM_ID> — so 'qn endpoint show --help'
reads 'Usage: qn endpoint show [OPTIONS] <ENDPOINT_ID>'. Multi-word
fields (referrer_id, tag_id, …) already rendered descriptively.

Documents the convention in CLAUDE.md.
The command jumped straight to a hidden key prompt with no context.
Interactive logins now print a short welcome on stderr explaining that
an API key is needed, where it will be stored, and where to get one
(dashboard.quicknode.com/api-keys, quicknode.com/signup). Suppressed
by --quiet; not shown when --api-key is passed.
The flag took a raw 0/1 integer. It now parses as a bool via clap's
BoolishValueParser, so the documented form is true/false while 0/1
(and yes/no) keep working. The value still maps to the integer the
streams API expects.
"Omit for now." read as a temporary instruction rather than
"defaults to the current time". Now: "End time. Defaults to now."
'qn kv set ls' and 'qn kv list ls' were the only listings with 'ls' as
the primary name. Renamed to 'list' with 'ls' as a visible alias,
matching the convention everywhere else in the CLI. Both spellings
keep working; existing tests invoke 'ls' and pass via the alias.
Scope the Homebrew install section to macOS, and shorten the
authentication and environment sections: state where the key comes
from and how to log in, without the extended design rationale.
@johnpmitsch johnpmitsch merged commit a956f5c into main Jun 12, 2026
13 checks passed
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.

3 participants