From 88f2d49b9f93a184a58ff51a61ea8293ad74acca Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sun, 5 Oct 2025 07:27:42 +0000 Subject: [PATCH] fix(model): add --yes flag to npx ccusage command Add --yes flag when calling npx to run ccusage to auto-accept prompts and avoid blocking the command execution. Fixes #125 Co-authored-by: Le He --- model/ccusage_service.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model/ccusage_service.go b/model/ccusage_service.go index cf346bf..29d2f15 100644 --- a/model/ccusage_service.go +++ b/model/ccusage_service.go @@ -237,8 +237,9 @@ func (s *ccUsageService) collectData(ctx context.Context, since time.Time) (*CCU cmd = exec.CommandContext(ctx, bunxPath, args...) slog.Debug("Using bunx to collect ccusage data") } else { - // Fall back to npx - cmd = exec.CommandContext(ctx, npxPath, args...) + // Fall back to npx with --yes flag to auto-accept prompts + npxArgs := append([]string{"--yes"}, args...) + cmd = exec.CommandContext(ctx, npxPath, npxArgs...) slog.Debug("Using npx to collect ccusage data") }