Skip to content

fix(cowork): add missing CLI entries and Windows default path - #1372

Closed
jh-qu wants to merge 18 commits into
ccusage:mainfrom
jh-qu:feat/cowork-windows-support
Closed

fix(cowork): add missing CLI entries and Windows default path#1372
jh-qu wants to merge 18 commits into
ccusage:mainfrom
jh-qu:feat/cowork-windows-support

Conversation

@jh-qu

@jh-qu jh-qu commented Jun 25, 2026

Copy link
Copy Markdown

Summary

This PR fixes two bugs in the feat/cowork-usage-source branch (originally PR #1199, closed) to make ccusage cowork fully functional, including on Windows.

Fix 1: Missing cli-commands.json entries

The cowork subcommands (daily, monthly, session) were absent from cli-commands.json, which is used to generate the CLI help text and command dispatch. This caused:

Unknown command 'cowork'

even though the Rust parser already handled them correctly.

Fix 2: Windows default path support

paths.rs only hardcoded the macOS path as the default:

~/Library/Application Support/Claude/local-agent-mode-sessions

On Windows, Claude Desktop (Microsoft Store edition) stores Cowork sessions at:

%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\local-agent-mode-sessions

Added #[cfg(target_os = "windows")] / #[cfg(not(target_os = "windows"))] branching so the correct default is selected per platform. COWORK_CONFIG_DIR continues 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.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Makes ccusage cowork fully functional across platforms by adding the missing CLI entries and selecting the correct default Cowork session path on Windows. Cowork daily, monthly, and session now work on macOS, Linux, and Windows; COWORK_CONFIG_DIR still overrides.

  • Bug Fixes
    • Added cowork subcommand entries to rust/crates/ccusage-cli/src/cli-commands.json so help/dispatch matches the Rust parser (supports daily, monthly, session).
    • Implemented OS-specific default discovery for Cowork sessions:
      • Windows: %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\local-agent-mode-sessions
      • Non-Windows keeps existing default; COWORK_CONFIG_DIR overrides everywhere.

Written for commit 2046391. Summary will update on new commits.

Review in cubic

tsergeytovarov and others added 18 commits June 1, 2026 16:40
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.
@pullfrog

pullfrog Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

no API key found — this repo is configured to use deepseek/deepseek-v4-pro, which needs DEEPSEEK_API_KEY, but the runner has no key for it.

To fix: add the key as a GitHub Actions secret (referenced from your workflow's env: block) or as a Pullfrog secret in the console — or switch this repo to a different model (free models need no key).

Open repo secrets → · Configure model → · Setup docs → · Ask in Discord →

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Rerun failed job ➔View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1733337d-4cf1-4aa1-bc51-94f026a248a3

📥 Commits

Reviewing files that changed from the base of the PR and between a98e374 and 2046391.

⛔ Files ignored due to path filters (1)
  • rust/crates/ccusage/src/snapshots/ccusage__config_schema__tests__snapshots_schema_agent_specific_option_edges.snap is excluded by !**/*.snap
📒 Files selected for processing (40)
  • apps/ccusage/README.md
  • apps/ccusage/config-schema.json
  • docs/.vitepress/config.ts
  • docs/guide/all-reports.md
  • docs/guide/claude/index.md
  • docs/guide/codex/index.md
  • docs/guide/config-files.md
  • docs/guide/configuration.md
  • docs/guide/cowork/index.md
  • docs/guide/daily-reports.md
  • docs/guide/environment-variables.md
  • docs/guide/gemini/index.md
  • docs/guide/getting-started.md
  • docs/guide/index.md
  • docs/guide/kimi/index.md
  • docs/guide/monthly-reports.md
  • docs/guide/session-reports.md
  • docs/index.md
  • docs/superpowers/plans/2026-06-01-cowork-usage-source.md
  • docs/superpowers/specs/2026-06-01-cowork-usage-source-design.md
  • nix/git-hooks.nix
  • rust/crates/ccusage-cli/src/cli-commands.json
  • rust/crates/ccusage-cli/src/parser.rs
  • rust/crates/ccusage-cli/src/tests.rs
  • rust/crates/ccusage-cli/src/types.rs
  • rust/crates/ccusage/src/adapter/all/loader.rs
  • rust/crates/ccusage/src/adapter/all/report.rs
  • rust/crates/ccusage/src/adapter/all/tests.rs
  • rust/crates/ccusage/src/adapter/all/types.rs
  • rust/crates/ccusage/src/adapter/claude/daily.rs
  • rust/crates/ccusage/src/adapter/claude/mod.rs
  • rust/crates/ccusage/src/adapter/claude/paths.rs
  • rust/crates/ccusage/src/adapter/cowork/README.md
  • rust/crates/ccusage/src/adapter/cowork/mod.rs
  • rust/crates/ccusage/src/adapter/cowork/paths.rs
  • rust/crates/ccusage/src/adapter/mod.rs
  • rust/crates/ccusage/src/config.rs
  • rust/crates/ccusage/src/config_schema.rs
  • rust/crates/ccusage/src/main.rs
  • rust/crates/ccusage/src/progress.rs
 ____________________________
< Try...catch me if you can. >
 ----------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/cowork-windows-support

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

This PR was auto-closed. Only contributors approved with lgtm can open PRs. Open an issue first.

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 lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.

See CONTRIBUTING.md.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

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.

Support Claude Desktop Cowork usage

2 participants