Skip to content
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3b338e4
feat: monorepo
ryoppippi Sep 16, 2025
eaf533f
fix lint-staged
ryoppippi Sep 16, 2025
f283e22
fix test
ryoppippi Sep 16, 2025
317649f
ci
ryoppippi Sep 16, 2025
0ecb135
typecheck
ryoppippi Sep 16, 2025
14e5b73
pkg pr new
ryoppippi Sep 16, 2025
0edcc11
fix prepare
ryoppippi Sep 16, 2025
2e4369e
feat: add pnpm workspace configuration
ryoppippi Sep 16, 2025
2ddccd7
refactor: migrate root package.json to pnpm monorepo
ryoppippi Sep 16, 2025
42c7b5c
ci: migrate GitHub Actions workflows from bun to pnpm
ryoppippi Sep 16, 2025
b42af61
refactor: migrate workspace packages from bun to node.js/pnpm
ryoppippi Sep 16, 2025
202bb2e
refactor: update MCP server configurations for pnpm environment
ryoppippi Sep 16, 2025
41cac3d
docs: update documentation and memory files for pnpm migration
ryoppippi Sep 16, 2025
d3fd06d
chore: remove bun-specific configuration files
ryoppippi Sep 16, 2025
f09a0e1
chore: add pnpm lockfile for dependency resolution
ryoppippi Sep 16, 2025
0ba822a
chore: install bun
ryoppippi Sep 16, 2025
0d1de50
revert bun script
ryoppippi Sep 16, 2025
ec53f1a
chore: format
ryoppippi Sep 16, 2025
fbe3e85
modify scripts
ryoppippi Sep 16, 2025
e8bcf67
chore: sort package json
ryoppippi Sep 16, 2025
f733f07
fix: build script
ryoppippi Sep 16, 2025
3582034
fix: scripts
ryoppippi Sep 16, 2025
90d6ba6
manage bun version
ryoppippi Sep 16, 2025
ce7dc19
chore: remove bun from root
ryoppippi Sep 16, 2025
9ee73d3
configure node in docs
ryoppippi Sep 16, 2025
7c216e0
chore: manage jsr by pnpm
ryoppippi Sep 16, 2025
1f82c90
chore(docs): tyepcheck
ryoppippi Sep 16, 2025
f24b5b2
chore: prerelease
ryoppippi Sep 16, 2025
0abb0a0
chore: match version
ryoppippi Sep 16, 2025
a49956f
ln -s readme.md
ryoppippi Sep 16, 2025
e3f6561
chore: license ln
ryoppippi Sep 16, 2025
7713965
ln -s AGENTS.md
ryoppippi Sep 16, 2025
deeb744
unused scrripts
ryoppippi Sep 16, 2025
9997825
exluce vitepress
ryoppippi Sep 16, 2025
29586a0
Revert "exluce vitepress"
ryoppippi Sep 16, 2025
b90c88f
fix: docs tsconfig
ryoppippi Sep 16, 2025
5fdc23b
fix: vitest type
ryoppippi Sep 16, 2025
57d585f
monorepo
ryoppippi Sep 16, 2025
1798438
ci: pkg.pr.new pnpm
ryoppippi Sep 16, 2025
2d13165
fix(docs): tsconfg
ryoppippi Sep 16, 2025
bdacc38
fix: guard docs typedoc sidebar import
ryoppippi Sep 16, 2025
d808d87
chore: remove mermaid
ryoppippi Sep 17, 2025
22a936e
chore: add typescript for lsmcp
ryoppippi Sep 17, 2025
bdb13a7
chore: catalog strict
ryoppippi Sep 17, 2025
ccb13f9
chore: organize catalogs
ryoppippi Sep 17, 2025
ea772d1
chore: move build deps into catalog
ryoppippi Sep 17, 2025
6c80156
chore: add pnpm minimum release age
ryoppippi Sep 17, 2025
21e682e
chore: format
ryoppippi Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 18 additions & 25 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,34 @@ jobs:

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun lint
- run: bun typecheck
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm typecheck

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- run: pnpm install --frozen-lockfile
- name: Check jq is available
run: which jq && jq --version
- name: Create default Claude directories for tests
run: |
mkdir -p $HOME/.claude/projects
mkdir -p $HOME/.config/claude/projects
- run: bun run test
- run: pnpm run test

npm-publish-dry-run-and-upload-pkg-pr-now:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bunx pkg-pr-new@0.0.60 publish --bun
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- run: pnpm install --frozen-lockfile
- run: pnpm dlx pkg-pr-new@0.0.60 publish --pnpm './packages/*'

spell-check:
runs-on: ubuntu-latest
Expand All @@ -59,23 +53,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- run: pnpm install --frozen-lockfile
- name: Generate schema files
run: bun run generate:schema
run: pnpm run generate:schema
working-directory: packages/ccusage
- name: Check if schema files are up-to-date
Comment on lines +56 to 61
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Schema generation will fail without Bun; the generator script requires Bun.

Re‑add Bun setup before running pnpm run generate:schema, or port the script to Node first.

       - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
       - run: pnpm install --frozen-lockfile
+      - uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
       - name: Generate schema files
         run: pnpm run generate:schema
         working-directory: packages/ccusage
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- run: pnpm install --frozen-lockfile
- name: Generate schema files
run: bun run generate:schema
run: pnpm run generate:schema
working-directory: packages/ccusage
- name: Check if schema files are up-to-date
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- run: pnpm install --frozen-lockfile
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
- name: Generate schema files
run: pnpm run generate:schema
working-directory: packages/ccusage
- name: Check if schema files are up-to-date
🤖 Prompt for AI Agents
.github/workflows/ci.yaml around lines 56-61: the workflow removed the Bun setup
so the schema generator (pnpm run generate:schema) will fail because it requires
Bun; restore a Bun installation step before the Generate schema files step (for
example add an actions/setup-bun or oven-sh/setup-bun step and validate bun
--version) ensuring it runs in the CI environment and is available on PATH for
the packages/ccusage working-directory, or alternatively port the
generate:schema script to run under Node and update the workflow to use Node
instead.

run: |
if git diff --exit-code config-schema.json docs/public/config-schema.json; then
if git diff --exit-code packages/ccusage/config-schema.json docs/public/config-schema.json; then
echo "✅ Schema files are up-to-date"
else
echo "❌ Schema files are not up-to-date. Please run 'bun run generate:schema' and commit the changes."
echo "❌ Schema files are not up-to-date. Please run 'pnpm run generate:schema' and commit the changes."
echo ""
echo "Changed files:"
git diff --name-only config-schema.json docs/public/config-schema.json
git diff --name-only packages/ccusage/config-schema.json docs/public/config-schema.json
echo ""
echo "Diff:"
git diff config-schema.json docs/public/config-schema.json
git diff packages/ccusage/config-schema.json docs/public/config-schema.json
exit 1
fi
19 changes: 10 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: npm publish
on:
push:
tags:
- '*'
- "*"

env:
PACKAGE_DIR: packages/ccusage

jobs:
npm:
Expand All @@ -16,14 +19,14 @@ jobs:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"
node-version: lts/*
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
- run: npm install -g npm@latest
- run: bun install --frozen-lockfile
- run: npm publish --provenance --no-git-checks --access public
- run: pnpm install --frozen-lockfile
- run: pnpm --filter='./packages/**' publish --provenance --no-git-checks --access public
working-directory: ${{env.PACKAGE_DIR}}

Comment on lines +29 to 31
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Publishing likely to fail: missing npm auth token; filter + working-directory conflict.

  • npm publish needs NODE_AUTH_TOKEN (NPM_TOKEN secret).
  • If you intend to publish only packages/ccusage, either:
    • run from repo root with a filter, or
    • keep working-directory and drop the filter.

Option A (publish the single package from its dir):

-      - run: pnpm --filter='./packages/**' publish --provenance --no-git-checks --access public
-        working-directory: ${{env.PACKAGE_DIR}}
+      - run: pnpm publish --provenance --no-git-checks --access public
+        working-directory: ${{env.PACKAGE_DIR}}
+        env:
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Option B (multi publish from root):

-      - run: pnpm --filter='./packages/**' publish --provenance --no-git-checks --access public
-        working-directory: ${{env.PACKAGE_DIR}}
+      - run: pnpm --filter='./packages/**' publish --provenance --no-git-checks --access public
+        env:
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run: pnpm --filter='./packages/**' publish --provenance --no-git-checks --access public
working-directory: ${{env.PACKAGE_DIR}}
- run: pnpm publish --provenance --no-git-checks --access public
working-directory: ${{env.PACKAGE_DIR}}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Suggested change
- run: pnpm --filter='./packages/**' publish --provenance --no-git-checks --access public
working-directory: ${{env.PACKAGE_DIR}}
- run: pnpm --filter='./packages/**' publish --provenance --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
🤖 Prompt for AI Agents
.github/workflows/release.yaml lines 29-31: the publish step will fail because
npm publish needs an auth token and you currently mix --filter with a
working-directory which conflicts; fix by (1) injecting the NPM token into the
job environment (set NODE_AUTH_TOKEN or NPM_TOKEN from the repository secret and
ensure .npmrc uses it), and (2) choose one publishing mode: either remove the
working-directory and run the pnpm publish with --filter from the repo root, or
keep working-directory and drop the --filter flag so you publish the single
package from its directory.

release:
Expand All @@ -37,8 +40,6 @@ jobs:
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
with:
bun-version: latest
- run: bun x changelogithub@13.16.0
- run: bunx changelogithub@13.16.0
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# lsmcp cache
.lsmcp/cache

AGENTS.md
8 changes: 4 additions & 4 deletions .lsmcp/memories/symbol_index_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ RECOMMENDED USAGE:

TESTING COMMANDS:

- `bun run test:statusline:sonnet4` - Test with Claude 4 Sonnet
- `bun run test:statusline:opus4` - Test with Claude 4.1 Opus
- `bun run test:statusline:sonnet41` - Test with Claude 4.1 Sonnet
- `bun run test:statusline:all` - Run all model tests
- `pnpm run test:statusline:sonnet4` - Test with Claude 4 Sonnet
- `pnpm run test:statusline:opus4` - Test with Claude 4.1 Opus
- `pnpm run test:statusline:sonnet41` - Test with Claude 4.1 Sonnet
- `pnpm run test:statusline:all` - Run all model tests

Last updated: 2025-08-15 (Dynamic Context Limits feature)
10 changes: 6 additions & 4 deletions .mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,27 @@
"url": "https://mcp.grep.app"
},
"lsmcp": {
"command": "bun",
"command": "npx",
"args": [
"--no-install",
"lsmcp",
"-p",
"tsgo"
]
},
"@praha/byethrow": {
"type": "stdio",
"command": "bun",
"command": "npx",
"args": [
"--no-install",
"byethrow-mcp"
],
"env": {}
},
"gunshi-doc": {
"command": "bun",
"command": "npx",
"args": [
"x",
"--no-install",
"sitemcp",
"https://gunshi.dev/",
"--concurrency 10",
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions AGENTS.md
54 changes: 27 additions & 27 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,40 +49,40 @@ Always prefer indexed searches (tools with `_from_index` suffix) over reading en

**Testing and Quality:**

- `bun run test` - Run all tests (using vitest via bun, watch mode disabled)
- `pnpm run test` - Run all tests (using vitest via pnpm, watch mode disabled)
- Lint code using ESLint MCP server (available via Claude Code tools)
- `bun run format` - Format code with ESLint (writes changes)
- `bun typecheck` - Type check with TypeScript
- `pnpm run format` - Format code with ESLint (writes changes)
- `pnpm typecheck` - Type check with TypeScript

**Build and Release:**

- `bun run build` - Build distribution files with tsdown
- `bun run release` - Full release workflow (lint + typecheck + test + build + version bump)
- `pnpm run build` - Build distribution files with tsdown
- `pnpm run release` - Full release workflow (lint + typecheck + test + build + version bump)

**Development Usage:**

- `bun run start daily` - Show daily usage report
- `bun run start monthly` - Show monthly usage report
- `bun run start session` - Show session-based usage report
- `bun run start blocks` - Show 5-hour billing blocks usage report
- `bun run start statusline` - Show compact status line (Beta)
- `bun run start daily --json` - Show daily usage report in JSON format
- `bun run start monthly --json` - Show monthly usage report in JSON format
- `bun run start session --json` - Show session usage report in JSON format
- `bun run start blocks --json` - Show blocks usage report in JSON format
- `bun run start daily --mode <mode>` - Control cost calculation mode (auto/calculate/display)
- `bun run start monthly --mode <mode>` - Control cost calculation mode (auto/calculate/display)
- `bun run start session --mode <mode>` - Control cost calculation mode (auto/calculate/display)
- `bun run start blocks --mode <mode>` - Control cost calculation mode (auto/calculate/display)
- `bun run start blocks --active` - Show only active block with projections
- `bun run start blocks --recent` - Show blocks from last 3 days (including active)
- `bun run start blocks --token-limit <limit>` - Token limit for quota warnings (number or "max")
- `bun run ./src/index.ts` - Direct execution for development
- `pnpm run start daily` - Show daily usage report
- `pnpm run start monthly` - Show monthly usage report
- `pnpm run start session` - Show session-based usage report
- `pnpm run start blocks` - Show 5-hour billing blocks usage report
- `pnpm run start statusline` - Show compact status line (Beta)
- `pnpm run start daily --json` - Show daily usage report in JSON format
- `pnpm run start monthly --json` - Show monthly usage report in JSON format
- `pnpm run start session --json` - Show session usage report in JSON format
- `pnpm run start blocks --json` - Show blocks usage report in JSON format
- `pnpm run start daily --mode <mode>` - Control cost calculation mode (auto/calculate/display)
- `pnpm run start monthly --mode <mode>` - Control cost calculation mode (auto/calculate/display)
- `pnpm run start session --mode <mode>` - Control cost calculation mode (auto/calculate/display)
- `pnpm run start blocks --mode <mode>` - Control cost calculation mode (auto/calculate/display)
- `pnpm run start blocks --active` - Show only active block with projections
- `pnpm run start blocks --recent` - Show blocks from last 3 days (including active)
- `pnpm run start blocks --token-limit <limit>` - Token limit for quota warnings (number or "max")
- `node ./src/index.ts` - Direct execution for development

**MCP Server Usage:**

- `bun run start mcp` - Start MCP server with stdio transport (default)
- `bun run start mcp --type http --port 8080` - Start MCP server with HTTP transport
- `pnpm run start mcp` - Start MCP server with stdio transport (default)
- `pnpm run start mcp --type http --port 8080` - Start MCP server with HTTP transport

**Cost Calculation Modes:**

Expand All @@ -93,7 +93,7 @@ Always prefer indexed searches (tools with `_from_index` suffix) over reading en
**Environment Variables:**

- `LOG_LEVEL` - Control logging verbosity (0=silent, 1=warn, 2=log, 3=info, 4=debug, 5=trace)
- Example: `LOG_LEVEL=0 bun run start daily` for silent output
- Example: `LOG_LEVEL=0 pnpm run start daily` for silent output
- Useful for debugging or suppressing non-critical output

**Multiple Claude Data Directories:**
Expand Down Expand Up @@ -130,7 +130,7 @@ This is a CLI tool that analyzes Claude Code usage data from local JSONL files s
- Raw usage data is parsed from JSONL with timestamp, token counts, and pre-calculated costs
- Data is aggregated into daily summaries, monthly summaries, session summaries, or 5-hour billing blocks
- **Important Note on Naming**: The term "session" in this codebase has two different meanings:
1. **Session Reports** (`bun run start session`): Groups usage by project directories. What we call "sessionId" in these reports is actually derived from the directory structure (project/directory)
1. **Session Reports** (`pnpm run start session`): Groups usage by project directories. What we call "sessionId" in these reports is actually derived from the directory structure (project/directory)
2. **True Session ID**: The actual Claude Code session ID found in the `sessionId` field within JSONL entries and used as the filename ({sessionId}.jsonl)
- File structure: `projects/{project}/{sessionId}.jsonl` where:
- `{project}` is the project directory name (used for grouping)
Expand Down Expand Up @@ -199,7 +199,7 @@ This is a CLI tool that analyzes Claude Code usage data from local JSONL files s
After making any code changes, ALWAYS run these commands in parallel:

- `bun run format` - Auto-fix and format code with ESLint (includes linting)
- `bun typecheck` - Type check with TypeScript
- `pnpm typecheck` - Type check with TypeScript
- `bun run test` - Run all tests

This ensures code quality and catches issues immediately after changes.
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
Loading
Loading