All skills
Skillintermediate
CLAUDE.md - Terminal Package
This package provides terminal utilities for the ccusage toolchain.
Claude Code Knowledge Pack7/10/2026
Overview
CLAUDE.md - Terminal Package
This package provides terminal utilities for the ccusage toolchain.
Package Overview
Name: @ccusage/terminal
Description: Terminal utilities for ccusage
Type: Internal library package (private)
Development Commands
Testing and Quality:
pnpm run test- Run all tests using vitestpnpm run lint- Lint code using ESLintpnpm run format- Format and auto-fix code with ESLintpnpm typecheck- Type check with TypeScript
Architecture
This package contains terminal utilities used across the ccusage monorepo:
Key Modules:
src/table.ts- Table formatting and rendering utilitiessrc/utils.ts- General terminal utilities
Exports:
./table- Table formatting utilities./utils- Terminal utility functions
Dependencies
Runtime Dependencies:
@oxc-project/runtime- Runtime utilitiesansi-escapes- ANSI escape sequences for terminal manipulationcli-table3- Table formatting for terminal outputes-toolkit- Modern JavaScript utility librarypicocolors- Terminal color supportstring-width- Get the visual width of strings
Dev Dependencies:
vitest- Testing frameworkeslint- Linting and formatting
Testing Guidelines
- In-Source Testing: Tests are written in the same files using
if (import.meta.vitest != null)blocks - Vitest Globals Enabled: Use
describe,it,expectdirectly without imports - CRITICAL: NEVER use
await import()dynamic imports anywhere, especially in test blocks
Code Style
Follow the same code style guidelines as the main ccusage package:
- Error Handling: Prefer functional error handling patterns
- Imports: Use
.tsextensions for local imports - Exports: Only export what's actually used
- No console.log: Terminal output should be handled through proper utilities
Post-Change Workflow: Always run these commands in parallel after code changes:
pnpm run format- Auto-fix and formatpnpm typecheck- Type checkingpnpm run test- Run tests
Important Notes
This is a private internal package and should not be published to npm. It exists solely to provide terminal utilities for other packages in the monorepo.