Skip to content

docs: migrate to VitePress documentation system - #140

Merged
ryoppippi merged 14 commits into
mainfrom
docs/vitepress-setup
Jun 22, 2025
Merged

docs: migrate to VitePress documentation system#140
ryoppippi merged 14 commits into
mainfrom
docs/vitepress-setup

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 22, 2025

Copy link
Copy Markdown
Member

Summary

This PR migrates the project documentation from simple markdown files to a comprehensive VitePress-based documentation system with the following key improvements:

Interactive Documentation Site: Replace static markdown with searchable, navigable documentation
API Documentation: Automated TypeDoc integration for complete API reference
User Guides: Comprehensive guides for all features (daily reports, live monitoring, MCP server, etc.)
Modern Deployment: Cloudflare Pages integration with automated builds
Better Organization: Structured navigation and improved content organization

Changes Made

Documentation Structure

  • ✅ Added VitePress configuration and theme setup
  • ✅ Created comprehensive user guides for all features
  • ✅ Integrated TypeDoc for automated API documentation
  • ✅ Added Cloudflare Pages deployment configuration
  • ✅ Removed outdated image assets and replaced with organized public assets

Project Configuration

  • ✅ Updated package.json with documentation dependencies and scripts
  • ✅ Updated ESLint configuration for documentation files
  • ✅ Added TypeDoc configuration for API documentation generation

Code Enhancements

  • ✅ Enhanced source code with documentation-friendly improvements
  • ✅ Updated project documentation (CLAUDE.md, README.md)
  • ✅ Improved code organization and documentation support

Documentation Features

User Guides

  • Getting Started: Installation and basic usage
  • Daily Reports: Detailed usage tracking by day
  • Monthly Reports: Long-term usage analysis
  • Session Reports: Per-session usage breakdown
  • Blocks Reports: 5-hour billing cycle tracking
  • Live Monitoring: Real-time usage monitoring
  • MCP Server: Claude Desktop integration
  • Configuration: Advanced configuration options
  • JSON Output: Programmatic data access

API Documentation

  • Automated TypeDoc generation
  • Complete API reference
  • Type definitions and examples
  • Integration with VitePress navigation

Deployment

  • Cloudflare Pages integration
  • Automated builds on push
  • Fast global CDN delivery
  • Custom domain support

Testing

The documentation system has been tested with:

  • ✅ VitePress dev server functionality
  • ✅ Documentation build process
  • ✅ TypeDoc API generation
  • ✅ Cloudflare Pages deployment configuration
  • ✅ All existing functionality remains intact

Migration Benefits

  1. Better User Experience: Searchable, navigable documentation with modern UI
  2. Automated Maintenance: API docs stay in sync with code changes
  3. Professional Presentation: Clean, modern documentation site
  4. SEO Friendly: Better discoverability and search engine optimization
  5. Mobile Responsive: Works perfectly on all devices
  6. Fast Loading: Optimized for performance with static site generation

This migration sets up a solid foundation for project documentation that will scale with the project s growth and provide users with an excellent documentation experience.

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive documentation site for the tool, including guides on installation, configuration, reporting features, cost calculation modes, live monitoring, MCP server integration, JSON output, related projects, and sponsorship.
    • Added a new documentation homepage and structured navigation for easier access to guides and API references.
    • Enabled JSON output for all report types, with integration examples for programmatic use.
  • Documentation

    • Added detailed user and developer guides covering all major features, usage scenarios, troubleshooting, and advanced options.
    • Provided guidelines for documentation contributions, including screenshot usage and accessibility requirements.
    • Simplified and condensed the main README, now pointing users to the external documentation site for full details.
  • Chores

    • Added configuration files and scripts for building, deploying, and previewing the documentation site.
    • Updated project and workspace configuration to support documentation management and exclude documentation files from linting.
  • Style

    • Improved code documentation with detailed JSDoc comments across multiple source files for better clarity and maintainability.

Remove outdated image files from docs directory:

- blocks-live.png

- logo.png

- logo.svg

- mcp-claude-desktop.avif

- screenshot.png

These assets are being replaced with VitePress documentation structure
Add comprehensive VitePress-based documentation:

- VitePress configuration and theme setup

- Complete API documentation generation with TypeDoc

- User guides for daily reports, live monitoring, MCP server

- Cloudflare Pages deployment configuration

- Documentation build and update scripts

This replaces the old markdown-only documentation with

an interactive, searchable documentation site
Update project configuration files to support VitePress documentation:

- package.json: add documentation dependencies and scripts

- bun.lock: lock file updates for new dependencies

- eslint.config.js: configuration updates

These changes enable the documentation build pipeline

and maintain code quality standards
Update source code files to support documentation generation:

- _macro.ts: macro utilities for documentation

- calculate-cost.ts: cost calculation improvements

- commands/blocks.ts: blocks command enhancements

- data-loader.ts: data loading optimizations

- debug.ts: debug functionality updates

- index.ts: main entry point improvements

- logger.ts: logging system enhancements

- mcp.ts: MCP server functionality updates

- pricing-fetcher.ts: pricing data fetching improvements

These changes improve code organization, add documentation

support, and enhance the overall functionality
Update core documentation files:

- CLAUDE.md: enhanced development guidelines and architecture notes

- README.md: updated project description and usage instructions

These updates align the documentation with the new VitePress

structure and provide clearer guidance for development
@coderabbitai

coderabbitai Bot commented Jun 22, 2025

Copy link
Copy Markdown

Warning

Rate limit exceeded

@ryoppippi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 508daa9 and d06e6b1.

📒 Files selected for processing (3)
  • docs/guide/daily-reports.md (1 hunks)
  • docs/guide/index.md (1 hunks)
  • docs/guide/monthly-reports.md (1 hunks)

Walkthrough

This update introduces a comprehensive documentation system for the ccusage project, including a new VitePress-based documentation site, detailed user and configuration guides, API documentation generation, and supporting scripts and configurations. The README is condensed to a minimal overview, and internal code files receive improved documentation and import clarity without functional changes.

Changes

File(s) Change Summary
docs/.gitignore, docs/package.json, docs/tsconfig.json, docs/typedoc.config.mjs, docs/wrangler.jsonc, docs/index.ts Added documentation project configuration, build scripts, ignore patterns, and deployment settings.
docs/.vitepress/config.ts Introduced VitePress site configuration with theming, navigation, sidebar, plugins, and editing features.
docs/index.md, docs/guide/*.md, docs/guide/sponsors.md, docs/guide/related-projects.md Added comprehensive user, configuration, feature, and sponsor guides, including a new homepage and related projects listing.
docs/update-api-index.mjs Added a Node.js script to post-process API docs index and constants page with descriptive text and disclaimers.
typedoc.json Added TypeDoc configuration for API documentation generation with custom grouping and output settings.
README.md Replaced detailed manual with a concise overview, basic usage, and external documentation reference.
CLAUDE.md Added a "Documentation Guidelines" section for screenshot usage and accessibility requirements.
package.json Added workspace configuration for documentation, and new scripts for building, deploying, and previewing docs.
eslint.config.js Updated to ignore all files under the docs/ directory.
src/calculate-cost.ts, src/data-loader.ts, src/debug.ts, src/index.ts, src/logger.ts, src/mcp.ts, src/pricing-fetcher.ts Added or improved file-level JSDoc comments; clarified type-only imports for better type safety and documentation.
src/_macro.ts, src/commands/blocks.ts Clarified type-only imports for improved type correctness; no logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DocsSite (VitePress)
    participant Guides/API
    participant MCP Server
    participant ccusage CLI

    User->>DocsSite: Visit documentation site
    DocsSite->>Guides/API: Render navigation, guides, API docs
    User->>Guides/API: Read usage/configuration/API info
    User->>ccusage CLI: Run commands as per documentation
    ccusage CLI->>MCP Server: (Optional) Integrate via MCP as documented
    Note over User,DocsSite: Documentation guides user through installation, usage, configuration, and integration.
Loading

Possibly related PRs

  • ryoppippi/ccusage#52: Implements detailed model breakdowns and usage details in reports; the current documentation changes describe and support these features.

Poem

🐇
A warren of docs, neat and new,
Guides for every bunny and you!
From blocks to sessions, cost to code,
Now every burrow knows the mode.
With VitePress fields and markdown bright,
Hop in—your ccusage future’s light!
📚✨


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@socket-security

socket-security Bot commented Jun 22, 2025

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtypedoc-vitepress-theme@​1.1.2841007080100
Addedvitepress-plugin-mermaid@​2.0.171001008178100
Addedtypedoc-plugin-markdown@​4.7.01001007894100
Addedvitepress@​1.6.3981008393100
Addedvitepress-plugin-llms@​1.5.18510010096100
Addedvitepress-plugin-group-icons@​1.6.09010010092100
Addedwrangler@​4.20.5981009496100
Addedtypedoc@​0.28.51001009795100

View full report

@ryoppippi
ryoppippi requested a review from Copilot June 22, 2025 00:47
@pkg-pr-new

pkg-pr-new Bot commented Jun 22, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/ryoppippi/ccusage@140

commit: d06e6b1

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary of Changes

Hello @ryoppippi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly overhauls the project's documentation infrastructure. The primary goal is to enhance the user experience by providing a modern, well-organized, and easily discoverable documentation portal. This change not only improves how users interact with the project's guides and API references but also streamlines the documentation maintenance process for developers.

Highlights

  • Documentation System Migration: The project's documentation has been migrated from simple Markdown files to a comprehensive VitePress-based system, offering an interactive, searchable, and navigable documentation site.
  • Automated API Documentation: Integrated TypeDoc for automated generation of a complete API reference, ensuring API documentation stays in sync with code changes.
  • Comprehensive User Guides: Added extensive user guides covering all features, including daily/monthly/session/blocks reports, live monitoring, MCP server integration, and configuration options.
  • Modern Deployment & Organization: Configured Cloudflare Pages for automated builds and fast global CDN delivery, alongside improved content organization and structured navigation within the new documentation site.
  • Project Configuration Updates: Updated package.json with new documentation dependencies and scripts, adjusted ESLint configuration to include documentation files, and added TypeDoc configuration for API generation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the project documentation from plain markdown to a fully featured VitePress-based system, while also integrating automated API documentation with TypeDoc and enhancing deployment and configuration processes. Key changes include:

  • Conversion of documentation files to VitePress formats along with new configuration files and scripts.
  • Integration of TypeDoc via new configuration files and update scripts.
  • Updates to project configuration files (package.json, ESLint, etc.) to support the new documentation workflow.

Reviewed Changes

Copilot reviewed 37 out of 46 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
typedoc.json New TypeDoc configuration for API docs integration.
src/*.ts files Added or updated header comments and import adjustments.
package.json, eslint.config.js Updated project configuration to support documentation workspaces.
docs/** Migration of markdown files into a VitePress structure with new guides, configuration, and deployment scripts.
CLAUDE.md Updated documentation guidelines with new screenshot and asset instructions.
Comments suppressed due to low confidence (1)

docs/typedoc.config.mjs:26

  • Consider using a consistent naming convention for the group order by using 'Classes' instead of 'Class' to match the naming used in other configuration files.
	groupOrder: ['Variables', 'Functions', 'Class'],

Comment thread docs/update-api-index.mjs Outdated
Comment on lines +36 to +38
const oldPattern = `| [${module}](${linkPath}) | - |`;
const newPattern = `| [${module}](${linkPath}) | ${description} |`;
content = content.replace(oldPattern, newPattern);

Copilot AI Jun 22, 2025

Copy link

Choose a reason for hiding this comment

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

The current fixed-string matching for updating the API index may break if the formatting changes; consider using a regular expression for more robust and maintainable matching.

Suggested change
const oldPattern = `| [${module}](${linkPath}) | - |`;
const newPattern = `| [${module}](${linkPath}) | ${description} |`;
content = content.replace(oldPattern, newPattern);
const oldPattern = new RegExp(`\\|\\s*\\[${module}\\]\\(${linkPath}\\)\\s*\\|\\s*-\\s*\\|`, 'g');
content = content.replace(oldPattern, `| [${module}](${linkPath}) | ${description} |`);

Copilot uses AI. Check for mistakes.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 22, 2025

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide d06e6b1 Commit Preview URL Jun 22 2025, 01:05 AM

Replace console.log with console.error in update-api-index.mjs

to comply with eslint no-console rule that only allows

console.warn and console.error methods

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

Excellent pull request migrating documentation to VitePress. I've found a few minor issues, mostly related to consistency, broken links, and potentially redundant configuration. Addressing these will help polish the new documentation site and improve maintainability.

Comment thread docs/.vitepress/config.ts Outdated
['meta', { property: 'og:locale', content: 'en' }],
['meta', { property: 'og:title', content: 'ccusage | Claude Code Usage Analysis' }],
['meta', { property: 'og:site_name', content: 'ccusage' }],
['meta', { property: 'og:image', content: 'https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/logo.svg' }],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The og:image URL should be updated to reflect the new path of the logo, which is now in the docs/public/ directory.

Suggested change
['meta', { property: 'og:image', content: 'https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/logo.svg' }],
['meta', { property: 'og:image', content: 'https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/logo.svg' }],

Comment thread docs/guide/configuration.md Outdated
echo $CLAUDE_CONFIG_DIR

# Test with explicit path
ccusage daily --path /path/to/claude/projects

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The example uses a --path command-line argument, but the tool uses the CLAUDE_CONFIG_DIR environment variable to specify custom paths. Consider replacing this with an example that uses the CLAUDE_CONFIG_DIR environment variable for clarity.

Suggested change
ccusage daily --path /path/to/claude/projects
# Test with explicit environment variable
export CLAUDE_CONFIG_DIR="/path/to/claude/projects"
ccusage daily

Comment thread docs/guide/index.md Outdated

## Acknowledgments

Thanks to [@milliondev](https://note.com/milliondev) for the [original concept and approach](https://note.com/milliondev/n/n872c1c5b3ed8) to Claude Code usage analysis.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The link to the "original concept and approach" article appears to be incorrect. Please verify and correct the link to ensure it points to the right resource.

Suggested change
Thanks to [@milliondev](https://note.com/milliondev) for the [original concept and approach](https://note.com/milliondev/n/n872c1c5b3ed8) to Claude Code usage analysis.
Thanks to [@milliondev](https://note.com/milliondev) for the [original concept and approach](https://note.com/milliondev/n/n1d018da2d769) to Claude Code usage analysis.

Comment thread docs/guide/library-usage.md Outdated
Comment on lines +45 to +48
const totals = calculateTotals(usageData);

// Get total tokens from usage entries
const totalTokens = getTotalTokens(usageEntries);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The variables usageData and usageEntries are used in these examples without being defined. Please provide a more complete, self-contained example.

Suggested change
const totals = calculateTotals(usageData);
// Get total tokens from usage entries
const totalTokens = getTotalTokens(usageEntries);
// Assume 'usageEntries' is an array of usage data objects
const totals = calculateTotals(usageEntries);
// Get total tokens from the same entries
const totalTokens = getTotalTokens(usageEntries);

Comment thread docs/guide/monthly-reports.md Outdated

1. [Session Reports](/guide/session-reports) to identify high-cost conversations
2. [Live Monitoring](/guide/live-monitoring) to track real-time usage
3. [Custom Scripts](/examples/custom-scripts) for automated analysis

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The link to [Custom Scripts](/examples/custom-scripts) appears to be broken, as there is no /examples/ directory within the docs folder. Please either remove this link or create the corresponding documentation page.

Comment on lines +123 to +151
{
"sessions": [
{
"sessionId": "abc123-def",
"inputTokens": 4512,
"outputTokens": 350846,
"cacheCreationTokens": 512,
"cacheReadTokens": 1024,
"totalTokens": 356894,
"totalCost": 156.40,
"lastActivity": "2025-06-21",
"modelsUsed": ["opus-4", "sonnet-4"],
"modelBreakdowns": [
{
"model": "opus-4",
"inputTokens": 2000,
"outputTokens": 200000,
"totalCost": 95.50
}
]
}
],
"totals": {
"inputTokens": 9174,
"outputTokens": 720546,
"totalCost": 336.58
}
}
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The JSON structure shown in this example is inconsistent with the structure documented in json-output.md. Please update this example to match the structure defined in json-output.md.

Comment thread docs/index.md
Comment on lines +24 to +35
- icon: 📅
title: Monthly Reports
details: Analyze usage patterns over monthly periods with cost tracking
- icon: 💬
title: Session Reports
details: Group usage by conversation sessions for detailed analysis
- icon: ⏰
title: 5-Hour Blocks
details: Track usage within Claude's billing windows with active monitoring
- icon: 📈
title: Live Monitoring
details: Real-time dashboard with progress bars and cost projections

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Several features in this list are missing links to their corresponding guide pages, while others have them. For a better user experience and easier navigation, consider adding links for all features that have a dedicated documentation page.

Suggested change
- icon: 📅
title: Monthly Reports
details: Analyze usage patterns over monthly periods with cost tracking
- icon: 💬
title: Session Reports
details: Group usage by conversation sessions for detailed analysis
- icon: ⏰
title: 5-Hour Blocks
details: Track usage within Claude's billing windows with active monitoring
- icon: 📈
title: Live Monitoring
details: Real-time dashboard with progress bars and cost projections
- icon: 📅
title: Monthly Reports
details: Analyze usage patterns over monthly periods with cost tracking
link: /guide/monthly-reports
- icon: 💬
title: Session Reports
details: Group usage by conversation sessions for detailed analysis
link: /guide/session-reports
- icon: ⏰
title: 5-Hour Blocks
details: Track usage within Claude's billing windows with active monitoring
link: /guide/blocks-reports
- icon: 📈
title: Live Monitoring
details: Real-time dashboard with progress bars and cost projections
link: /guide/live-monitoring

Comment thread eslint.config.js Outdated
},
ignores: [
'docs/api/**',
'docs/docs/**',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The ignore path 'docs/docs/**' seems unusual. If it's not needed, it might be best to remove it to avoid confusion.

Comment thread typedoc.json Outdated
Comment on lines +1 to +68
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": [
"src/index.ts",
"src/data-loader.ts",
"src/calculate-cost.ts",
"src/mcp.ts",
"src/_types.ts"
],
"out": "docs/api",
"hideGenerator": true,
"disableSources": false,
"sourceLinkTemplate": "https://github.com/ryoppippi/ccusage/blob/{gitRevision}/{path}#L{line}",
"gitRevision": "main",
"readme": "none",
"excludePrivate": true,
"excludeProtected": true,
"excludeInternal": true,
"categorizeByGroup": true,
"categoryOrder": [
"Data Loading",
"Cost Calculation",
"MCP Integration",
"Type Definitions",
"*"
],
"groupOrder": [
"Functions",
"Classes",
"Interfaces",
"Type Aliases",
"Variables"
],
"sort": [
"source-order"
],
"kindSortOrder": [
"Document",
"Project",
"Module",
"Namespace",
"Enum",
"EnumMember",
"Class",
"Interface",
"TypeAlias",
"Constructor",
"Property",
"Variable",
"Function",
"Accessor",
"Method",
"Parameter",
"TypeParameter",
"TypeLiteral",
"CallSignature",
"ConstructorSignature",
"IndexSignature",
"GetSignature",
"SetSignature"
],
"navigation": {
"includeCategories": true,
"includeGroups": true
},
"searchInComments": true,
"cleanOutputDir": true
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This typedoc.json file at the root of the project seems redundant, as there is another TypeDoc configuration file at docs/typedoc.config.mjs. If this root typedoc.json is not being used, consider removing it to keep the project configuration clean.

Exclude docs/** from ESLint to avoid build-dependent linting issues:

- docs directory contains generated content and VitePress config

- TypeDoc sidebar and API files are generated during build

- Prevents CI lint failures when docs are not yet built
Update og:image meta tag to point to correct logo location

Changes logo path from docs/logo.svg to docs/public/logo.svg
Replace incorrect --path argument with CLAUDE_CONFIG_DIR environment variable

Fix undefined variables in library usage example for consistency
Replace fragile fixed-string matching with regex pattern

Makes the script more resilient to formatting changes in markdown tables

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (5)
docs/index.md (1)

24-36: Missing documentation links for features.
Several feature items lack link properties, which hinders navigation to their detailed guides. Please add links for:

  • Monthly Reports (/guide/monthly-reports)
  • Session Reports (/guide/session-reports)
  • 5-Hour Blocks (/guide/blocks-reports)
  • Live Monitoring (/guide/live-monitoring)
typedoc.json (1)

1-68: Clarify the relationship between TypeDoc configurations.

This configuration duplicates some functionality with docs/typedoc.config.mjs. Consider consolidating to a single configuration file or clearly documenting when each should be used to avoid maintenance confusion.

docs/guide/index.md (1)

99-99: Fix the incorrect link to the original concept.

The link to the "original concept and approach" article appears to be incorrect. Please verify and correct the link to ensure it points to the right resource.

docs/.vitepress/config.ts (1)

21-21: Duplicate: OG image path updated
The og:image meta tag now correctly points to docs/public/logo.svg via CDN, matching the new asset location.

docs/guide/session-reports.md (1)

123-151: Review JSON example for consistency with json-output.md
The JSON structure shown here appears inconsistent with the schema documented in json-output.md. Please update this example to match the defined JSON output format.

🧹 Nitpick comments (28)
docs/index.ts (1)

1-5: Add documentation to clarify the purpose of this export.

This appears to be a minimal API endpoint or entry point, but the purpose isn't clear from the code. Consider adding JSDoc comments to explain when and how this fetch method is intended to be used.

+/**
+ * Minimal API endpoint for the documentation site
+ * @returns Response containing the project name
+ */
 export default {
 	fetch() {
 		return new Response('ccusage');
 	},
 };
package.json (1)

40-43: Streamline docs scripts
Consider using Bun’s --cwd flag instead of cd to avoid shell-specific commands and improve cross-platform compatibility.

- "docs:build": "cd docs && bun run build",
- "docs:deploy": "cd docs && bun run deploy",
- "docs:dev": "cd docs && bun run dev",
- "docs:preview": "cd docs && bun run preview",
+ "docs:build": "bun --cwd docs run build",
+ "docs:deploy": "bun --cwd docs run deploy",
+ "docs:dev": "bun --cwd docs run dev",
+ "docs:preview": "bun --cwd docs run preview",
docs/guide/sponsors.md (2)

7-8: Add alt text to sponsor badge
Images should include an alt attribute for accessibility (e.g., alt="GitHub Sponsors badge").

- <img src="https://cdn.jsdelivr.net/gh/ryoppippi/sponsors@main/sponsors.svg">
+ <img src="https://cdn.jsdelivr.net/gh/ryoppippi/sponsors@main/sponsors.svg" alt="GitHub Sponsors badge">

13-13: Use hyphen in compound adjective
Apply a hyphen for the compound modifier: open-source projects.

- support the development of ccusage and other open source projects.
+ support the development of ccusage and other open-source projects.
README.md (1)

14-15: Add alt text for screenshot.
The screenshot image lacks an alt attribute, which is required for accessibility.

Proposed fix:

- <img src="https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/screenshot.png">
+ <img src="https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/screenshot.png" alt="ccusage CLI screenshot">
docs/package.json (1)

4-4: Consider using a more appropriate version number.

The version 15.0.0 seems arbitrary for a documentation package. Consider using 1.0.0 or aligning with the main package version if this docs package version should track the main project.

docs/guide/index.md (1)

92-92: Remove repeated adverb for better readability.

The word "only" appears twice in this sentence, making it awkward to read.

-- **Local Files Only** - Only analyzes data from your current machine
+- **Local Files Only** - Analyzes data from your current machine
docs/guide/configuration.md (2)

5-26: Suggest documenting the CCUSAGE_OFFLINE environment variable

You reference offline mode in CI/CD examples via export CCUSAGE_OFFLINE=1, but it isn’t described here. Consider adding a brief entry under Environment Variables for CCUSAGE_OFFLINE to improve discoverability.


57-77: Use VitePress code-group for CLI examples

To maintain consistency with other guides (e.g., installation), wrap related command examples in a ::: code-group block instead of individual fences. This enhances readability and navigation in the VitePress UI.

docs/guide/daily-reports.md (2)

98-109: Specify the language for the ASCII table block

The daily report breakdown table is currently in a generic fenced block. Add a language specifier (e.g., ```text) to improve syntax highlighting and satisfy lint rules (MD040).


173-179: Consider cross-platform date example

The date -d '7 days ago' syntax works on GNU date but not on macOS. You might add a macOS alternative (e.g., date -v -7d +%Y%m%d) or note platform differences.

docs/guide/json-output.md (2)

27-51: Replace tabs with spaces in JSON examples

The JSON code blocks use hard tabs for indentation, triggering markdownlint warnings (MD010). Convert to spaces for consistent formatting.


205-236: Apply consistent spacing in breakdown JSON sample

Similarly, the per-model breakdown JSON snippet contains hard tabs. Standardize on spaces to ensure consistent docs formatting.

docs/guide/mcp-server.md (1)

15-16: Minor grammar: add comma for clarity

In “The stdio transport is ideal for local integration where the client directly spawns the process.” consider adding a comma after “integration” for readability:

-The stdio transport is ideal for local integration where the client directly spawns the process.
+The stdio transport is ideal for local integration, where the client directly spawns the process.
docs/guide/monthly-reports.md (2)

13-13: Specify code block language for Example Output
The fenced block showing the ASCII table lacks a language label. Mark it as plain text for clarity and lint compliance:

- ```
+ ```text

123-132: Replace hard tabs with spaces in JSON example
The JSON snippet uses tab characters for indentation, which can fail lint rules. Convert to spaces (e.g., 2 spaces per level) to maintain consistency:

- 	{
+   {
docs/guide/live-monitoring.md (2)

65-66: Use en dash for numeric ranges
Replace hyphens in range descriptors with en dashes for typographic correctness:

- **0.5-2 seconds**
+ **0.5–2 seconds**
- **5-10 seconds**
+ **5–10 seconds**

229-231: Specify language for plain output block
The fenced block showing No active session found… is untyped. Add a label like text to improve readability and satisfy lint rules:

- ```
+ ```text
docs/guide/custom-paths.md (2)

142-142: Improve readability by adding a comma
Consider inserting a comma for clarity:

- Invalid paths are automatically skipped with debug information available.
+ Invalid paths are automatically skipped, with debug information available.

295-310: Replace hard tabs with spaces in JSON example
The MCP integration JSON snippet uses tab characters for indentation. Convert these to spaces (e.g., 2 spaces per level) to ensure consistent formatting and lint compliance:

- \t"mcpServers": {
+   "mcpServers": {
docs/guide/blocks-reports.md (4)

7-9: Specify code block language for Basic Usage
The CLI command example is untyped. Label the block as bash to improve syntax highlighting:

- ```
+ ```bash

13-36: Label ASCII output block as plaintext
The example output block lacks a language spec. Use text or plaintext for clarity and lint compliance:

- ```
+ ```text

120-121: Use en dash for numeric ranges
Replace hyphens with en dashes in range descriptions for consistency:

- every 1-60 seconds
+ every 1–60 seconds

308-316: Specify language for gap detection table
The fenced block showing the gap detection table is untyped. Add text to improve readability and satisfy lint rules:

- ```
+ ```text
docs/guide/cost-modes.md (1)

40-48: Specify language for ASCII table code fences
The ASCII art tables are fenced with ``` but lack a language identifier. Adding a language (e.g., text) will enable proper formatting and improve readability.

Also applies to: 75-83, 109-118

docs/guide/session-reports.md (3)

13-30: Add language spec to ASCII table code block
The first ASCII art table after “Example Output” is fenced with ``` but missing a language (e.g., text). Please add it for proper syntax highlighting.


102-112: Add language spec to breakdown ASCII table
The session breakdown example’s ASCII table uses a plain ``` fence. Include a language identifier (e.g., text) to improve formatting.


124-149: Replace hard tabs with spaces
Indentation in the JSON example uses hard tabs, which triggers markdownlint warnings. Convert these to spaces to adhere to style guidelines.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6268af1 and 508daa9.

⛔ Files ignored due to path filters (6)
  • bun.lock is excluded by !**/*.lock
  • docs/public/blocks-live.png is excluded by !**/*.png
  • docs/public/favicon.svg is excluded by !**/*.svg
  • docs/public/logo.png is excluded by !**/*.png
  • docs/public/logo.svg is excluded by !**/*.svg
  • docs/public/screenshot.png is excluded by !**/*.png
📒 Files selected for processing (39)
  • CLAUDE.md (1 hunks)
  • README.md (3 hunks)
  • docs/.gitignore (1 hunks)
  • docs/.vitepress/config.ts (1 hunks)
  • docs/guide/blocks-reports.md (1 hunks)
  • docs/guide/configuration.md (1 hunks)
  • docs/guide/cost-modes.md (1 hunks)
  • docs/guide/custom-paths.md (1 hunks)
  • docs/guide/daily-reports.md (1 hunks)
  • docs/guide/getting-started.md (1 hunks)
  • docs/guide/index.md (1 hunks)
  • docs/guide/installation.md (1 hunks)
  • docs/guide/json-output.md (1 hunks)
  • docs/guide/library-usage.md (1 hunks)
  • docs/guide/live-monitoring.md (1 hunks)
  • docs/guide/mcp-server.md (1 hunks)
  • docs/guide/monthly-reports.md (1 hunks)
  • docs/guide/related-projects.md (1 hunks)
  • docs/guide/session-reports.md (1 hunks)
  • docs/guide/sponsors.md (1 hunks)
  • docs/index.md (1 hunks)
  • docs/index.ts (1 hunks)
  • docs/package.json (1 hunks)
  • docs/tsconfig.json (1 hunks)
  • docs/typedoc.config.mjs (1 hunks)
  • docs/update-api-index.mjs (1 hunks)
  • docs/wrangler.jsonc (1 hunks)
  • eslint.config.js (1 hunks)
  • package.json (1 hunks)
  • src/_macro.ts (1 hunks)
  • src/calculate-cost.ts (1 hunks)
  • src/commands/blocks.ts (2 hunks)
  • src/data-loader.ts (2 hunks)
  • src/debug.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/logger.ts (1 hunks)
  • src/mcp.ts (1 hunks)
  • src/pricing-fetcher.ts (1 hunks)
  • typedoc.json (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/guide/getting-started.md

[uncategorized] ~72-~72: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...e these features: 1. Monthly Reports - See usage aggregated by month 2. *...

(HYPHENATED_LY_ADVERB_ADJECTIVE)

docs/guide/json-output.md

[uncategorized] ~148-~148: Loose punctuation mark.
Context: ...criptions ### Common Fields - models: Array of Claude model names used - `inp...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~160-~160: Loose punctuation mark.
Context: ...fic Fields #### Daily Reports - date: Date in YYYY-MM-DD format #### Monthly...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~164-~164: Loose punctuation mark.
Context: ... format #### Monthly Reports - month: Month in YYYY-MM format #### Session R...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~168-~168: Loose punctuation mark.
Context: ...ormat #### Session Reports - session: Session identifier - lastActivity: Da...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~173-~173: Loose punctuation mark.
Context: ...ion #### Blocks Reports - blockStart: ISO timestamp of block start - `blockEn...

(UNLIKELY_OPENING_PUNCTUATION)

docs/guide/live-monitoring.md

[typographical] ~67-~67: If specifying a range, consider using an en dash instead of a hyphen.
Context: ...ctive monitoring during heavy usage - 5-10 seconds: For casual monitoring or slo...

(HYPHEN_TO_EN)

docs/guide/mcp-server.md

[uncategorized] ~15-~15: Possible missing comma found.
Context: ... The stdio transport is ideal for local integration where the client directly spawns the pr...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~212-~212: Loose punctuation mark.
Context: ...ables as the CLI: - CLAUDE_CONFIG_DIR: Specify custom Claude data directory pa...

(UNLIKELY_OPENING_PUNCTUATION)

docs/guide/daily-reports.md

[uncategorized] ~189-~189: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ... ## Related Commands - Monthly Reports - Aggregate by month - [Session Report...

(HYPHENATED_LY_ADVERB_ADJECTIVE)

docs/guide/sponsors.md

[uncategorized] ~13-~13: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...rt the development of ccusage and other open source projects. ## Star History <a href="ht...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

docs/guide/blocks-reports.md

[typographical] ~121-~121: If specifying a range, consider using an en dash instead of a hyphen.
Context: ...eatures: - Real-time updates every 1-60 seconds (configurable) - **Automatic to...

(HYPHEN_TO_EN)


[uncategorized] ~343-~343: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...ated by calendar date - Monthly Reports - Monthly usage summaries - [Session R...

(HYPHENATED_LY_ADVERB_ADJECTIVE)

docs/guide/cost-modes.md

[style] ~149-~149: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...# Scenario 3: Billing Verification You want to verify Claude's official cost calculati...

(REP_WANT_TO_VB)


[uncategorized] ~248-~248: Possible missing preposition found.
Context: ... - Combining old and new usage data - Maximum accuracy - Best available cost inform...

(AI_HYDRA_LEO_MISSING_TO)

docs/guide/custom-paths.md

[uncategorized] ~142-~142: Possible missing comma found.
Context: ...ucture Invalid paths are automatically skipped with debug information available. ## C...

(AI_HYDRA_LEO_MISSING_COMMA)

docs/guide/index.md

[style] ~92-~92: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ...t Limitations - Local Files Only - Only analyzes data from your current machine...

(ADVERB_REPETITION_PREMIUM)

docs/guide/configuration.md

[uncategorized] ~144-~144: Possible missing preposition found.
Context: ...rks with restricted internet access - Corporate environments - Behind firewalls or pr...

(AI_HYDRA_LEO_MISSING_IN)


[style] ~150-~150: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ...Limitations - Claude models only - Only supports Claude models (Opus, Sonnet, e...

(ADVERB_REPETITION_PREMIUM)


[uncategorized] ~152-~152: Possible missing preposition found.
Context: ...on't get latest pricing information - New models - May not support newly releas...

(AI_HYDRA_LEO_MISSING_OF)

docs/guide/session-reports.md

[uncategorized] ~260-~260: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...ge aggregated by date - Monthly Reports - Monthly summaries - [Blocks Reports]...

(HYPHENATED_LY_ADVERB_ADJECTIVE)

🪛 markdownlint-cli2 (0.17.2)
docs/guide/json-output.md

29-29: Hard tabs
Column: 1

(MD010, no-hard-tabs)


30-30: Hard tabs
Column: 1

(MD010, no-hard-tabs)


31-31: Hard tabs
Column: 1

(MD010, no-hard-tabs)


32-32: Hard tabs
Column: 1

(MD010, no-hard-tabs)


33-33: Hard tabs
Column: 1

(MD010, no-hard-tabs)


34-34: Hard tabs
Column: 1

(MD010, no-hard-tabs)


35-35: Hard tabs
Column: 1

(MD010, no-hard-tabs)


36-36: Hard tabs
Column: 1

(MD010, no-hard-tabs)


37-37: Hard tabs
Column: 1

(MD010, no-hard-tabs)


38-38: Hard tabs
Column: 1

(MD010, no-hard-tabs)


39-39: Hard tabs
Column: 1

(MD010, no-hard-tabs)


40-40: Hard tabs
Column: 1

(MD010, no-hard-tabs)


41-41: Hard tabs
Column: 1

(MD010, no-hard-tabs)


42-42: Hard tabs
Column: 1

(MD010, no-hard-tabs)


43-43: Hard tabs
Column: 1

(MD010, no-hard-tabs)


44-44: Hard tabs
Column: 1

(MD010, no-hard-tabs)


45-45: Hard tabs
Column: 1

(MD010, no-hard-tabs)


46-46: Hard tabs
Column: 1

(MD010, no-hard-tabs)


47-47: Hard tabs
Column: 1

(MD010, no-hard-tabs)


48-48: Hard tabs
Column: 1

(MD010, no-hard-tabs)


49-49: Hard tabs
Column: 1

(MD010, no-hard-tabs)


57-57: Hard tabs
Column: 1

(MD010, no-hard-tabs)


58-58: Hard tabs
Column: 1

(MD010, no-hard-tabs)


59-59: Hard tabs
Column: 1

(MD010, no-hard-tabs)


60-60: Hard tabs
Column: 1

(MD010, no-hard-tabs)


61-61: Hard tabs
Column: 1

(MD010, no-hard-tabs)


62-62: Hard tabs
Column: 1

(MD010, no-hard-tabs)


63-63: Hard tabs
Column: 1

(MD010, no-hard-tabs)


64-64: Hard tabs
Column: 1

(MD010, no-hard-tabs)


65-65: Hard tabs
Column: 1

(MD010, no-hard-tabs)


66-66: Hard tabs
Column: 1

(MD010, no-hard-tabs)


67-67: Hard tabs
Column: 1

(MD010, no-hard-tabs)


68-68: Hard tabs
Column: 1

(MD010, no-hard-tabs)


69-69: Hard tabs
Column: 1

(MD010, no-hard-tabs)


70-70: Hard tabs
Column: 1

(MD010, no-hard-tabs)


71-71: Hard tabs
Column: 1

(MD010, no-hard-tabs)


72-72: Hard tabs
Column: 1

(MD010, no-hard-tabs)


73-73: Hard tabs
Column: 1

(MD010, no-hard-tabs)


74-74: Hard tabs
Column: 1

(MD010, no-hard-tabs)


75-75: Hard tabs
Column: 1

(MD010, no-hard-tabs)


76-76: Hard tabs
Column: 1

(MD010, no-hard-tabs)


77-77: Hard tabs
Column: 1

(MD010, no-hard-tabs)


85-85: Hard tabs
Column: 1

(MD010, no-hard-tabs)


86-86: Hard tabs
Column: 1

(MD010, no-hard-tabs)


87-87: Hard tabs
Column: 1

(MD010, no-hard-tabs)


88-88: Hard tabs
Column: 1

(MD010, no-hard-tabs)


89-89: Hard tabs
Column: 1

(MD010, no-hard-tabs)


90-90: Hard tabs
Column: 1

(MD010, no-hard-tabs)


91-91: Hard tabs
Column: 1

(MD010, no-hard-tabs)


92-92: Hard tabs
Column: 1

(MD010, no-hard-tabs)


93-93: Hard tabs
Column: 1

(MD010, no-hard-tabs)


94-94: Hard tabs
Column: 1

(MD010, no-hard-tabs)


95-95: Hard tabs
Column: 1

(MD010, no-hard-tabs)


96-96: Hard tabs
Column: 1

(MD010, no-hard-tabs)


97-97: Hard tabs
Column: 1

(MD010, no-hard-tabs)


98-98: Hard tabs
Column: 1

(MD010, no-hard-tabs)


99-99: Hard tabs
Column: 1

(MD010, no-hard-tabs)


100-100: Hard tabs
Column: 1

(MD010, no-hard-tabs)


101-101: Hard tabs
Column: 1

(MD010, no-hard-tabs)


102-102: Hard tabs
Column: 1

(MD010, no-hard-tabs)


103-103: Hard tabs
Column: 1

(MD010, no-hard-tabs)


104-104: Hard tabs
Column: 1

(MD010, no-hard-tabs)


105-105: Hard tabs
Column: 1

(MD010, no-hard-tabs)


106-106: Hard tabs
Column: 1

(MD010, no-hard-tabs)


114-114: Hard tabs
Column: 1

(MD010, no-hard-tabs)


115-115: Hard tabs
Column: 1

(MD010, no-hard-tabs)


116-116: Hard tabs
Column: 1

(MD010, no-hard-tabs)


117-117: Hard tabs
Column: 1

(MD010, no-hard-tabs)


118-118: Hard tabs
Column: 1

(MD010, no-hard-tabs)


119-119: Hard tabs
Column: 1

(MD010, no-hard-tabs)


120-120: Hard tabs
Column: 1

(MD010, no-hard-tabs)


121-121: Hard tabs
Column: 1

(MD010, no-hard-tabs)


122-122: Hard tabs
Column: 1

(MD010, no-hard-tabs)


123-123: Hard tabs
Column: 1

(MD010, no-hard-tabs)


124-124: Hard tabs
Column: 1

(MD010, no-hard-tabs)


125-125: Hard tabs
Column: 1

(MD010, no-hard-tabs)


126-126: Hard tabs
Column: 1

(MD010, no-hard-tabs)


127-127: Hard tabs
Column: 1

(MD010, no-hard-tabs)


128-128: Hard tabs
Column: 1

(MD010, no-hard-tabs)


129-129: Hard tabs
Column: 1

(MD010, no-hard-tabs)


130-130: Hard tabs
Column: 1

(MD010, no-hard-tabs)


131-131: Hard tabs
Column: 1

(MD010, no-hard-tabs)


132-132: Hard tabs
Column: 1

(MD010, no-hard-tabs)


133-133: Hard tabs
Column: 1

(MD010, no-hard-tabs)


134-134: Hard tabs
Column: 1

(MD010, no-hard-tabs)


135-135: Hard tabs
Column: 1

(MD010, no-hard-tabs)


136-136: Hard tabs
Column: 1

(MD010, no-hard-tabs)


137-137: Hard tabs
Column: 1

(MD010, no-hard-tabs)


138-138: Hard tabs
Column: 1

(MD010, no-hard-tabs)


139-139: Hard tabs
Column: 1

(MD010, no-hard-tabs)


140-140: Hard tabs
Column: 1

(MD010, no-hard-tabs)


206-206: Hard tabs
Column: 1

(MD010, no-hard-tabs)


207-207: Hard tabs
Column: 1

(MD010, no-hard-tabs)


208-208: Hard tabs
Column: 1

(MD010, no-hard-tabs)


209-209: Hard tabs
Column: 1

(MD010, no-hard-tabs)


210-210: Hard tabs
Column: 1

(MD010, no-hard-tabs)


211-211: Hard tabs
Column: 1

(MD010, no-hard-tabs)


212-212: Hard tabs
Column: 1

(MD010, no-hard-tabs)


213-213: Hard tabs
Column: 1

(MD010, no-hard-tabs)


214-214: Hard tabs
Column: 1

(MD010, no-hard-tabs)


215-215: Hard tabs
Column: 1

(MD010, no-hard-tabs)


216-216: Hard tabs
Column: 1

(MD010, no-hard-tabs)


217-217: Hard tabs
Column: 1

(MD010, no-hard-tabs)


218-218: Hard tabs
Column: 1

(MD010, no-hard-tabs)


219-219: Hard tabs
Column: 1

(MD010, no-hard-tabs)


220-220: Hard tabs
Column: 1

(MD010, no-hard-tabs)


221-221: Hard tabs
Column: 1

(MD010, no-hard-tabs)


222-222: Hard tabs
Column: 1

(MD010, no-hard-tabs)


223-223: Hard tabs
Column: 1

(MD010, no-hard-tabs)


224-224: Hard tabs
Column: 1

(MD010, no-hard-tabs)


225-225: Hard tabs
Column: 1

(MD010, no-hard-tabs)


226-226: Hard tabs
Column: 1

(MD010, no-hard-tabs)


227-227: Hard tabs
Column: 1

(MD010, no-hard-tabs)


228-228: Hard tabs
Column: 1

(MD010, no-hard-tabs)


229-229: Hard tabs
Column: 1

(MD010, no-hard-tabs)


230-230: Hard tabs
Column: 1

(MD010, no-hard-tabs)


231-231: Hard tabs
Column: 1

(MD010, no-hard-tabs)


232-232: Hard tabs
Column: 1

(MD010, no-hard-tabs)


233-233: Hard tabs
Column: 1

(MD010, no-hard-tabs)


234-234: Hard tabs
Column: 1

(MD010, no-hard-tabs)


290-290: Hard tabs
Column: 1

(MD010, no-hard-tabs)

README.md

14-14: Images should have alternate text (alt text)
null

(MD045, no-alt-text)

docs/guide/monthly-reports.md

13-13: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


103-103: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


123-123: Hard tabs
Column: 1

(MD010, no-hard-tabs)


124-124: Hard tabs
Column: 1

(MD010, no-hard-tabs)


125-125: Hard tabs
Column: 1

(MD010, no-hard-tabs)


126-126: Hard tabs
Column: 1

(MD010, no-hard-tabs)


127-127: Hard tabs
Column: 1

(MD010, no-hard-tabs)


128-128: Hard tabs
Column: 1

(MD010, no-hard-tabs)


129-129: Hard tabs
Column: 1

(MD010, no-hard-tabs)


130-130: Hard tabs
Column: 1

(MD010, no-hard-tabs)


131-131: Hard tabs
Column: 1

(MD010, no-hard-tabs)


132-132: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/guide/daily-reports.md

99-99: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


121-121: Hard tabs
Column: 1

(MD010, no-hard-tabs)


122-122: Hard tabs
Column: 1

(MD010, no-hard-tabs)


123-123: Hard tabs
Column: 1

(MD010, no-hard-tabs)


124-124: Hard tabs
Column: 1

(MD010, no-hard-tabs)


125-125: Hard tabs
Column: 1

(MD010, no-hard-tabs)


126-126: Hard tabs
Column: 1

(MD010, no-hard-tabs)


127-127: Hard tabs
Column: 1

(MD010, no-hard-tabs)


128-128: Hard tabs
Column: 1

(MD010, no-hard-tabs)


129-129: Hard tabs
Column: 1

(MD010, no-hard-tabs)


130-130: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/guide/sponsors.md

7-7: Images should have alternate text (alt text)
null

(MD045, no-alt-text)

docs/guide/blocks-reports.md

13-13: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


185-185: Hard tabs
Column: 1

(MD010, no-hard-tabs)


186-186: Hard tabs
Column: 1

(MD010, no-hard-tabs)


187-187: Hard tabs
Column: 1

(MD010, no-hard-tabs)


188-188: Hard tabs
Column: 1

(MD010, no-hard-tabs)


189-189: Hard tabs
Column: 1

(MD010, no-hard-tabs)


190-190: Hard tabs
Column: 1

(MD010, no-hard-tabs)


191-191: Hard tabs
Column: 1

(MD010, no-hard-tabs)


192-192: Hard tabs
Column: 1

(MD010, no-hard-tabs)


193-193: Hard tabs
Column: 1

(MD010, no-hard-tabs)


194-194: Hard tabs
Column: 1

(MD010, no-hard-tabs)


195-195: Hard tabs
Column: 1

(MD010, no-hard-tabs)


196-196: Hard tabs
Column: 1

(MD010, no-hard-tabs)


197-197: Hard tabs
Column: 1

(MD010, no-hard-tabs)


198-198: Hard tabs
Column: 1

(MD010, no-hard-tabs)


199-199: Hard tabs
Column: 1

(MD010, no-hard-tabs)


200-200: Hard tabs
Column: 1

(MD010, no-hard-tabs)


201-201: Hard tabs
Column: 1

(MD010, no-hard-tabs)


311-311: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

docs/guide/custom-paths.md

83-83: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


93-93: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


106-106: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


120-120: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


295-295: Hard tabs
Column: 1

(MD010, no-hard-tabs)


296-296: Hard tabs
Column: 1

(MD010, no-hard-tabs)


297-297: Hard tabs
Column: 1

(MD010, no-hard-tabs)


298-298: Hard tabs
Column: 1

(MD010, no-hard-tabs)


299-299: Hard tabs
Column: 1

(MD010, no-hard-tabs)


300-300: Hard tabs
Column: 1

(MD010, no-hard-tabs)


301-301: Hard tabs
Column: 1

(MD010, no-hard-tabs)


302-302: Hard tabs
Column: 1

(MD010, no-hard-tabs)


303-303: Hard tabs
Column: 1

(MD010, no-hard-tabs)


304-304: Hard tabs
Column: 1

(MD010, no-hard-tabs)


305-305: Hard tabs
Column: 1

(MD010, no-hard-tabs)


306-306: Hard tabs
Column: 1

(MD010, no-hard-tabs)


307-307: Hard tabs
Column: 1

(MD010, no-hard-tabs)


308-308: Hard tabs
Column: 1

(MD010, no-hard-tabs)


309-309: Hard tabs
Column: 1

(MD010, no-hard-tabs)


310-310: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/guide/configuration.md

192-192: Hard tabs
Column: 1

(MD010, no-hard-tabs)


193-193: Hard tabs
Column: 1

(MD010, no-hard-tabs)


194-194: Hard tabs
Column: 1

(MD010, no-hard-tabs)


195-195: Hard tabs
Column: 1

(MD010, no-hard-tabs)


196-196: Hard tabs
Column: 1

(MD010, no-hard-tabs)


197-197: Hard tabs
Column: 1

(MD010, no-hard-tabs)


198-198: Hard tabs
Column: 1

(MD010, no-hard-tabs)


199-199: Hard tabs
Column: 1

(MD010, no-hard-tabs)


200-200: Hard tabs
Column: 1

(MD010, no-hard-tabs)


208-208: Hard tabs
Column: 1

(MD010, no-hard-tabs)


209-209: Hard tabs
Column: 1

(MD010, no-hard-tabs)


210-210: Hard tabs
Column: 1

(MD010, no-hard-tabs)


211-211: Hard tabs
Column: 1

(MD010, no-hard-tabs)


212-212: Hard tabs
Column: 1

(MD010, no-hard-tabs)


213-213: Hard tabs
Column: 1

(MD010, no-hard-tabs)


214-214: Hard tabs
Column: 1

(MD010, no-hard-tabs)

docs/guide/session-reports.md

13-13: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


102-102: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


124-124: Hard tabs
Column: 1

(MD010, no-hard-tabs)


125-125: Hard tabs
Column: 1

(MD010, no-hard-tabs)


126-126: Hard tabs
Column: 1

(MD010, no-hard-tabs)


127-127: Hard tabs
Column: 1

(MD010, no-hard-tabs)


128-128: Hard tabs
Column: 1

(MD010, no-hard-tabs)


129-129: Hard tabs
Column: 1

(MD010, no-hard-tabs)


130-130: Hard tabs
Column: 1

(MD010, no-hard-tabs)


131-131: Hard tabs
Column: 1

(MD010, no-hard-tabs)


132-132: Hard tabs
Column: 1

(MD010, no-hard-tabs)


133-133: Hard tabs
Column: 1

(MD010, no-hard-tabs)


134-134: Hard tabs
Column: 1

(MD010, no-hard-tabs)


135-135: Hard tabs
Column: 1

(MD010, no-hard-tabs)


136-136: Hard tabs
Column: 1

(MD010, no-hard-tabs)


137-137: Hard tabs
Column: 1

(MD010, no-hard-tabs)


138-138: Hard tabs
Column: 1

(MD010, no-hard-tabs)


139-139: Hard tabs
Column: 1

(MD010, no-hard-tabs)


140-140: Hard tabs
Column: 1

(MD010, no-hard-tabs)


141-141: Hard tabs
Column: 1

(MD010, no-hard-tabs)


142-142: Hard tabs
Column: 1

(MD010, no-hard-tabs)


143-143: Hard tabs
Column: 1

(MD010, no-hard-tabs)


144-144: Hard tabs
Column: 1

(MD010, no-hard-tabs)


145-145: Hard tabs
Column: 1

(MD010, no-hard-tabs)


146-146: Hard tabs
Column: 1

(MD010, no-hard-tabs)


147-147: Hard tabs
Column: 1

(MD010, no-hard-tabs)


148-148: Hard tabs
Column: 1

(MD010, no-hard-tabs)


149-149: Hard tabs
Column: 1

(MD010, no-hard-tabs)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Workers Builds: ccusage-guide
🔇 Additional comments (42)
src/index.ts (1)

3-10: Approve file-level JSDoc addition
The JSDoc block clearly documents the purpose of this entry point (ccusage CLI main module) without altering functionality.

eslint.config.js (1)

9-11: Approve ESLint ignore pattern for documentation
The ignores: ['docs/**'] correctly excludes the VitePress documentation files from linting to prevent unnecessary errors.

src/mcp.ts (1)

1-9: Approve file-level JSDoc for MCP server module
The added JSDoc provides a concise overview of the module’s responsibility and transport options, enhancing maintainability and consistency.

src/debug.ts (1)

1-8: Approve file-level JSDoc for debug utilities
This comment accurately describes the module’s debugging tools for pricing mismatch validation without introducing any behavioral changes.

docs/wrangler.jsonc (1)

1-13: Verify Wrangler config file location and format
Ensure that Cloudflare Wrangler supports JSONC configs in a docs/ subdirectory. You may need to rename this to wrangler.toml at the project root or adjust your deployment pipeline accordingly.

src/_macro.ts (1)

5-7: Good TypeScript practice: separating type-only imports.

The refactoring to use import type for ModelPricing while keeping modelPricingSchema as a regular import is a good practice that improves code clarity and type safety.

docs/guide/related-projects.md (1)

1-16: Well-structured documentation showcasing the ccusage ecosystem.

This documentation effectively organizes related projects into clear categories and encourages community contributions. The format is clean and user-friendly.

src/calculate-cost.ts (1)

1-10: Excellent module-level documentation addition.

The comprehensive JSDoc fileoverview comment clearly explains the module's purpose, functionality, and capabilities. This enhances code maintainability and developer understanding.

docs/.gitignore (1)

1-17: Comprehensive gitignore configuration for documentation site.

The gitignore patterns appropriately exclude VitePress build artifacts, generated documentation, dependencies, and temporary files. This ensures a clean repository while supporting the documentation build process.

docs/tsconfig.json (1)

1-14: LGTM! Well-configured TypeScript setup for VitePress documentation.

The configuration appropriately extends the parent tsconfig while customizing for documentation needs. The compiler options are well-chosen: noEmit: true for type-checking only, allowJs: true for mixed content, and appropriate include patterns for VitePress, TypeScript, and Markdown files.

src/commands/blocks.ts (1)

1-1: Excellent type import optimization!

Converting to import type for SessionBlock is the correct approach since it's only used for type annotations. This improves build performance and makes the type-only usage explicit.

CLAUDE.md (1)

137-150: Well-structured documentation guidelines that promote consistency and accessibility.

The screenshot usage guidelines are comprehensive and practical, covering placement, purpose, specific examples, and accessibility requirements. This will help maintain high-quality, consistent visual documentation across the project.

src/logger.ts (2)

1-9: Excellent JSDoc documentation!

The comprehensive file-level documentation clearly describes the module's purpose and follows standard JSDoc practices with proper tags and structure.


10-11: Perfect import optimization with type separation.

Correctly separates the type-only import (ConsolaInstance) from the runtime import (consola), following TypeScript best practices for better tree-shaking and explicit type usage.

src/data-loader.ts (2)

1-9: Add comprehensive module documentation
The JSDoc provides a clear overview of this module’s purpose and functionalities, improving maintainability and aiding the automated docs generation.


11-11: Combine type imports for clarity
Consolidating LoadedUsageEntry and SessionBlock into a single import type reduces duplication and aligns with the rest of the import style in this file.

package.json (1)

34-37: Enable monorepo workspaces
Adding "." and "docs" to workspaces correctly configures the core package and documentation site in a unified workspace, facilitating dependency sharing and streamlined scripts.

src/pricing-fetcher.ts (3)

1-9: Comprehensive file-level JSDoc added.
Provides clear context for the PricingFetcher class and aligns with project documentation standards.


11-11: Use type-only import.
Switching ModelPricing to a type import reduces emitted code and clarifies intent.


13-13: Macro import syntax is correct.
Importing prefetchClaudePricing with the macro directive cleanly separates compile-time logic.

docs/index.md (2)

1-3: Proper home page frontmatter.
The YAML header correctly sets the layout to home, establishing the entry point for the VitePress site.


4-18: Hero section is well-defined.
The logo alt text is present and call-to-action buttons are clear and appropriately themed.

docs/guide/getting-started.md (8)

1-9: Introduction and prerequisites are clear.
The guide immediately outlines requirements and context, making it easy to follow.


10-28: Quick Start section is well-structured.
Using ::: code-group makes the multi-tool examples clear and consistent for VitePress.


30-49: First report sample is illustrative.
The ASCII table example effectively shows expected output.


51-67: Output explanation is thorough.
Column descriptions and cache token notes are precise and helpful.


68-76: Next Steps links are comprehensive.
All major guide pages are linked correctly, guiding users to deeper topics.


77-95: Common Use Cases are practical.
Examples cover typical workflows and demonstrate command variations.


96-121: Troubleshooting section is useful.
It addresses common pitfalls with clear instructions and examples.


122-128: Getting Help pointers are appropriate.
Command-line help, GitHub repo, and API reference links are provided.

README.md (1)

2-3: Logo image alt text is present.
The README header image has an appropriate alt attribute.

docs/guide/library-usage.md (2)

41-50: Clarified assumption for usageEntries.
The added comment explicitly defines usageEntries, addressing previous feedback on undefined variables.


113-113: Verify package exports for root imports.
The example imports loadSessionData and calculateTotals from 'ccusage'. Ensure these are re-exported in the package's entry point or update the import path to the specific module (ccusage/data-loader or ccusage/calculate-cost).

docs/typedoc.config.mjs (1)

1-47: Well-structured TypeDoc configuration.

The dynamic entry point discovery with fast-glob and clear exclusion patterns make this configuration maintainable. The explicit inclusion of _consts.ts after excluding other internal files is well-documented and intentional.

docs/package.json (1)

8-8: Verify the rolldown-vite override and validation flag.

The ROLLDOWN_OPTIONS_VALIDATION=loose flag and vite override to rolldown-vite suggest there might be compatibility issues. Please verify these are necessary and document why they're required.

Also applies to: 25-27

docs/update-api-index.mjs (2)

36-37: Regex implementation addresses previous concerns.

The current implementation already uses regular expressions for robust pattern matching, addressing the previous comment about fixed-string matching. The regex properly handles whitespace variations and is more maintainable than fixed strings.


78-83: Good error handling strategy.

The main function appropriately handles errors differently for the two operations - exiting on API index failure (critical) while continuing on constants page failure (optional). This ensures the build process fails only when necessary.

docs/guide/configuration.md (1)

1-4: LGTM

This configuration guide is clear, comprehensive, and well organized.

docs/guide/daily-reports.md (1)

1-4: LGTM

The overview, command samples, and examples are well-structured and informative.

docs/guide/installation.md (1)

1-258: LGTM

This installation guide is thorough, uses code-group effectively, and covers all major scenarios and troubleshooting steps.

docs/guide/mcp-server.md (1)

1-4: LGTM

The MCP server guide is detailed, clear, and integrates well with the rest of the documentation suite.

docs/.vitepress/config.ts (1)

10-12: Verify base configuration for deployment
Ensure that base: '/' aligns with your Cloudflare Pages (or other) deployment path. If the site is served under a subpath (e.g., /ccusage/), update base accordingly to avoid broken URLs.

Comment thread docs/guide/monthly-reports.md Outdated
The root typedoc.json is not being used since docs build uses

docs/typedoc.config.mjs for VitePress markdown generation instead
Update daily reports JSON example to match documented structure

Includes proper wrapper with type, data, summary fields and costUSD field name
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.

2 participants