xstatusline 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +564 -2
- package/README.zh-CN.md +565 -0
- package/dist/capture-cmd-KYHDQTPG.js +7 -0
- package/dist/chunk-2KICDVKL.js +152 -0
- package/dist/chunk-F3QKZYFL.js +932 -0
- package/dist/chunk-FP6BN25K.js +8259 -0
- package/dist/chunk-G6Z3XBD4.js +130 -0
- package/dist/chunk-G73SSUIW.js +92 -0
- package/dist/chunk-L7CXMAAP.js +1171 -0
- package/dist/chunk-P3HNN6AJ.js +460 -0
- package/dist/chunk-UJZ5CFSY.js +169 -0
- package/dist/chunk-XQFGVAPD.js +654 -0
- package/dist/chunk-XZE4DTX5.js +455 -0
- package/dist/chunk-YGWJVJEE.js +384 -0
- package/dist/chunk-YHHHHNRZ.js +1689 -0
- package/dist/chunk-ZXLFBNOL.js +4 -0
- package/dist/cli.js +841 -0
- package/dist/doctor-cmd-S2GY2ILB.js +8 -0
- package/dist/export-cmd-MX5L7ETH.js +306 -0
- package/dist/import-cmd-F4NLNABD.js +559 -0
- package/dist/install-cmd-PEKUSMT3.js +4 -0
- package/dist/mcp-cmd-DBDZ6AZZ.js +975 -0
- package/dist/preview-cmd-LN4TK6TV.js +104 -0
- package/dist/render-cmd-DPV6ZAJG.js +6 -0
- package/dist/tui-QKCLI7U4.js +7639 -0
- package/package.json +72 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xstatusline contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,565 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<h1>
|
|
4
|
+
<picture>
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset="./assets/banner-dark.svg" />
|
|
6
|
+
<source media="(prefers-color-scheme: light)" srcset="./assets/banner-light.svg" />
|
|
7
|
+
<img src="./assets/banner-dark.svg" alt="xstatusline (xsl)" width="540" />
|
|
8
|
+
</picture>
|
|
9
|
+
</h1>
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
<strong>One statusline studio for every terminal coding agent.</strong><br />
|
|
13
|
+
<em>Native support for Claude Code, Antigravity (<code>agy</code>), Grok & Codex · 47 widgets · 7 themes · <code><50ms</code> hot path</em>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p>
|
|
17
|
+
<strong>English</strong> · <a href="./README.zh-CN.md">简体中文</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
<a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D20-38bdf8?style=flat-square&logo=node.js&logoColor=white&labelColor=1e293b" alt="Node.js >=20" /></a>
|
|
22
|
+
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.x-818cf8?style=flat-square&logo=typescript&logoColor=white&labelColor=1e293b" alt="TypeScript 5.x" /></a>
|
|
23
|
+
<a href="#supported-harnesses"><img src="https://img.shields.io/badge/Harnesses-Claude%20%7C%20AGY%20%7C%20Grok%20%7C%20Codex-a78bfa?style=flat-square&labelColor=1e293b" alt="Supported Harnesses" /></a>
|
|
24
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-f472b6?style=flat-square&labelColor=1e293b" alt="License: MIT" /></a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p>
|
|
28
|
+
<a href="#highlights">Highlights</a> ·
|
|
29
|
+
<a href="#supported-harnesses">Harnesses</a> ·
|
|
30
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
31
|
+
<a href="#interactive-tui">Interactive Studio</a> ·
|
|
32
|
+
<a href="#built-in-widgets">Widgets (47)</a> ·
|
|
33
|
+
<a href="#cli-reference">CLI</a> ·
|
|
34
|
+
<a href="#configuration">Config</a> ·
|
|
35
|
+
<a href="#troubleshooting">Troubleshooting</a> ·
|
|
36
|
+
<a href="#changelog">Changelog</a>
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
<br />
|
|
40
|
+
|
|
41
|
+
<p>
|
|
42
|
+
<img src="./assets/demo.gif" alt="xstatusline interactive TUI walkthrough showing multi-harness preview, live widget editing, Powerline themes, and per-harness overrides" width="840" />
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<p><sub>Live multi-harness preview · 4-harness Compare Mode (<code>v</code>) · searchable Widget Picker · real-time Powerline & themes · Solar Amber per-harness overrides</sub></p>
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
`xstatusline` (short alias `xsl`) is a fast, keyboard-driven **Cross-CLI** statusline for **every major terminal coding agent CLI**. Maintain a single configuration file to get 47 built-in widgets, 7 curated themes, Powerline pills, per-harness overrides, a live 4-harness Ink TUI, and non-destructive installers — all backed by a sub-50ms hot rendering path.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
<a id="highlights"></a>
|
|
56
|
+
## ◈ Highlights
|
|
57
|
+
|
|
58
|
+
- **One Config, Every Agent CLI**: Configure once in `~/.config/xstatusline/settings.json` and render natively across **Claude Code**, **Antigravity CLI (`agy`)**, **Grok CLI**, **Codex CLI**, plus a **`generic`** fallback adapter for custom JSON-emitting CLIs.
|
|
59
|
+
- **Native Codex CLI MCP Provider**: Includes a built-in stdio JSON-RPC 2.0 MCP server (`xstatusline mcp --harness codex`) implementing `tools/list` and `resources/read` to emit Codex's structured UI Tree with live `settings.json` hot-reload — alongside an optional `--codex-mode legacy` fallback for older builds.
|
|
60
|
+
- **Sub-50ms Hot-Path Rendering**: Strict cold/hot path separation keeps `react` and `ink` out of the non-interactive rendering entry point, respecting `agy`'s 300ms throttle, Claude Code's debounce & 5-column footer margin, and Grok's 5-line / 1024-char ANSI-inclusive line cap.
|
|
61
|
+
- **Graceful Degradation & Turn-0 Stability**: Widgets unsupported by the active harness hide automatically and collapse orphan separators or Powerline transitions with zero broken arrows or `│ │` artifacts. Compatible metric widgets show dimmed zero baselines on turn 0 (configurable via `hideWhenZero: true`), while a 15-minute startup cache hydrates recent quotas and context limits immediately.
|
|
62
|
+
- **Keyboard-Driven Interactive TUI**: Features a sticky live preview (`Tab` / `1–4` to switch harnesses, `v` for 4-harness side-by-side comparison, `w` to simulate narrow terminals), `↑/↓` + Vim `j/k` navigation, live-synced widget options, ANSI 256 & `#RRGGBB` color pickers, a Quick Emoji strip, and reusable **Harness Override Scopes**.
|
|
63
|
+
- **Safe, Non-Destructive Installers**: Previews exact unified diffs via `--dry-run`, creates timestamped `.bak` backups before writing, preserves existing comments, blank lines, and unrelated tables in TOML (`~/.grok/config.toml` & `~/.codex/config.toml`) with `smol-toml` pre-write validation, warns and backs up existing custom hooks during `install`, and protects third-party hooks during `uninstall` unless `--force` is passed.
|
|
64
|
+
- **Portable Config Export, Share Codes & Safe Import**: Back up or share setups via clean `settings.json` files, compact `xsl1:...` share codes, stdin pipes, or the system clipboard — from either the CLI (`xsl export` / `xsl import`) or the interactive TUI — with automatic format detection (native JSON, share codes, `ccstatusline` v1–v3) and built-in `custom-command` security review.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
<a id="supported-harnesses"></a>
|
|
69
|
+
## ◈ Supported Harnesses
|
|
70
|
+
|
|
71
|
+
| Harness | Host Config File | Config Key / Section | Protocol | Highlights & Guards |
|
|
72
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
73
|
+
| **✻ Claude Code** (`claude`) | `~/.claude/settings.json` | `statusLine: { type: "command", command, padding: 0 }` | `stdin` JSON → `stdout` ANSI | Preserves `refreshInterval` & `hideVimModeIndicator`; reserves 5-col Ink footer margin; live TTY & `tmux` pane width probe; native `rate_limits`, `prompt_cache`, `pr`, `output_style`, `thinking`, `lines-changed`, `fast-mode`, and `vim-mode` |
|
|
74
|
+
| **✦ Antigravity CLI** (`agy`) | `~/.gemini/antigravity-cli/settings.json` | `statusLine: { type: "command", command, padding: 0, enabled: true, stack_with_default }` | `stdin` JSON → `stdout` ANSI | Always writes a valid object (never a boolean); preserves `stack_with_default`; symmetric 2-col horizontal margin & `tmux` pane width guard; model-family quota matching, `banked_resets`, `ai_credits`, `subagents`, `sandbox`, `cycle_mode`, `tool_confirmation_pending`, and transcript speed/compaction stats |
|
|
75
|
+
| **⊘ Grok CLI** (`grok`) | `~/.grok/config.toml` (or `$GROK_HOME/config.toml`) | `[ui.status_line]` (`type = "command"`, `command`, `padding = 0`, `refresh_interval = 300`) | `stdin` JSON → `stdout` ANSI | Comment-preserving TOML update; sets `refresh_interval = 300` while preserving custom values; enriches `rate-limit-weekly` via `~/.grok/.usage-cache.json` / `grok usage --json` / proxy-aware billing API (disable with `XSTATUSLINE_NO_NETWORK=1`) and session-delta speed fallback; native `turn-timer`, `token-speed`, `cache-rate`, `git-remote`, `session-name`; enforces 5-line & 1024-char ANSI-inclusive cap |
|
|
76
|
+
| **❖ Codex CLI** (`codex` `>=0.173.0`) | `~/.codex/config.toml` | `[features]` `tui_extensions_statusline = true`<br>`[mcp_servers.xstatusline]`<br>`[tui]` `status_line_provider = { server = "xstatusline", tool = "statusline" }` | Stdio MCP JSON-RPC 2.0 → Structured UI Tree | Comment-preserving TOML update; live `settings.json` hot-reload; stateful per-thread MCP delta speed tracker; inclusive cache-rate denominator, `fast-mode` (`service_tier === "fast"`), `permissions` (`sandbox`), `approval` (`cycle-mode`), `total_credits`; supports `codex.compact`, `codex.maxItems`, and `--codex-mode legacy` |
|
|
77
|
+
| **▸ Generic CLI** (`generic`) | Manual pipe / custom hook | `xstatusline --harness generic` | `stdin` JSON → `stdout` ANSI | Fallback adapter for custom JSON-emitting CLIs (accepts `harness_name`, `model`, `context_window`, `cost`, `workspace`, `vcs`/`git`, `effort`, `vim`, `session_name`, `agent_state`, `version`, `transcript_path`); customizable via `overrides.generic` |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
<a id="quick-start"></a>
|
|
82
|
+
## ◈ Quick Start
|
|
83
|
+
|
|
84
|
+
### Launch the Interactive Studio
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Install globally via npm (recommended — fastest cold start & `xsl` alias)
|
|
88
|
+
npm install -g xstatusline && xsl
|
|
89
|
+
|
|
90
|
+
# Or try instantly via npx (no install required)
|
|
91
|
+
npx xstatusline
|
|
92
|
+
|
|
93
|
+
# Or clone, build, and launch from source (requires Node.js >=20 and pnpm)
|
|
94
|
+
git clone https://github.com/wanghao9610/xstatusline.git
|
|
95
|
+
cd xstatusline
|
|
96
|
+
pnpm install
|
|
97
|
+
pnpm build
|
|
98
|
+
node dist/cli.js
|
|
99
|
+
|
|
100
|
+
# Optional: link `xstatusline` and `xsl` globally from your local build
|
|
101
|
+
npm link
|
|
102
|
+
xsl
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Preview & Install Hooks
|
|
106
|
+
|
|
107
|
+
Preview host config diffs first with `--dry-run`, then install with automatic `.bak` backups:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Inspect detected CLIs and current hook status without modifying any files
|
|
111
|
+
xsl install
|
|
112
|
+
|
|
113
|
+
# Preview unified diffs for all detected CLIs (dry run)
|
|
114
|
+
xsl install all --dry-run
|
|
115
|
+
|
|
116
|
+
# Install into all detected CLIs (automatically creates timestamped .bak backups)
|
|
117
|
+
xsl install all
|
|
118
|
+
|
|
119
|
+
# Or install a single harness (aliases: claude-code, cc, antigravity)
|
|
120
|
+
xsl install claude
|
|
121
|
+
xsl install agy
|
|
122
|
+
xsl install grok
|
|
123
|
+
xsl install codex # Default: Codex MCP UI-Tree provider (>=0.173.0)
|
|
124
|
+
xsl install codex --codex-mode legacy # Optional: Codex built-in status_line items
|
|
125
|
+
|
|
126
|
+
# Or use npx / a local build path instead of a global binary
|
|
127
|
+
xsl install all --mode npx
|
|
128
|
+
xsl install all --mode local
|
|
129
|
+
xsl install claude --mode local --local-bin ./dist/cli.js
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
If a harness already has a third-party custom statusline command, `install` warns you and creates a timestamped `.bak` backup before updating. Pass `--force` with `install all` to also configure CLIs not currently found on your `PATH`.
|
|
133
|
+
|
|
134
|
+
### Verify & Diagnose
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Render realistic side-by-side fixture previews for all 4 harnesses
|
|
138
|
+
xsl preview --all --width 100
|
|
139
|
+
|
|
140
|
+
# Run full diagnostics (Node.js version, detected CLIs, glyphs, config warnings, render latency)
|
|
141
|
+
xsl doctor
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Safe Uninstall
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
xsl uninstall claude --dry-run
|
|
148
|
+
xsl uninstall all
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Third-party statusline hooks and personal shell scripts are never removed during `uninstall` unless you explicitly pass `--force`. For Codex CLI, `uninstall codex` removes the `xstatusline` MCP server and resets `[tui] status_line_provider` while preserving `[features] tui_extensions_statusline = true` so other Codex TUI extensions keep working.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
<a id="interactive-tui"></a>
|
|
156
|
+
## ◈ Interactive Studio
|
|
157
|
+
|
|
158
|
+
Run `xsl` (or `xstatusline`, `xsl tui`, `xsl config`) in an interactive terminal to open the lazy-loaded Ink configurator with a sticky live preview at the top:
|
|
159
|
+
|
|
160
|
+
- **Live Multi-Harness Preview**: Press `Tab` or `1`–`4` to switch the top preview across **Claude Code**, **Antigravity (`agy`)**, **Grok**, and **Codex**. Press `v` to toggle **4-Harness Compare Mode**, and `w` to cycle simulated terminal widths (`Auto → 120 → 80 → 60`) to inspect truncation live.
|
|
161
|
+
- **Harness Override Scopes**: Open `🔀 Harness Overrides` to enter a per-harness scope (`[✻ Claude Override]`, `[✦ AGY Override]`, `[⊘ Grok Override]`, `[❖ Codex Override]`). The same **Edit Lines**, **Edit Colors**, **Powerline & Themes**, **Terminal Options**, and **Scope Overrides** screens edit only that harness while unset fields inherit cleanly from Global — press `r` on any field to reset it back to Global.
|
|
162
|
+
- **Live-Synced Widget Options**: Adjusting options inside `WidgetConfigModal` updates the sticky preview immediately (and is included when pressing `Ctrl+S`); press `Esc` to keep changes and close.
|
|
163
|
+
- **Safe Install Center**: Open `🔌 Install & Manage Harnesses` to inspect detected CLI binaries, versions, and hook states, switch invocation mode (`global` / `npx` / `local`), review exact JSON/TOML diffs in a confirmation modal before writing, install all detected harnesses in one keypress (`A`), run `🩺 Doctor`, or import an existing `ccstatusline` config (`I`).
|
|
164
|
+
- **Config Export, Share Codes & Safe Import**: Open `📦 Export / Import Config` from the Main Menu to export your live draft (even before saving) to a JSON file (`./xstatusline-config.json` by default, with overwrite confirmation and `.bak` backup), copy a compact `xsl1:...` share code (falling back to an inline viewer card if the clipboard is unavailable), or copy formatted JSON to the clipboard, with a `🔒 Strip Custom Commands` toggle to sanitize shell commands before sharing. Import from a file (`~` expansion & drag-and-drop quote trimming), system clipboard, or pasted share code/JSON with automatic format detection (`xstatusline` JSON, `xsl1:...`, `ccstatusline` v1–v3). Whenever an imported config contains `custom-command` widgets (including importing `ccstatusline` via `I` in Install Center), a security review modal prompts you to **Strip custom commands & load preview**, **Trust & keep commands**, or **Cancel**; imported configs load into your live draft for 4-harness preview before saving with `Ctrl+S` (creating an automatic `.bak` backup of your previous `settings.json`).
|
|
165
|
+
- **Smart Input Lock**: While typing in search filters, custom text fields, modal path/paste inputs, or `#RRGGBB` hex inputs, single-key navigation shortcuts (`j`/`k`/`Tab`/`v`/`w`/`1–4`) pause automatically so typing never triggers accidental navigation.
|
|
166
|
+
|
|
167
|
+
### Keybindings
|
|
168
|
+
|
|
169
|
+
| Context | Key(s) | Action |
|
|
170
|
+
| :--- | :--- | :--- |
|
|
171
|
+
| **Global** *(non-input)* | `Tab` / `1`–`4` | Switch live preview harness (`Claude` / `AGY` / `Grok` / `Codex`) |
|
|
172
|
+
| **Global** *(non-input)* | `v` | Toggle single-harness preview vs 4-harness Compare Mode |
|
|
173
|
+
| **Global** *(non-input)* | `w` | Cycle simulated preview width (`Auto → 120 → 80 → 60`) |
|
|
174
|
+
| **Global** | `Ctrl+S` | Save configuration immediately to `settings.json` (auto-creates a `.bak` backup after TUI imports) |
|
|
175
|
+
| **Global** | `Ctrl+C` | Safe exit (prompts confirmation on unsaved changes while preserving current screen state) |
|
|
176
|
+
| **Menus & Lists** | `↑` / `↓` or `j` / `k` | Move selection up / down |
|
|
177
|
+
| **Menus & Lists** | `Enter` / `Esc` | Confirm / go back (from an Override Scope Main Menu, `Esc` returns to Global scope) |
|
|
178
|
+
| **Line List (`LineSelector`)** | `Shift+↑/↓` or `K` / `J` | Reorder lines up / down |
|
|
179
|
+
| **Line List (`LineSelector`)** | `Enter` / `c` | Edit line widgets (`ItemsEditor`) / jump to line colors (`ColorMenu`; `Esc` returns here) |
|
|
180
|
+
| **Line List (`LineSelector`)** | `a` / `d` | Add a new line / delete selected line (confirms non-empty lines; preserves at least 1 line) |
|
|
181
|
+
| **Edit Widgets (`ItemsEditor`)** | `Enter` → `↑`/`↓` (`j`/`k`) → `Enter`/`Esc`/`Space` | Grab selected widget, reorder, and drop (`Shift+↑/↓` or `K`/`J` also reorder directly) |
|
|
182
|
+
| **Edit Widgets (`ItemsEditor`)** | `←` / `→` | Cycle widget type in place |
|
|
183
|
+
| **Edit Widgets (`ItemsEditor`)** | `a` / `c` / `d` | Open searchable `WidgetPicker` (`Enter` on an empty line) / duplicate selected widget below / delete widget |
|
|
184
|
+
| **Edit Widgets (`ItemsEditor`)** | `m` / `r` / `e` | Cycle merge mode (`off → merge → merge-no-pad`) / toggle `rawValue` / open live-synced `WidgetConfigModal` |
|
|
185
|
+
| **Widget Picker (`WidgetPicker`)** | Type / `Tab` / `Shift+Tab` | Live filter widgets / cycle category tabs forward or backward |
|
|
186
|
+
| **Widget Options (`WidgetConfigModal`)** | `↑`/`↓` · `←`/`→`/`Space`/`Enter` · `Esc` | Switch field · toggle boolean / cycle enum / pick emoji · keep changes & close |
|
|
187
|
+
| **Edit Colors (`ColorMenu`)** | `←` / `→` · `f` / `b` | Cycle color presets · switch FG/BG target / toggle bold |
|
|
188
|
+
| **Edit Colors (`ColorMenu`)** | `a` / `h` | Open ANSI 256 grid (`↑↓←→`/`hjkl` navigate, `Enter` pick) / enter `#RRGGBB` hex |
|
|
189
|
+
| **Edit Colors (`ColorMenu`)** | `c` / `r` / `[` `]` | Clone theme palette to line / reset widget color / switch between lines |
|
|
190
|
+
| **Powerline, Terminal & Overrides** | `←`/`→`/`Space`/`Enter` · `a`/`h` · `r` | Adjust setting (incl. `Codex Render Mode`, `Codex Compact Mode`, `Codex Max Items`) · ANSI 256 / Hex picker (Global FG/BG) · clear color or reset overridden field to Global |
|
|
191
|
+
| **Harness Overrides** | `Enter` / `r` / `g` | Enter harness override scope / reset selected harness overrides / return to Global scope |
|
|
192
|
+
| **Install Center** | `←` / `→` | Switch command mode (`global` / `npx` / `local`) |
|
|
193
|
+
| **Install Center** | `Enter` / `A` | Preview diff & install/uninstall selected / install all detected uninstalled harnesses (`Enter`/`y` confirm, `Esc`/`n` cancel) |
|
|
194
|
+
| **Install Center** | `I` / `D` | Import `ccstatusline` config / open `Doctor` diagnostics |
|
|
195
|
+
| **Export / Import (`TransferMenu`)** | `Enter` · `←`/`→`/`Space` | Run selected export/import action · toggle `Strip Custom Commands` |
|
|
196
|
+
| **Text Input Modal (`TextInputModal`)** | `Enter` / `Ctrl+U` / `Esc` | Submit file path or pasted share code/JSON / clear input / cancel |
|
|
197
|
+
| **Import Security Modal (`ImportSecurityModal`)** | `↑`/`↓` (`j`/`k`) + `Enter` · `V` · `S` / `A` / `Esc` | Review detected `custom-command` widgets · expand/collapse all commands (`V`) · strip & load (`S`) / trust & keep (`A`) / cancel (`Esc`) |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
<a id="built-in-widgets"></a>
|
|
202
|
+
## ◈ Built-in Widgets (47)
|
|
203
|
+
|
|
204
|
+
Legend: **🟢 Native** (emitted directly by the host CLI) · **🔵 Enriched** (populated via cached local Git/transcript/PR/usage enrichers or stateful MCP delta tracker) · **⚫ Auto-hidden** (gracefully omitted with zero orphan separators).
|
|
205
|
+
|
|
206
|
+
> **Turn-0 Zero-Baseline Behavior**: Compatible (`🟢`/`🔵`) metric widgets (`context-bar`, `context-percentage`, `context-usable`, `context-length`, `tokens-input`, `tokens-output`, `tokens-cached`, `tokens-total`, `token-speed`, `cache-rate`, `cache-timer`, `session-cost`, `cost-rate`, `session-clock`, `api-duration`) render a dimmed zero baseline before the first turn finishes so your statusline layout stays steady. Set `"hideWhenZero": true` on any widget to hide it until non-zero data arrives.
|
|
207
|
+
|
|
208
|
+
### Harness & Session (18)
|
|
209
|
+
|
|
210
|
+
| Widget Type | Name | Description | CC | AGY | GK | CDX | Key Options |
|
|
211
|
+
| :--- | :--- | :--- | :---: | :---: | :---: | :---: | :--- |
|
|
212
|
+
| `harness` | Harness Badge | Active CLI harness badge (`✻ CLAUDE`, `✦ AGY`, `⊘ GROK`, `❖ CODEX`) | 🟢 | 🟢 | 🟢 | 🟢 | `style`: `badge` \| `compact` \| `icon` \| `full` |
|
|
213
|
+
| `session-clock` | Session Clock | Cumulative elapsed session duration (`12m 34s`) | 🟢 | 🔵 | 🟢 | ⚫ | `hideWhenZero` (`false`), `rawValue` |
|
|
214
|
+
| `api-duration` | API Duration | Cumulative active API time with optional session ratio (`API 2m 26s (18%)`) | 🟢 | 🔵 | 🟢 | ⚫ | `showRatio` (`true`), `hideWhenZero` (`false`) |
|
|
215
|
+
| `turn-timer` | Turn Timer | Active turn duration with subsecond precision (`1.4s`) | ⚫ | ⚫ | 🟢 | ⚫ | `rawValue` |
|
|
216
|
+
| `turn-count` | Turn Count | User turn count and detected compactions (`8 turns` / `8t · 1c`) | 🔵 | 🔵 | 🔵 | ⚫ | `showCompactions` (`true`), `hideWhenZero` (`true`) |
|
|
217
|
+
| `session-name` | Session Name | Active conversation / thread title | 🟢 | 🟢 | 🟢 | 🟢 | `maxLength` (default `24`) |
|
|
218
|
+
| `agent-state` | Agent State | Live agent activity (`thinking`, `working`, `tool_use`, `idle`) | ⚫ | 🟢 | ⚫ | 🟢 | `showIcon` (`true`) |
|
|
219
|
+
| `subagents` | Subagents | Running/total subagents with optional role list (`2/3 agents`) | ⚫ | 🟢 | ⚫ | ⚫ | `showRoles` (`false`), `hideWhenZero` (`true`), `showIcon` |
|
|
220
|
+
| `sandbox` | Sandbox Status | Execution sandbox or permission profile (`sandbox` / `unsandboxed`) | ⚫ | 🟢 | ⚫ | 🟢 | `style`: `text` \| `badge` \| `profile`, `hideWhenOff` (`false`), `showIcon` |
|
|
221
|
+
| `cycle-mode` | Cycle / Approval Mode | Agent cycle mode (`⚡ Auto`, `◫ Plan`) or Codex approval policy (`on-request`) | ⚫ | 🟢 | ⚫ | 🟢 | `style`: `text` \| `badge` |
|
|
222
|
+
| `output-style` | Output Style | Active Claude Code output style (auto-hides `"default"` by default) | 🟢 | ⚫ | ⚫ | ⚫ | `hideDefault` (`true`), `showIcon` |
|
|
223
|
+
| `thinking` | Thinking Indicator | Extended thinking enabled/active indicator (`✦ think`) | 🟢 | 🟢 | 🟢 | 🟢 | `mode`: `enabled` \| `active` |
|
|
224
|
+
| `tool-confirmation` | Tool Confirmation Alert | High-visibility bold alert when tool approval is pending (`❗ CONFIRM`) | ⚫ | 🟢 | ⚫ | ⚫ | `label` (`CONFIRM`) |
|
|
225
|
+
| `effort` | Reasoning Effort | Active reasoning effort level (`low`, `medium`, `high`, `xhigh`, `max`) | 🟢 | 🟢 | 🟢 | 🟢 | `rawValue` |
|
|
226
|
+
| `vim-mode` | Vim Mode | Editor Vim mode indicator (`NORMAL` / `INSERT` / `VISUAL`) | 🟢 | 🟢 | ⚫ | ⚫ | `rawValue` |
|
|
227
|
+
| `fast-mode` | Fast Mode | Indicator shown when fast inference mode is active (`fast_mode` / Codex `service_tier: "fast"`) | 🟢 | ⚫ | ⚫ | 🟢 | `rawValue` |
|
|
228
|
+
| `version` | CLI Version | Host harness CLI version string | 🟢 | 🟢 | 🟢 | 🟢 | `rawValue` |
|
|
229
|
+
| `account` | Account & Plan | Subscription plan tier and/or account identifier | ⚫ | 🟢 | ⚫ | 🟢 | `showPlan` (`true`), `showEmail` (`false`) |
|
|
230
|
+
|
|
231
|
+
### Model, Context, Tokens & Cache (12)
|
|
232
|
+
|
|
233
|
+
| Widget Type | Name | Description | CC | AGY | GK | CDX | Key Options |
|
|
234
|
+
| :--- | :--- | :--- | :---: | :---: | :---: | :---: | :--- |
|
|
235
|
+
| `model` | Model | Active LLM model name with optional reasoning effort | 🟢 | 🟢 | 🟢 | 🟢 | `format`: `full` \| `compact`, `showReasoning` (`true`), `showIcon` |
|
|
236
|
+
| `context-bar` | Context Progress Bar | Threshold-colored visual progress bar | 🟢 | 🟢 | 🟢 | 🟢 | `width` (`10`), `style`: `blocks` \| `braille` \| `ascii` \| `dots`, `warnAt` (`70`), `dangerAt` (`85`), `showPercentage` (`false`), `hideWhenZero` |
|
|
237
|
+
| `context-percentage` | Context Percentage | Context window used or remaining percentage | 🟢 | 🟢 | 🟢 | 🟢 | `mode`: `used` \| `remaining`, `warnAt` (`70`), `dangerAt` (`85`), `hideWhenZero` |
|
|
238
|
+
| `context-usable` | Context Usable % | Usage normalized against auto-compact threshold (default `80%`) | 🟢 | 🟢 | 🟢 | 🟢 | `threshold` (`80`), `warnAt` (`70`), `dangerAt` (`85`), `hideWhenZero` |
|
|
239
|
+
| `context-length` | Context Length | Used vs max context tokens (e.g. `84.2k/200k`) | 🟢 | 🟢 | 🟢 | 🟢 | `showMax` (`true`), `warnAt` (`70`), `dangerAt` (`85`), `showIcon`, `hideWhenZero` |
|
|
240
|
+
| `tokens-input` | Input Tokens | Session/current input token count | 🟢 | 🟢 | 🟢 | 🟢 | `hideWhenZero`, `rawValue` |
|
|
241
|
+
| `tokens-output` | Output Tokens | Session/current output token count | 🟢 | 🟢 | 🟢 | 🟢 | `hideWhenZero`, `rawValue` |
|
|
242
|
+
| `tokens-cached` | Cached Tokens | Prompt cache read + write token count (`💾 12.4k`) | 🟢 | 🟢 | 🟢 | 🟢 | `showIcon` (`true`), `hideWhenZero`, `rawValue` |
|
|
243
|
+
| `tokens-total` | Total Tokens | Total session tokens across input, output, and cache | 🟢 | 🟢 | 🟢 | 🟢 | `hideWhenZero`, `rawValue` |
|
|
244
|
+
| `token-speed` | Token Speed | Token throughput (`⚡ 48.2 tok/s`) from API duration, transcript, or MCP delta | 🟢 | 🔵 | 🟢 | 🔵 | `mode`: `output` \| `input` \| `total`, `style`: `default` \| `compact`, `precision` (`1`), `showIcon` (`true`), `hideWhenZero` |
|
|
245
|
+
| `cache-rate` | Cache Hit Rate | Prompt cache hit % with per-harness denominator accuracy (`🔥 93% (4m)` / `🧊 74%`) | 🟢 | 🟢 | 🟢 | 🟢 | `scope`: `session` \| `turn`, `showTtl` (`true`), `showMisses` (`false`), `showIcon` (`true`), `hideWhenZero` |
|
|
246
|
+
| `cache-timer` | Cache Warm/Cold Timer | Prompt cache warm TTL countdown or cold recache cost (`🔥 4m` / `🧊 cold`) | 🟢 | ⚫ | ⚫ | ⚫ | `showRecacheCost` (`false`), `hideWhenZero` |
|
|
247
|
+
|
|
248
|
+
### Cost & Quota (7)
|
|
249
|
+
|
|
250
|
+
| Widget Type | Name | Description | CC | AGY | GK | CDX | Key Options |
|
|
251
|
+
| :--- | :--- | :--- | :---: | :---: | :---: | :---: | :--- |
|
|
252
|
+
| `session-cost` | Session Cost | Cumulative session USD cost (`~` prefix when estimated + optional subagent cost) | 🟢 | 🟢 | 🟢 | 🟢 | `precision` (`2`), `showSubagent` (`false`), `hideWhenZero` |
|
|
253
|
+
| `cost-rate` | Cost Burn Rate | Spend rate in USD/hour (`$2.14/hr`; dimmed `$0.00/hr` baseline under 10s elapsed unless `hideWhenZero: true`) | 🟢 | 🔵 | 🟢 | ⚫ | `precision` (`2`), `hideWhenZero` (`false`) |
|
|
254
|
+
| `lines-changed` | Lines Changed | Session code lines added and removed (`+42 -11`) | 🟢 | ⚫ | ⚫ | ⚫ | `showIcon` |
|
|
255
|
+
| `rate-limit-5h` | Rate Limit (5h) | 5-hour rolling quota with pace (`⇡`/`⇣`/`=`), forecast, remaining mode, and reset timer | 🟢 | 🟢 | ⚫ | 🟢 | `mode`: `used` \| `remaining`, `showReset` (`true`), `showPace`, `showForecast`, `showBar`, `warnAt` (`70`), `dangerAt` (`90`) |
|
|
256
|
+
| `rate-limit-weekly` | Rate Limit (Weekly) | 7-day / weekly / Grok plan quota (`~/.grok/.usage-cache.json`) with pace, forecast, remaining mode, and reset timer | 🟢 | 🟢 | 🔵 | 🟢 | `mode`: `used` \| `remaining`, `showReset` (`true`), `showPace`, `showForecast`, `showBar`, `warnAt` (`70`), `dangerAt` (`90`) |
|
|
257
|
+
| `banked-resets` | Banked Resets | Antigravity banked quota resets remaining and claimable count (`↻ 3 (1 ready)`) | ⚫ | 🟢 | ⚫ | ⚫ | `hideWhenZero` (`true`), `showExpiry` (`false`) |
|
|
258
|
+
| `ai-credits` | AI Credits | Remaining AI credits (AGY) or credits consumed (Codex) (`480 cr`) | ⚫ | 🟢 | ⚫ | 🟢 | `lowThreshold` (`20`), `hideWhenZero` (`false`) |
|
|
259
|
+
|
|
260
|
+
### Workspace & Git (6)
|
|
261
|
+
|
|
262
|
+
| Widget Type | Name | Description | CC | AGY | GK | CDX | Key Options |
|
|
263
|
+
| :--- | :--- | :--- | :---: | :---: | :---: | :---: | :--- |
|
|
264
|
+
| `cwd` | Working Directory | Workspace path with optional OSC 8 clickable hyperlink | 🟢 | 🟢 | 🟢 | 🟢 | `format`: `fish` \| `basename` \| `full`, `clickable`: `false` \| `true` \| `file` \| `vscode` \| `cursor` |
|
|
265
|
+
| `git-branch` | Git Branch | Active Git or Jujutsu branch name | 🔵 | 🟢 | 🟢 | 🔵 | `showIcon` (`true`) |
|
|
266
|
+
| `git-changes` | Git Changes | Dirty flag `*`, conflicts `!N`, ahead/behind `↑↓`, and `+ins -del` diff stats | 🔵 | 🔵 | 🔵 | 🔵 | `showAheadBehind` (`true`), `showDiffStat` (`true`), `showCounts` (`false`) |
|
|
267
|
+
| `git-worktree` | Git Worktree | Linked git worktree name | 🟢 | 🔵 | 🟢 | 🔵 | `rawValue` |
|
|
268
|
+
| `git-remote` | Git Remote | Repository `owner/repo` with clickable HTTPS link (`dev/xstatusline`) | 🟢 | 🔵 | 🟢 | 🔵 | `format`: `owner/repo` \| `repo`, `clickable` (`true`), `showIcon` |
|
|
269
|
+
| `pr-status` | PR / MR Status | Active GitHub PR / GitLab MR `#142 ✓` (lazy cached `gh`/`glab`; 0ms when unused) | 🟢 | 🔵 | 🔵 | 🔵 | `showDraft` (`true`), `showReview` (`true`), `clickable` (`true`), `showIcon` |
|
|
270
|
+
|
|
271
|
+
### Layout & Custom (4)
|
|
272
|
+
|
|
273
|
+
| Widget Type | Name | Description | CC | AGY | GK | CDX | Key Options |
|
|
274
|
+
| :--- | :--- | :--- | :---: | :---: | :---: | :---: | :--- |
|
|
275
|
+
| `separator` | Separator | Static divider between adjacent widgets | 🟢 | 🟢 | 🟢 | 🟢 | `character` (defaults to `defaultSeparator`) |
|
|
276
|
+
| `flex-separator` | Flex Separator | Elastic spacer pushing trailing widgets to the right | 🟢 | 🟢 | 🟢 | 🟢 | Controlled by top-level `flexMode` |
|
|
277
|
+
| `custom-text` | Custom Text | Static custom label or emoji snippet | 🟢 | 🟢 | 🟢 | 🟢 | `text` |
|
|
278
|
+
| `custom-command` | Custom Command | Execute a shell command (`sh -c` on POSIX, `cmd.exe /d /s /c` on Windows) with timeout, stdin JSON (`NormalizedStatusContext`), and optional TTL cache | 🟢 | 🟢 | 🟢 | 🟢 | `command`, `timeoutMs` (`1000`), `preserveColors`, `maxWidth`, `metadata.passStdin` (`true`), `metadata.cacheTtlSec` |
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## ◈ Themes, Powerline & Icons
|
|
283
|
+
|
|
284
|
+
- **7 Built-In Themes**: `catppuccin-mocha` *(default)*, `tokyo-night`, `nord`, `dracula`, `gruvbox`, `default`, `minimal`
|
|
285
|
+
- **5 Powerline Styles**: `arrow` (`` / ``), `round` (`` / ``), `slant` (`` / ``), `thin` (`` / ``), `none` *(flat colored pills — zero Nerd Font required)*
|
|
286
|
+
- **5 Icon Styles (`iconStyle`)**:
|
|
287
|
+
- `emoji+nerd` *(default)* — expressive emojis paired with Nerd Font Git/Vim glyphs
|
|
288
|
+
- `emoji` — zero Nerd Font required; crisp out of the box on macOS Terminal, Warp, Ghostty, iTerm2, Kitty, and Windows Terminal
|
|
289
|
+
- `nerd` — pure Nerd Font glyphs
|
|
290
|
+
- `text` — pure ASCII labels (`CC`, `AGY`, `GK`, `CDX`, `mdl`, `git`)
|
|
291
|
+
- `none` — ultra-minimal text with no icons
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
<a id="cli-reference"></a>
|
|
296
|
+
## ◈ CLI Reference
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Default entry routing:
|
|
300
|
+
xsl # Launch interactive TUI when stdin is a TTY
|
|
301
|
+
cat payload.json | xsl # Hot-path render with automatic harness detection
|
|
302
|
+
cat payload.json | xsl --harness agy # Explicit harness render (claude | agy | grok | codex | generic)
|
|
303
|
+
|
|
304
|
+
# Global flags:
|
|
305
|
+
xsl -h | --help | help [subcommand] # Show top-level or subcommand help
|
|
306
|
+
xsl -v | --version # Print CLI version
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
| Subcommand | Description & Flags |
|
|
310
|
+
| :--- | :--- |
|
|
311
|
+
| `tui` / `config` | Launch the interactive Ink configuration TUI. Flags: `--config <file>`, `--home <dir>` |
|
|
312
|
+
| `render` *(or piped stdin)* | Parse stdin JSON and output the rendered statusline. Flags: `--harness <id>` (aliases `claude-code`, `cc`, `antigravity`), `--format <ansi\|plain\|json>`, `--plain`, `--json`, `--width <cols>`, `--color-level <none\|16\|256\|truecolor\|0\|1\|2\|3>`, `--config <file>`, `--no-enrich` (`--skip-enrichers`) |
|
|
313
|
+
| `install [target]` | Install into `claude \| agy \| grok \| codex \| all` (omit target to view detection status). Flags: `--dry-run` (`-n`), `--mode <global\|npx\|local>`, `--local-bin <path>`, `--codex-mode <mcp\|legacy>`, `--force` (`-f`, include undetected harnesses on `all`), `--home <dir>`, `--json` |
|
|
314
|
+
| `uninstall [target]` | Safely remove from `claude \| agy \| grok \| codex \| all` (omit target to view detection status). Flags: `--dry-run` (`-n`), `--codex-mode <mcp\|legacy>`, `--force` (`-f`, required to remove custom third-party hooks), `--home <dir>`, `--json` |
|
|
315
|
+
| `preview [target]` | Render realistic fixture payloads in your terminal (optional positional `claude \| agy \| grok \| codex \| all`). Flags: `--all` (`-a`), `--harness <id>`, `--width <cols>`, `--theme <id>`, `--format <ansi\|plain\|json>`, `--plain`, `--json`, `--color-level <none\|16\|256\|truecolor\|0\|1\|2\|3>`, `--config <file>`, `--allow-custom-commands` (opt in to execute `custom-command` shell widgets; disabled by default) |
|
|
316
|
+
| `doctor` | Inspect Node.js `>=20`, installed CLIs (`claude`/`agy`/`grok`/`codex`), config warnings, Nerd Font/Powerline glyph self-check, and in-process render latency benchmark (5 runs, `skipEnrichers`). Flags: `--json`, `--home <dir>`, `--config <file>` |
|
|
317
|
+
| `capture` | Diagnostic passthrough proxy logging timestamped host stdin payloads to `~/.config/xstatusline/captures/` (or `--out`, `0o600` owner-only permissions) while rendering normally. Flags: `--harness <id>`, `--out <dir>` (`--out-dir`), `--redact`, `--width <cols>`, `--color-level <none\|16\|256\|truecolor\|0\|1\|2\|3>`, `--config <file>`, `--home <dir>`, `--no-enrich` (`--skip-enrichers`) |
|
|
318
|
+
| `export [file]` | Export the active configuration as clean `settings.json` or a compact `xsl1:...` share code (stdout stays pure for piping; file writes are atomic and refuse overwrite without `--force`). Flags: `-o` / `--output <file>` (`-` for stdout), `--format <json\|code>`, `--code`, `-c` / `--clipboard`, `--compact`, `--strip-commands`, `-f` / `--force` (creates `.bak` when overwriting), `--config <file>` |
|
|
319
|
+
| `import [source]` | Import a configuration from a JSON/code file, `xsl1:...` share code, `-` (or piped stdin), or system clipboard with automatic format detection (`xstatusline` JSON, `xsl1:...`, `ccstatusline` v1–v3). Blocks writing `custom-command` widgets unless `--allow-commands` or `--strip-commands` is passed. Flags: `--from <auto\|xstatusline\|ccstatusline>` (default `auto`; `--from ccstatusline` without a path defaults to `~/.config/ccstatusline/settings.json`), `--path <file>`, `--code <string>`, `-c` / `--clipboard`, `--output <file>` (`--config <file>`), `--allow-commands`, `--strip-commands`, `-n` / `--dry-run`, `-f` / `--force` (creates `.bak` backup), `--json` |
|
|
320
|
+
| `mcp` / `serve` | Run the stdio JSON-RPC 2.0 MCP statusline provider for Codex CLI (`>=0.173.0`) with live `settings.json` hot-reload. Flags: `--harness <codex>`, `--capture-dir <dir>` (`--capture <dir>`), `--redact`, `--config <file>`, `--no-enrich` (`--skip-enrichers`) |
|
|
321
|
+
| `help [subcommand]` | Display top-level help or help for a specific subcommand (e.g. `xsl help install`). |
|
|
322
|
+
|
|
323
|
+
### Export, Share Codes & Migration
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# 1. Export / import a clean JSON file (compatible with --config and dotfiles)
|
|
327
|
+
xsl export -o ./my-statusline.json
|
|
328
|
+
xsl preview --all --config ./my-statusline.json
|
|
329
|
+
xsl import ./my-statusline.json --dry-run
|
|
330
|
+
xsl import ./my-statusline.json --force # Creates a timestamped .bak backup
|
|
331
|
+
|
|
332
|
+
# 2. Share via compact xsl1:... share code
|
|
333
|
+
xsl export --code # Prints xsl1:... to stdout
|
|
334
|
+
xsl import "xsl1:..." --dry-run # Or pass --code "xsl1:..."
|
|
335
|
+
|
|
336
|
+
# 3. Round-trip via the system clipboard
|
|
337
|
+
xsl export --code --clipboard # Copy share code directly to clipboard
|
|
338
|
+
xsl import --clipboard --dry-run # Auto-detects JSON, xsl1:, or ccstatusline
|
|
339
|
+
|
|
340
|
+
# 4. Pipe export directly into import (stdin via `-` or piped non-TTY)
|
|
341
|
+
xsl export | xsl import - --dry-run
|
|
342
|
+
|
|
343
|
+
# 5. Safe handling of custom-command widgets
|
|
344
|
+
xsl export --code --strip-commands --clipboard # Sanitize custom commands before sharing
|
|
345
|
+
xsl import ./shared.json --strip-commands --force # Remove custom-command widgets on import
|
|
346
|
+
xsl import ./shared.json --allow-commands --force # Explicitly trust and keep custom commands
|
|
347
|
+
|
|
348
|
+
# 6. Migrate from ccstatusline (v1–v3)
|
|
349
|
+
xsl import --from ccstatusline --dry-run # Reads ~/.config/ccstatusline/settings.json
|
|
350
|
+
xsl import --from ccstatusline --path ./ccstatusline.json --force
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
<a id="configuration"></a>
|
|
356
|
+
## ◈ Configuration
|
|
357
|
+
|
|
358
|
+
Configuration path resolution order:
|
|
359
|
+
1. `$XSTATUSLINE_CONFIG` (if set)
|
|
360
|
+
2. `$XDG_CONFIG_HOME/xstatusline/settings.json` (if set)
|
|
361
|
+
3. `~/.config/xstatusline/settings.json`
|
|
362
|
+
|
|
363
|
+
```json
|
|
364
|
+
{
|
|
365
|
+
"version": 1,
|
|
366
|
+
"theme": "catppuccin-mocha",
|
|
367
|
+
"colorLevel": "truecolor",
|
|
368
|
+
"iconStyle": "emoji+nerd",
|
|
369
|
+
"defaultSeparator": " │ ",
|
|
370
|
+
"defaultPadding": " ",
|
|
371
|
+
"flexMode": "full-until-compact",
|
|
372
|
+
"truncateMode": "smart",
|
|
373
|
+
"globalBold": false,
|
|
374
|
+
"powerline": {
|
|
375
|
+
"enabled": true,
|
|
376
|
+
"style": "arrow",
|
|
377
|
+
"startCap": "",
|
|
378
|
+
"endCap": "",
|
|
379
|
+
"autoAlign": false,
|
|
380
|
+
"continueThemeAcrossLines": false
|
|
381
|
+
},
|
|
382
|
+
"lines": [
|
|
383
|
+
[
|
|
384
|
+
{ "id": "1", "type": "harness", "style": "badge" },
|
|
385
|
+
{ "id": "2", "type": "model", "showReasoning": true },
|
|
386
|
+
{ "id": "3", "type": "context-bar", "width": 10, "warnAt": 70, "dangerAt": 85, "showPercentage": false, "merge": "merge" },
|
|
387
|
+
{ "id": "4", "type": "context-percentage", "mode": "used" },
|
|
388
|
+
{ "id": "5", "type": "flex-separator" },
|
|
389
|
+
{ "id": "6", "type": "rate-limit-5h", "showReset": true },
|
|
390
|
+
{ "id": "7", "type": "turn-timer" },
|
|
391
|
+
{ "id": "8", "type": "session-cost" }
|
|
392
|
+
],
|
|
393
|
+
[
|
|
394
|
+
{ "id": "9", "type": "cwd", "format": "fish", "clickable": "vscode" },
|
|
395
|
+
{ "id": "10", "type": "git-branch", "merge": "merge" },
|
|
396
|
+
{ "id": "11", "type": "git-changes" },
|
|
397
|
+
{ "id": "12", "type": "agent-state" },
|
|
398
|
+
{ "id": "13", "type": "vim-mode" }
|
|
399
|
+
]
|
|
400
|
+
],
|
|
401
|
+
"overrides": {
|
|
402
|
+
"codex": {
|
|
403
|
+
"powerline": { "enabled": false },
|
|
404
|
+
"maxLines": 1,
|
|
405
|
+
"codex": { "mode": "mcp", "compact": false, "maxItems": 8 }
|
|
406
|
+
},
|
|
407
|
+
"agy": {
|
|
408
|
+
"theme": "tokyo-night"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### Schema Options
|
|
415
|
+
|
|
416
|
+
- **Top-Level & Per-Harness Override Fields** (`overrides.claude | agy | grok | codex | generic`):
|
|
417
|
+
- `theme`: `catppuccin-mocha` \| `tokyo-night` \| `nord` \| `dracula` \| `gruvbox` \| `default` \| `minimal`
|
|
418
|
+
- `colorLevel`: `none` \| `16` \| `256` \| `truecolor` (capped by terminal capability & `NO_COLOR`/`FORCE_COLOR`)
|
|
419
|
+
- `iconStyle`: `emoji+nerd` \| `emoji` \| `nerd` \| `text` \| `none`
|
|
420
|
+
- `defaultSeparator` / `defaultPadding`: custom separator and padding strings (`""` supported for compact layouts)
|
|
421
|
+
- `flexMode`: `full` (fill terminal width) \| `full-minus-40` (reserve 40 cols, floor 60) \| `full-until-compact` (full width until Claude context reaches `>= 70%`)
|
|
422
|
+
- `truncateMode`: `smart` (drop lowest-priority pills, then ellipsis-truncate) \| `drop` \| `ellipsis` \| `none`
|
|
423
|
+
- `globalBold`, `globalFg`, `globalBg`: global typography and fallback foreground/background overrides
|
|
424
|
+
- `maxLines`: integer `1`–`10` (caps visible lines globally or per harness)
|
|
425
|
+
- `lines`: array of widget lines (overrides the full line/widget layout for a specific harness under `overrides.<harness>.lines`)
|
|
426
|
+
- `powerline`: `{ enabled, style, startCap, endCap, autoAlign, continueThemeAcrossLines }`
|
|
427
|
+
- `codex`: `{ mode: "mcp" | "legacy", compact?: boolean, maxItems?: 1..20 }` (also editable in TUI **Terminal Options**)
|
|
428
|
+
- **Common Per-Widget Fields**: `fg`, `bg` (`#RRGGBB`, `#RGB`, `ansi256:N`, named ANSI color, or semantic theme token such as `accent`, `warn`, `danger`, `widgets.cwd`), `bold`, `dim`, `label`, `rawValue`, `merge` (`off` \| `merge` \| `merge-no-pad`), `priority` (`0`–`100`), `maxLength`, `hideWhenZero`.
|
|
429
|
+
|
|
430
|
+
### Environment Variables
|
|
431
|
+
|
|
432
|
+
| Variable | Effect |
|
|
433
|
+
| :--- | :--- |
|
|
434
|
+
| `XSTATUSLINE_CONFIG` | Explicit path to `settings.json` (highest priority) |
|
|
435
|
+
| `XDG_CONFIG_HOME` | Base config directory (`$XDG_CONFIG_HOME/xstatusline/settings.json`) |
|
|
436
|
+
| `XDG_CACHE_HOME` | Base private cache directory (`$XDG_CACHE_HOME/xstatusline`, defaults to `~/.cache/xstatusline`, `0o700`) |
|
|
437
|
+
| `GROK_HOME` | Custom Grok CLI home directory (`$GROK_HOME/config.toml`, `auth.json`, & `.usage-cache.json`) |
|
|
438
|
+
| `XSTATUSLINE_NO_NETWORK` | Set to `1` / `true` / `yes` to disable Grok quota network and CLI refreshes |
|
|
439
|
+
| `GROK_CLI_CHAT_PROXY_BASE_URL` | Override Grok billing proxy base URL for quota refreshes |
|
|
440
|
+
| `XSTATUSLINE_REVIEW_HOSTS` | Comma-separated opt-in allowlist of self-hosted/enterprise GitHub or GitLab hostnames for `pr-status` (e.g. `gitlab.corp.example,github:git.internal`; defaults to exact `github.com` and `gitlab.com` only) |
|
|
441
|
+
| `HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY`, `NO_PROXY` | Proxy configuration for Grok quota fetches (macOS also auto-reads `scutil --proxy`) |
|
|
442
|
+
| `NO_COLOR` / `FORCE_COLOR` | Disable ANSI output (`NO_COLOR=1`) or force ANSI color level (`0`–`3`) |
|
|
443
|
+
| `COLUMNS` | Explicit terminal column width override |
|
|
444
|
+
| `TMUX` / `TMUX_PANE` | Enables live `tmux` pane width probing when stdio is piped |
|
|
445
|
+
|
|
446
|
+
### Security & Privacy
|
|
447
|
+
|
|
448
|
+
- **`custom-command` Safety**: `custom-command` widgets are read **exclusively** from your personal user-level configuration (`~/.config/xstatusline/settings.json`), never from project-local repository files, preventing untrusted repositories from executing arbitrary shell commands. Execution is also suppressed during TUI live preview, `xsl doctor`, and `xsl preview` unless `--allow-custom-commands` is explicitly passed. During config import, `xstatusline` scans both global `lines` and per-harness `overrides` for `custom-command` widgets: the CLI refuses to write by default (listing every command) unless `--allow-commands` or `--strip-commands` is passed, and the interactive TUI opens a security review modal before loading them into your draft. When sharing your setup, pass `--strip-commands` (or enable **Strip Custom Commands** in the TUI) to sanitize commands on export.
|
|
449
|
+
- **Grok Quota Enrichment**: When rendering on Grok with any quota widget configured (`rate-limit-5h` or `rate-limit-weekly` — note `rate-limit-5h` is included in the default layout), `xstatusline` first runs `grok usage --json` and, if unavailable or failing, falls back to reading your OAuth/OIDC token from `~/.grok/auth.json` (or `$GROK_HOME/auth.json`) to query `https://cli-chat-proxy.grok.com/v1/billing?format=credits` (cached in `~/.grok/.usage-cache.json`, 300s TTL). Set `XSTATUSLINE_NO_NETWORK=1`, pass `--no-enrich`, or remove quota widgets from your Grok config to disable this completely.
|
|
450
|
+
- **Opt-In `pr-status` Lookup**: Not in the default layout. When added, reads `~/.ssh/config` to canonicalize SSH host aliases and invokes `gh` / `glab` only for exact `github.com` and `gitlab.com` remotes by default (opt in to self-hosted hosts via `XSTATUSLINE_REVIEW_HOSTS`; skip with `--no-enrich`).
|
|
451
|
+
- **Local Git, Transcript & Codex MCP Probes**: Git and transcript enrichers invoke `git` (`execFile`, no shell) and read harness-reported transcript files locally. The Codex MCP server may run local `ps`, `lsof` (or read `/proc/<pid>/cwd`), `stty`, and `tmux` probes to resolve workspace and terminal width. Pass `--no-enrich` to skip external enrichers and probes.
|
|
452
|
+
- **Private Caches & Safe Host Backups**: Runtime caches live under `$XDG_CACHE_HOME/xstatusline` or `~/.cache/xstatusline` (`0o700`), and host/config edits write atomically (`0o600` default for new files, preserving dotfile symlinks and existing modes) with timestamped `.bak` backups. See [`SECURITY.md`](./SECURITY.md) for the full security policy.
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
<a id="troubleshooting"></a>
|
|
457
|
+
## ◈ Troubleshooting
|
|
458
|
+
|
|
459
|
+
- **Run `xsl doctor` first**: Checks Node.js `>=20`, active config warnings, all 4 host CLI installations/versions, Powerline/Nerd Font glyph rendering, and in-process render latency (`xsl doctor --json` for machine-readable output).
|
|
460
|
+
- **Garbled icons or `[?]` boxes**: Install a [Nerd Font](https://www.nerdfonts.com/) in your terminal, or open `xsl` → **Powerline & Themes** and set `Icon Style` to `emoji` (or `text`) and `Separator Style` to `none` (flat colored pills) or disable `Powerline Mode`.
|
|
461
|
+
- **Inspect live host payloads**: Temporarily point a host hook at `xsl capture --redact` (saves to `~/.config/xstatusline/captures/` by default, or `--out <dir>`), or pass `--capture-dir ./captures --redact` to `xsl mcp --harness codex` (saves to `./captures`). Captured envelopes scrub emails, home prefixes, and credentials before writing with `0o600` permissions.
|
|
462
|
+
- **Codex CLI MCP statusline not showing**:
|
|
463
|
+
- Verify Codex CLI is `>=0.173.0` (`codex --version`).
|
|
464
|
+
- Run `xsl doctor` to confirm `[features] tui_extensions_statusline = true`, `[mcp_servers.xstatusline]`, and `[tui] status_line_provider` in `~/.codex/config.toml`.
|
|
465
|
+
- Changes saved to `settings.json` reload automatically on the next MCP poll without restarting Codex.
|
|
466
|
+
- On older Codex builds, install the built-in fallback via `xsl install codex --codex-mode legacy`.
|
|
467
|
+
- **Grok quota missing or slow on restricted networks**: Grok quota enrichment caches results in `~/.grok/.usage-cache.json` (300s TTL) and respects `HTTPS_PROXY`/`ALL_PROXY`/`NO_PROXY` (plus macOS system proxies). Set `XSTATUSLINE_NO_NETWORK=1` for strict offline operation.
|
|
468
|
+
- **Dimmed zeros at session start**: Compatible metric widgets render dimmed zero baselines on turn 0 to eliminate layout jitter. Set `"hideWhenZero": true` on any widget (or toggle **Hide When Zero** in `WidgetConfigModal`) to hide it until active.
|
|
469
|
+
- **Wrong line width in `tmux` or narrow splits**: `xstatusline` probes `COLUMNS`, `tmux` pane width (`$TMUX` + `$TMUX_PANE`), and controlling/ancestor TTYs automatically. Use `--width <cols>` or `COLUMNS` to test or pin a fixed width.
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## ◈ Architecture
|
|
474
|
+
|
|
475
|
+
`xstatusline` cleanly isolates the lightweight non-interactive hot path from the lazy-loaded Ink TUI:
|
|
476
|
+
|
|
477
|
+
```text
|
|
478
|
+
src/cli.ts (zero static react/ink/smol-toml imports)
|
|
479
|
+
├─ Hot path: render / capture / preview / mcp
|
|
480
|
+
│ └─ src/core/pipeline.ts
|
|
481
|
+
│ ├─ src/adapters/ (claude, agy, grok, codex, generic + auto-detect)
|
|
482
|
+
│ ├─ src/enrichers/ (git, transcript, grok-usage, startup-cache, lazy PR/MR review)
|
|
483
|
+
│ ├─ src/widgets/ (47 widgets -> canonical RenderedLine IR)
|
|
484
|
+
│ └─ src/render/ (ansi Powerline/plain, plain/json debug, codex-ui Tree)
|
|
485
|
+
├─ Host & config management: install / uninstall / doctor / export / import
|
|
486
|
+
│ ├─ src/installers/ (atomic JSON & comment-preserving TOML + .bak backups)
|
|
487
|
+
│ └─ src/config/ (Zod schema, defaults, per-harness overrides, export/import & share codes)
|
|
488
|
+
├─ Codex MCP server: src/mcp/codex-server.ts (zero-dep stdio JSON-RPC 2.0 + EMA speed tracker)
|
|
489
|
+
└─ Cold path (dynamic import on TTY only): src/tui/ (React 18 + Ink 5 interactive configurator)
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
<a id="contributing-a-new-harnessadapter"></a>
|
|
495
|
+
## ◈ Extending
|
|
496
|
+
|
|
497
|
+
`xstatusline` decouples host CLI protocols from widgets and renderers via the `HarnessAdapter` interface (`src/core/types.ts`). Adding a new terminal coding agent CLI (such as OpenCode, Gemini CLI, or Aider) takes 4 steps:
|
|
498
|
+
|
|
499
|
+
1. **Create `src/adapters/<your-harness>.ts`** implementing `HarnessAdapter`:
|
|
500
|
+
```ts
|
|
501
|
+
import type { HarnessAdapter, NormalizedStatusContext } from '../core/types.js';
|
|
502
|
+
|
|
503
|
+
export const myHarnessAdapter: HarnessAdapter = {
|
|
504
|
+
id: 'my-harness',
|
|
505
|
+
displayName: 'My CLI',
|
|
506
|
+
shortCode: 'MY',
|
|
507
|
+
protocol: 'stdin-ansi',
|
|
508
|
+
detect(payload: unknown): number {
|
|
509
|
+
// Return confidence in [0, 1] using unique payload keys
|
|
510
|
+
return 0;
|
|
511
|
+
},
|
|
512
|
+
parse(payload: unknown, options): NormalizedStatusContext {
|
|
513
|
+
// Map host JSON into canonical NormalizedStatusContext; omit unavailable fields
|
|
514
|
+
},
|
|
515
|
+
};
|
|
516
|
+
```
|
|
517
|
+
2. **Register it across the harness touchpoints**:
|
|
518
|
+
- `src/core/types.ts`: add ID to `HARNESS_IDS` / `PRIMARY_HARNESS_IDS`
|
|
519
|
+
- `src/adapters/registry.ts` & `src/core/detect.ts`: register adapter in `ADAPTER_REGISTRY` / `listAdapters` and `detectHarnessFromPayload`
|
|
520
|
+
- `src/adapters/fixtures.ts`: add a realistic sample payload to `MOCK_RAW_PAYLOADS` (used by `preview`, TUI live preview, and tests)
|
|
521
|
+
- `src/config/schema.ts`: add key to `HarnessOverridesMapSchema`
|
|
522
|
+
- `src/render/themes.ts` & `src/widgets/`: add `harnessBadges` / `IconSet` entries, `src/widgets/harness.ts` labels, and widget `compat` entries
|
|
523
|
+
- `src/commands/cli-utils.ts` (`HARNESS_ALIASES`), `src/commands/preview-cmd.ts` (`HARNESS_PREVIEW_LABELS`), `src/tui/state/scope-helpers.ts` (`HARNESS_META`)
|
|
524
|
+
3. **Add installer support** in `src/installers/manager.ts` using `updateJsonFile` or comment-preserving `updateTomlFile`.
|
|
525
|
+
4. **Verify locally** (build before tests so `tests/cli-e2e.test.ts` runs against a fresh `dist/cli.js`; `pnpm test` also runs `pretest` automatically):
|
|
526
|
+
```bash
|
|
527
|
+
pnpm install
|
|
528
|
+
pnpm typecheck
|
|
529
|
+
pnpm lint
|
|
530
|
+
pnpm format:check
|
|
531
|
+
pnpm build
|
|
532
|
+
pnpm test
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for general contribution guidelines.
|
|
536
|
+
|
|
537
|
+
---
|
|
538
|
+
|
|
539
|
+
<a id="changelog"></a>
|
|
540
|
+
## ◈ Changelog
|
|
541
|
+
|
|
542
|
+
### v0.1.0 — Initial Release
|
|
543
|
+
|
|
544
|
+
- **Multi-Harness Adapters & Codex MCP Server**: Native support for **Claude Code**, **Antigravity CLI (`agy`)**, **Grok CLI**, **Codex CLI (`>=0.173.0`)** via a built-in zero-dependency stdio JSON-RPC 2.0 MCP UI-Tree server (with live `settings.json` hot-reload and `--codex-mode legacy` fallback), plus a `generic` adapter with automatic payload detection.
|
|
545
|
+
- **47 Built-In Widgets & Local Enrichers**: Full coverage across Harness & Session (18), Model/Context/Tokens/Cache (12), Cost & Quota (7), Workspace & Git (6), and Layout & Custom (4) widgets, backed by cached local Git, transcript, Grok quota, 15-minute startup hydration, and opt-in `gh`/`glab` PR/MR enrichers with turn-0 zero-baseline stability.
|
|
546
|
+
- **Themes, Powerline & Sub-50ms Rendering**: 7 built-in themes (`catppuccin-mocha`, `tokyo-night`, `nord`, `dracula`, `gruvbox`, `default`, `minimal`), 5 Powerline separator styles (`arrow`, `round`, `slant`, `thin`, `none`), 5 icon styles, truecolor/256/16/no-color fallback, smart priority truncation, OSC 8 hyperlinks, and strict cold/hot path isolation.
|
|
547
|
+
- **Interactive Ink Studio (`xsl` / `xsl tui`)**: Sticky multi-harness live preview (`Tab` / `1`–`4`, 4-harness Compare Mode `v`, width simulation `w`), adaptive 3-row/1-row Aurora Prism 2D OKLab brand banner, dual-tone `KeyHintBar`, searchable `WidgetPicker`, live-synced `WidgetConfigModal`, `ItemsEditor` inline reordering & `c` widget duplication, ANSI 256 / `#RRGGBB` color pickers, and reusable **Harness Override Scopes**.
|
|
548
|
+
- **Safe Non-Destructive Installers & Diagnostics**: Atomic JSON and comment-preserving TOML updates with `--dry-run` unified diff previews, timestamped `.bak` backups, third-party hook protection, plus `xsl preview`, `xsl doctor`, and redacted `xsl capture` diagnostics.
|
|
549
|
+
- **Portable Export, Share Codes & `ccstatusline` Migration**: Export/import clean JSON, compact `xsl1:...` share codes, stdin pipes, or system clipboard via CLI (`xsl export` / `xsl import`) and TUI, with automatic `ccstatusline` (v1–v3) import and built-in `custom-command` security review gates.
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
<a id="acknowledgments"></a>
|
|
554
|
+
## ◈ Acknowledgments
|
|
555
|
+
|
|
556
|
+
- **[`ccstatusline`](https://github.com/sirmalloc/ccstatusline)** — Special thanks for pioneering and inspiring the clean, keyboard-driven terminal statusline configuration experience and Powerline ergonomics. Existing `ccstatusline` (v1–v3) users can migrate their configuration anytime via `xsl import --from ccstatusline`.
|
|
557
|
+
- **[Ink](https://github.com/vadimdemedes/ink) & [React](https://react.dev/)** — Powering the interactive terminal configuration TUI.
|
|
558
|
+
- **[Catppuccin](https://catppuccin.com/), [Tokyo Night](https://github.com/enkia/tokyo-night-vscode-theme), [Nord](https://www.nordtheme.com/), [Dracula](https://draculatheme.com/), & [Gruvbox](https://github.com/morhetz/gruvbox)** — Inspiring the palettes of the built-in themes.
|
|
559
|
+
- **[Nerd Fonts](https://www.nerdfonts.com/)** — Enabling crisp Powerline separators and developer icons across terminals.
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
563
|
+
## ◈ License
|
|
564
|
+
|
|
565
|
+
[MIT](./LICENSE)
|