fix(cowork): add missing CLI entries and Windows default path - #1372
fix(cowork): add missing CLI entries and Windows default path#1372jh-qu wants to merge 18 commits into
Conversation
The cowork subcommands (daily, monthly, session) were missing from cli-commands.json, causing 'Unknown command cowork' at runtime even though the Rust parser already handled them.
The macOS path was hardcoded as the only default. On Windows, Claude Desktop (Store edition) stores Cowork sessions at: %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\local-agent-mode-sessions Use #[cfg(target_os = "windows")] to select the correct default per platform. COWORK_CONFIG_DIR still overrides on all platforms.
|
no API key found — this repo is configured to use To fix: add the key as a GitHub Actions secret (referenced from your workflow's Open repo secrets → · Configure model → · Setup docs → · Ask in Discord →
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (40)
✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR was auto-closed. Only contributors approved with Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply. If a maintainer replies See CONTRIBUTING.md. |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |

Summary
This PR fixes two bugs in the
feat/cowork-usage-sourcebranch (originally PR #1199, closed) to makeccusage coworkfully functional, including on Windows.Fix 1: Missing
cli-commands.jsonentriesThe cowork subcommands (
daily,monthly,session) were absent fromcli-commands.json, which is used to generate the CLI help text and command dispatch. This caused:even though the Rust parser already handled them correctly.
Fix 2: Windows default path support
paths.rsonly hardcoded the macOS path as the default:On Windows, Claude Desktop (Microsoft Store edition) stores Cowork sessions at:
Added
#[cfg(target_os = "windows")]/#[cfg(not(target_os = "windows"))]branching so the correct default is selected per platform.COWORK_CONFIG_DIRcontinues to override on all platforms.Relation to #1199 / #1200
This branch is based on
feat/cowork-usage-source(the branch from the auto-closed PR #1199) and adds the two fixes above. Closes #1200.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Makes
ccusage coworkfully functional across platforms by adding the missing CLI entries and selecting the correct default Cowork session path on Windows. Coworkdaily,monthly, andsessionnow work on macOS, Linux, and Windows;COWORK_CONFIG_DIRstill overrides.coworksubcommand entries torust/crates/ccusage-cli/src/cli-commands.jsonso help/dispatch matches the Rust parser (supportsdaily,monthly,session).%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\local-agent-mode-sessionsCOWORK_CONFIG_DIRoverrides everywhere.Written for commit 2046391. Summary will update on new commits.