ccstatusline
repository·main·Indexed 9 days ago
https://github.com/sirmalloc/ccstatuslineA customizable status line formatter for the Claude Code CLI that provides visual terminal metrics including model info, git status, token usage, and session costs. Features an interactive TUI for configuration, Powerline and Flex modes for layout, and support for custom gradients and widget styling. Version 2.2.27 supports importing and exporting TUI configurations via JSON.
What's inside ccstatusline
- ccstatusline is a highly customizable status line formatter designed specifically for the Claude Code CLI. It allows developers to display real-time metrics directly in their terminal, including model information, Git branch status, token usage, and other relevant development metrics.
Customize widget colors and gradients
mainThe color editor supports several advanced styling options:
- Gradients: You can apply per-widget or whole-line foreground gradients. Use named presets or custom hex stops.
- To edit widget gradients: Press
gon the Edit Colors screen. - To edit global line gradients: Press
gin Global Overrides for 'Override FG Color'.
- To edit widget gradients: Press
- Dim Styling: You can dim an entire widget or only the text within parentheses. Use the reset or clear-all actions to revert dim states.
- Gradients: You can apply per-widget or whole-line foreground gradients. Use named presets or custom hex stops.
Use Global Minimalist Mode
mainTo achieve a cleaner, label-free status line, you can enable Global Minimalist Mode via theGlobal Overridesmenu. This forces all widgets into raw-value mode.Import and export TUI configurations
mainAs of v2.2.27, you can export your current TUI configuration to a JSON file. You can also import configurations, which allows you to validate and preview the import before applying it. When importing, you can choose to replace all existing settings or merge only the supplied fields (preserving local installation metadata). The imported result is left unsaved for your review before final application.Use Gradient Colors in Status Line
mainGradients use OKLab interpolation for smooth blends. They can be applied per-widget (self-contained sweep) or as a whole-line override (continuous sweep across all characters).
Gradient values must be prefixed with
gradient:and follow one of these formats:- Named preset:
gradient:atlas(Presets:atlas,cristal,teen,mind,morning,vice,passion,fruit,instagram,retro,summer,rainbow,pastel). - Dash stops:
gradient:RRGGBB-RRGGBB[-RRGGBB...](Hex stops). - Comma stops:
gradient:hex:RRGGBB,#RRGGBB,RRGGBB(Useshex:prefix).
Note on Rendering:
- In Powerline mode, global foreground gradients color widget text, but separators/caps maintain standard contrast rules.
- In 256-color mode, per-widget gradients collapse to their first stop.
- At Basic/No Color levels, gradients render as plain text.
// Named preset gradient:atlas // Dash stops gradient:FF0000-00FF00 // Comma stops gradient:hex:FF0000,#00FF00,0000FF- Named preset:
Use Powerline mode and Flex mode
mainPowerline mode enables status lines with arrow separators and customizable caps.
- Powerline Flex Mode: Allows flex separators to work within Powerline mode, enabling the status line to right-align content or absorb available width.
- Selective Alignment: You can press
xin the line editor to allow a specific widget and its line to maintain natural widths while earlier Powerline columns remain auto-aligned. - Auto-Alignment: In Powerline Setup, you can toggle auto-alignment (
a) to align widgets across multiple status lines for a clean, columnar layout.
Understand Raw Value Mode
mainSeveral widgets support a "raw value" mode, which strips the descriptive label to save space and provide a cleaner look. This is often used in conjunction with Minimalist Mode.
Examples:
- Model:
Model: Claude 3.5 Sonnet$\rightarrow$Claude 3.5 Sonnet - Session:
Session: 2hr 15m$\rightarrow$2hr 15m - Block:
Block: 3hr 45m$\rightarrow$3hr 45m - Context:
Ctx: 18.6k$\rightarrow$18.6k
- Model:
How Powerline Auto-Alignment works
mainWhen Powerline Setup is enabled, widgets can be aligned into shared columns across multiple status lines.
- Toggle Alignment: Press
ain the Powerline setup to toggle Align Widgets. - Exclude from Alignment: If auto-alignment causes a naturally wide value to stretch too far, select that widget in the line editor and press
x(exclude align). This allows the selected widget and all subsequent widgets on that line to maintain their natural widths while keeping earlier columns aligned.
- Toggle Alignment: Press
Run ccstatusline in different modes
mainDepending on your needs,
ccstatuslinecan be run in three distinct modes:- Interactive mode (TUI): Launches the interactive terminal user interface when no stdin is provided. Use this for manual configuration and viewing.
- Piped mode (renderer): Parses Claude Code status JSON from
stdinand prints one or more formatted lines. This is used for programmatic rendering. - Version mode: Prints the installed package version and exits when the
--versionflag is passed.
Usage Examples
# Interactive TUI bun run start # Piped mode with example payload bun run example # Print the installed package version ccstatusline --version# Interactive TUI bun run start # Piped mode with example payload bun run example # Print the installed package version ccstatusline --versionUse ccstatusline development commands
mainUse the following commands to run, test, and build the project using
bun:Command Description bun run startRun in TUI mode bun run exampleTest piped mode with an example payload bun testRun tests bun run lintRun typecheck + eslint checks (no file modification) bun run lint:fixApply ESLint auto-fixes bun run buildBuild for distribution bun run docsGenerate TypeDoc documentation bun run start bun run example bun test bun run lint bun run lint:fix bun run build bun run docsCustomize Widget Styling
mainIndividual widgets can be styled independently of global settings. Use the color editor to adjust:
- Foreground/Background Color: Use
←/→to cycle colors. - Switch Mode: Press
fto switch between editing foreground and background. - Bold: Press
bto toggle bold. - Dimming: Press
dto cycle through:off→whole widget→parenthesized text only→off. - Resetting: Press
rto reset styling on the selected widget, orcto clear styling on every widget in the line.
Widget Styling Controls: ← / → : Cycle colors f : Switch FG/BG editing b : Toggle bold d : Cycle dimming modes r : Reset selected widget c : Clear all widget styling- Foreground/Background Color: Use
Setup the ccstatusline development environment
mainTo develop on
ccstatusline, you need Bun (v1.0+) and Git installed. Node.js 14+ is optional but recommended for running the built binary or publishing to npm.Follow these steps to clone and prepare the repository:
# Clone the repository git clone https://github.com/sirmalloc/ccstatusline.git cd ccstatusline # Install dependencies bun installgit clone https://github.com/sirmalloc/ccstatusline.git cd ccstatusline bun install