Development setup, project structure, and API documentation for ccstatusline.
If you want the main project overview, return to README.md.
- Bun (v1.0+)
- Git
- Node.js 14+ (optional, for running the built
dist/ccstatusline.jsbinary or npm publishing)
# Clone the repository
git clone https://github.com/sirmalloc/ccstatusline.git
cd ccstatusline
# Install dependencies
bun install# Run in TUI mode
bun run start
# Test piped mode with example payload
bun run example
# Run tests
bun test
# Run typecheck + eslint checks without modifying files
bun run lint
# Apply ESLint auto-fixes intentionally
bun run lint:fix
# Build for distribution
bun run build
# Generate TypeDoc documentation
bun run docs~/.config/ccstatusline/settings.json- ccstatusline UI/render settings~/.claude/settings.json- Claude Code settings (statusLinecommand object)~/.cache/ccstatusline/block-cache-*.json- block timer cache (keyed by Claude config directory hash)~/.cache/ccstatusline/git-cache/git-*.json- persistent git widget command cache~/.cache/ccstatusline/git-review/git-review-*.json- cached Git PR/MR lookup results~/.cache/ccstatusline/usage.jsonand~/.cache/ccstatusline/usage.lock- usage API data cache and fetch backoff lock
If you use a custom Claude config location, set CLAUDE_CONFIG_DIR and ccstatusline will read/write that path instead of ~/.claude.
Settings saves are atomic and preserve symlinked settings.json files by writing through the resolved target. Invalid or unreadable settings are never overwritten during load; loadSettings() returns in-memory defaults, records getConfigLoadError(), and renderer paths surface that state with an invalid-config warning badge.
Usage-fetch tests spawn subprocess probes. Keep those probes sandboxed by setting HOME, USERPROFILE, CLAUDE_CONFIG_DIR, and proxy variables explicitly so tests cannot read or write a developer's live ccstatusline usage cache.
- Build target is Node.js 14+ (
dist/ccstatusline.js) - During install,
ink@6.2.0is patched to fix backspace handling on macOS terminals - React and React DOM are exact-version pins; dependency refreshes should update
package.jsonandbun.locktogether
Complete API documentation is generated using TypeDoc and includes detailed information about:
- Core Types: Configuration interfaces, widget definitions, and render contexts
- Widget System: All available widgets and their customization options
- Utility Functions: Helper functions for rendering, configuration, and terminal handling
- Status Line Rendering: Core rendering engine and formatting options
To generate the API documentation locally:
# Generate documentation
bun run docs
# Clean generated documentation
bun run docs:cleanThe documentation will be generated in the typedoc/ directory and can be viewed by opening typedoc/index.html in your web browser.
- Types: Core TypeScript interfaces and type definitions
- Widgets: Individual widget implementations and their APIs
- Utils: Utility functions for configuration, rendering, and terminal operations
- Main Module: Primary entry point and orchestration functions
ccstatusline/
├── src/
│ ├── ccstatusline.ts # Main entry point
│ ├── tui/ # React/Ink configuration UI
│ │ ├── App.tsx # Root TUI component
│ │ ├── index.tsx # TUI entry point
│ │ └── components/ # UI components
│ │ ├── MainMenu.tsx
│ │ ├── LineSelector.tsx
│ │ ├── ItemsEditor.tsx
│ │ ├── ColorMenu.tsx
│ │ ├── PowerlineSetup.tsx
│ │ └── ...
│ ├── widgets/ # Status line widget implementations
│ │ ├── Model.ts
│ │ ├── GitBranch.ts
│ │ ├── TokensTotal.ts
│ │ ├── OutputStyle.ts
│ │ └── ...
│ ├── utils/ # Utility functions
│ │ ├── config.ts # Settings management
│ │ ├── renderer.ts # Core rendering logic
│ │ ├── powerline.ts # Powerline font utilities
│ │ ├── colors.ts # Color definitions
│ │ └── claude-settings.ts # Claude Code integration (supports CLAUDE_CONFIG_DIR)
│ └── types/ # TypeScript type definitions
│ ├── Settings.ts
│ ├── Widget.ts
│ ├── PowerlineConfig.ts
│ └── ...
├── dist/ # Built files (generated)
├── docs/ # Hand-written repository docs
├── typedoc/ # Generated API docs
├── package.json
├── tsconfig.json
└── README.md