Conversation
…ges across all commands
If you hit a 404 we will show this error now:
```
Error: Permission denied or this route does not exist
Your token "{TOKEN_NAME}" has permissions: data:read
You can create a new token at:
https://dashboard.mux.com/settings/access-tokens
Then run 'mux login' to authenticate with the new token.
```
Note this detail:
As far as I can tell all 404s are all basically "Insufficient Privileges"
- /assets/:wrong_id will return 400 for *any* value of :wrong_id
```
❯ ./dist/mux assets get "HoGN5KDgq5hEdA98v33cWolrMCvSCLejgLBqI4yiA7k"
Error: 401 {"error":{"type":"invalid_parameters","messages":["Invalid external asset ID, mismatching environment"]}}
```
If you somehow truly hit a nonexistant route:
- GET /nonexistant-route
- GET /assets/:id (but your token doesn't have permissions)
Both of these return:
```
Error: 404 {"error":{"type":"not_found","messages":["The requested resource either doesn't exist or you don't have access to it."]}}
```
But with the CLI, it would be fairly hard (impossible?) to hit a "true"
404
So for all intents & purposes, we'll presume the 404 is a permission
issue and tell you what permissions the current token has and how you
can create a new one.
- hardcode 0.0.0 in dev package.json - (real version gets published based on GH tag) - surpress the update avail check in dev based on the exact 0.0.0 version
- no longer an option to replay --all (we have no limits on how many events are stored, so that's insane) - you can say `webhooks events replay <event-id>` OR - `webhooks events replay --count 10` which will replay the last 10 events in chronological order
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| lastChecked: Date.now(), | ||
| firstSeenAt, | ||
| }).catch(() => {}); // best-effort | ||
| } |
There was a problem hiding this comment.
Background cache refresh ignores CI/dev environment guards
Medium Severity
refreshUpdateCache makes a network request to npm on every invocation without checking for CI, MUX_NO_UPDATE_CHECK, version 0.0.0, or non-TTY environments. The old checkForUpdate had all these guards before doing any network I/O. Now that the architecture splits "check" and "refresh", the guards only exist in checkForUpdate but not refreshUpdateCache. In ephemeral CI environments (no persistent cache), every command invocation triggers a fetch with up to a 3-second timeout that blocks process exit, even though the update notice will never be shown.


replay --all(we have no limits on howmany events are stored, so that's insane)
webhooks events replay <event-id>ORwebhooks events replay --count 10which will replay the last 10events in chronological order
other fixes
0.0.0(prev was incorrectly1.0.0) -- the real version gets set at build/publish time and tagged with a git tag0.0.0(b/c that's a dev build)Note
Medium Risk
Touches error handling paths across many CLI commands and changes update-notice behavior at process exit, which could affect user output/exit timing and messaging if misclassified errors occur.
Overview
Centralizes CLI error handling by introducing
src/lib/errors.tsand switching most commands to callhandleCommandError, including special-casingAuthenticationErrorand treatingNotFoundErroras potentially missing permissions (fetching/whoamito print token scopes and next steps).Improves webhook tooling by changing
webhooks events replayfrom--allto--count <n>(replaying the last N events via newgetRecentEvents), while keeping single-event replay by ID;webhooks listennow detects permission failures viacheckFetchPermissionErrorand exits immediately instead of retrying.Refines update notices and versioning: repo
package.jsonversion is set to0.0.0;checkForUpdatebecomes cache-only (skipped for0.0.0) and a newrefreshUpdateCacheupdates cache in the background;src/index.tsprints the update notice on process exit so it appears even when commands error.Written by Cursor Bugbot for commit 5a230d8. This will update automatically on new commits. Configure here.