fix(ccusage): add --yes flag and warn when falling back to npx#1227
Merged
FlorianBruniaux merged 1 commit intortk-ai:developfrom Apr 13, 2026
Merged
Conversation
davidalecrim1
commented
Apr 11, 2026
| } | ||
|
|
||
| // Fallback: try npx | ||
| eprintln!("[info] ccusage not installed globally, fetching via npx..."); |
Contributor
Author
There was a problem hiding this comment.
We can remove this if doesn't make sense for the CLI UX, let me know if that's the case.
Fixes silent hang when ccusage is not installed globally. npx prompts for confirmation before installing the package, blocking the subprocess indefinitely. Adding --yes auto-confirms and the info message sets user expectations. Fixes rtk-ai#1226
1a750ac to
f68fa00
Compare
FlorianBruniaux
approved these changes
Apr 13, 2026
Collaborator
FlorianBruniaux
left a comment
There was a problem hiding this comment.
LGTM — clean fix, tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtk cc-economicswhenccusageis not installed globallynpxprompts "Ok to proceed? (y)" before installing the package — RTK's subprocess blocks on this forever since it has no interactive stdin--yesauto-confirms the install[info]warning to stderr so users know why it may take a momentRoot Cause
build_command()falls back tonpx ccusagewhen the binary isn't in PATH. Without--yes, npx waits for interactive confirmation that never comes.Closes #1226