Skip to content

fix(ccusage): add --yes flag and warn when falling back to npx#1227

Merged
FlorianBruniaux merged 1 commit intortk-ai:developfrom
davidalecrim1:fix/cc-economics-hang
Apr 13, 2026
Merged

fix(ccusage): add --yes flag and warn when falling back to npx#1227
FlorianBruniaux merged 1 commit intortk-ai:developfrom
davidalecrim1:fix/cc-economics-hang

Conversation

@davidalecrim1
Copy link
Copy Markdown
Contributor

Summary

  • Fixes silent hang in rtk cc-economics when ccusage is not installed globally
  • npx prompts "Ok to proceed? (y)" before installing the package — RTK's subprocess blocks on this forever since it has no interactive stdin
  • Adding --yes auto-confirms the install
  • Added an [info] warning to stderr so users know why it may take a moment

Root Cause

build_command() falls back to npx ccusage when the binary isn't in PATH. Without --yes, npx waits for interactive confirmation that never comes.

Closes #1226

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 11, 2026

CLA assistant check
All committers have signed the CLA.

}

// Fallback: try npx
eprintln!("[info] ccusage not installed globally, fetching via npx...");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this if doesn't make sense for the CLI UX, let me know if that's the case.

@davidalecrim1 davidalecrim1 changed the base branch from master to develop April 11, 2026 15:42
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
Copy link
Copy Markdown
Collaborator

@FlorianBruniaux FlorianBruniaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean fix, tests pass.

@FlorianBruniaux FlorianBruniaux merged commit b61f672 into rtk-ai:develop Apr 13, 2026
1 check 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.

bug: the command cc-economics is hanging

3 participants