iter-28: CLI UX polish from 2026-05-10 dogfooding#33
Conversation
- Standardise storage flags: `--remote-path` everywhere, `--file` for both
upload (input) and download (output, stdout if omitted). Renamed
`download --output` → `--file`.
- Standardise `stream library statistics` on `--id` (matches siblings).
- Replace numeric enum flags with named ValueEnums:
`script create --script-type {dns,cdn,middleware}` (was 0/1/2),
`storage-zone create --zone-tier {standard,edge}` (was 0/1).
- New `date` module: accepts `YYYY-MM-DD` shorthand for any datetime
flag, with clear error message naming accepted formats. Applied to
db statistics/usage, db group stats/usage, statistics, script
statistics, storage-zone statistics, video-library drm/transcribing
statistics, pull-zone statistics, stream library statistics.
- `shield event-logs --date` accepts ISO `YYYY-MM-DD` and translates to
the legacy `MM-dd-yyyy` API format client-side.
- `db delete` / `db group delete` print `Deleted database <id>` (text)
and `{"deleted": "<id>"}` (json) instead of empty headers.
- `dns zone dnssec status` text/table view now shows DS record, digest,
key tag, algorithm, and DsConfigured when DNSSEC is enabled.
- `stream library statistics` renders `N/A` for the API's `-1` "no data"
sentinel in text mode; JSON keeps the raw `-1`.
- Dogfooding playbook updated to reflect actual auth flow
(`BUNNY_API_KEY` env var + `hoppy auth check`); removed references to
the non-existent `hoppy auth login` and config-path docs.
- Decision log entry recording the storage flag rationale.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR completes iteration-28 dogfooding UX polish by introducing date normalization utilities, replacing numeric CLI flags with typed enums (ScriptTypeArg, StorageZoneTierArg), standardizing flag names (--file, --remote-path, --id), updating command handlers to normalize date inputs and handle renamed fields, and verifying changes with E2E tests. ChangesCLI UX Polish & Date Normalization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
UX consistency pass across the Hoppy CLI based on the 2026-05-10 dogfooding round, focusing on flag naming consistency, friendlier date inputs, and clearer human-readable output for a few commands.
Changes:
- Standardized several CLI flags (e.g.,
storage --remote-path,storage download --file,stream library statistics --id) and updated e2e tests accordingly. - Introduced
src/date.rsto normalize date-only inputs (YYYY-MM-DD→ midnight UTC) and translate Shield event-log dates client-side. - Improved non-JSON outputs for a few commands (DB delete confirmations, DNSSEC status DS record visibility, Stream library stats sentinel
-1→N/Ain text/table).
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/cli_stream.rs | Updates Stream library statistics flag to --id in tests. |
| tests/e2e/cli_storage.rs | Updates Storage flags (--remote-path, download --file) in tests. |
| tests/e2e/cli_script.rs | Updates script type tests from numeric to named ValueEnum (e.g., cdn). |
| src/main.rs | Registers the new date module in the binary. |
| src/lib.rs | Exposes date as a public module for crate consumers/tests. |
| src/date.rs | Adds shared date normalization helpers + unit tests. |
| src/commands/video_library.rs | Normalizes date_from/date_to before calling API. |
| src/commands/stream.rs | Renames statistics flag to --id, normalizes dates, renders engagement -1 as N/A in text/table. |
| src/commands/storage.rs | Renames ls arg to remote_path and download --output to --file. |
| src/commands/storage_zone.rs | Uses ValueEnum tier conversion and normalizes stats date range args. |
| src/commands/statistics.rs | Normalizes account statistics date range args before API call. |
| src/commands/shield.rs | Translates shield event-logs --date to legacy US format client-side. |
| src/commands/script.rs | Switches script type from numeric to ValueEnum and normalizes statistics date range args. |
| src/commands/pull_zone.rs | Normalizes pull-zone statistics date range args. |
| src/commands/dns.rs | Enhances DNSSEC status output to include DS record details when enabled. |
| src/commands/database.rs | Normalizes DB stats/usage windows; fixes delete confirmations (text + JSON). |
| src/cli.rs | Adds new ValueEnums and updates flag names/help text for affected commands. |
| hoppy-knowledgebase/iterations/iteration-28-dogfooding-ux-polish.md | Marks iteration tasks/acceptance as completed and updates checklist. |
| hoppy-knowledgebase/dogfooding/dogfooding-playbook.md | Updates auth instructions to match env-var-only auth flow. |
| hoppy-knowledgebase/decision-log.md | Records decision to standardize storage local-path flag on --file. |
| /// Returns `true` if the string starts with `YYYY-MM-DDT` (contains a `T` | ||
| /// after the date part), indicating it's already a datetime string. | ||
| fn looks_like_datetime(s: &str) -> bool { | ||
| s.len() > 10 && looks_like_iso_date(&s[..10]) && s.as_bytes()[10] == b'T' | ||
| } |
| bail!("invalid date {input:?} — accepted formats: {ISO_DATE_FORMAT} or {ISO_DATETIME_FORMAT}"); | ||
| } | ||
|
|
||
| /// Same as [`normalise_datetime`] but operates on an `Option<String>`, |
| /// Accepted date formats listed in user-facing error messages. | ||
| const ISO_DATE_FORMAT: &str = "YYYY-MM-DD"; | ||
| const ISO_DATETIME_FORMAT: &str = "YYYY-MM-DDThh:mm:ssZ"; | ||
|
|
| - [ ] All `delete` commands print a confirmation line in text mode. | ||
| - [ ] `dns zone dnssec status` text view shows DS record, digest, key tag, | ||
| - [x] No remaining `--<noun>-id` flags on `delete` subcommands. | ||
| - [x] No remaining "(0 = …, 1 = …)" help text. |
- src/date.rs: avoid &str slicing across UTF-8 codepoint boundaries in looks_like_datetime; the byte-based check now matches looks_like_iso_date and never panics on non-ASCII input. Add a regression test. - src/date.rs: widen the user-facing datetime format label from a fixed pattern to "RFC 3339 datetime", matching what the pass-through accepts. - src/date.rs: doc comment on normalise_datetime_opt referenced Option<String> but the signature takes Option<&str> — fix the doc. - dogfooding-playbook: live-api section claimed credentials are read from "the standard config", contradicting the auth section above. Both now agree: BUNNY_API_KEY env var is the only auth surface. - iteration-28 acceptance: scope the "no remaining (0 = …)" claim to script-create + storage-zone-create. Shield's numeric flags are still there and tracked separately as a follow-up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Seven small UX papercuts from the 2026-05-10 dogfooding round, grouped into one consistency pass:
--remote-patheverywhere; bothuploadanddownloaduse--filefor the local path (renameddownload --output→--file).stream library statisticsstandardised on--id.script create --script-type {dns,cdn,middleware}andstorage-zone create --zone-tier {standard,edge}.src/date.rsacceptsYYYY-MM-DDshorthand on every datetime flag and emits clear errors naming accepted formats.shield event-logs --dateaccepts ISO and translates client-side.db delete/db group deleteprint real confirmation lines;dns zone dnssec statustext view shows the full DS record when enabled;stream library statisticsrendersN/Afor the-1sentinel in text mode.BUNNY_API_KEY+hoppy auth check). Decision log entry for the storage flag choice.Test plan
cargo fmtcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --quiet(mock e2e tests updated for renamed flags)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores
--output→--file,--path→--remote-path,--library-id→--id.N/Afor missing values.Documentation