Skip to content
Back to search

awesome-statusline

MarketplaceWorks with Claude CodeGitHub

Awesome Statusline — the effort & thinking statusline for Claude Code

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/awesomezun--claude-statusline/badge.svg)](/listings/awesomezun--claude-statusline)

HTML

<a href="/listings/awesomezun--claude-statusline"><img src="/api/listings/awesomezun--claude-statusline/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

Option 1. Ask your AI agent (easiest)

Tell Claude Code:

Install https://github.com/awesomezun/claude-statusline

It asks for a size, a style and where to show it, then installs. Name a preset up front (`… with large-plain`) and it installs straight away.

Option 2. One line in the terminal

**macOS / Linux**

curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash

**Windows (PowerShell)**

irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex

The installer asks for a size (1–5), a style (1–3), then where to show it (1 Statusline, 2 [Mods](#mods); macOS / Linux). Already know your preset? Append it:

curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash -s -- large-plain

Then **restart Claude Code**.

<details> <summary>Other ways to install: clone · when security software blocks it on Windows · plugin marketplace</summary> <br/>

**Clone and run**

git clone https://github.com/awesomezun/claude-statusline.git && cd claude-statusline
./install.sh large-plain      # macOS / Linux (leave out the preset to be asked)
./install.ps1 large-plain     # Windows PowerShell

**If security software blocks `irm | iex` on Windows**, download the installer, read it, then run it:

Invoke-WebRequest -Uri https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 -OutFile .\install.ps1
notepad .\install.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1

**Plugin marketplace**

/plugin marketplace add awesomezun/claude-statusline
/plugin install awesome-statusline

Then run `/statusline-setup`, or pass a preset directly: `/statusline-setup large-plain`.

</details>

---

<a id="presets"></a>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 24 lines
  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "awesome-statusline",
  4. "description": "Awesome Statusline — the effort & thinking statusline for Claude Code",
  5. "owner": {
  6. "name": "AwesomeJun",
  7. "email": "sjkang89@gmail.com"
  8. },
  9. "plugins": [
  10. {
  11. "name": "awesome-statusline",
  12. "version": "3.7.0",
  13. "description": "A Claude Code statusline that shows reasoning effort and thinking. 5 sizes (xsmall-xlarge) x 3 styles (emoji, plain, text), Pro/Max/Ultra usage limits, Catppuccin, no Node/Nerd Font, native PowerShell on Windows.",
  14. "author": {
  15. "name": "AwesomeJun",
  16. "email": "sjkang89@gmail.com"
  17. },
  18. "source": "./",
  19. "category": "tools",
  20. "keywords": ["statusline", "catppuccin", "effort", "thinking", "context-window", "api-usage"],
  21. "homepage": "https://github.com/awesomezun/claude-statusline"
  22. }
  23. ]
  24. }
README.md · README · 480 lines · 6 findings marked
  1. <div align="center">
  2. # ⚡ Awesome Statusline
  3. **Model · reasoning effort · context · prompt cache · usage limits, at a glance: a statusline for [Claude Code](https://claude.com/claude-code), now in the Claude desktop app too.**<br/>
  4. One line to install on macOS, Linux and Windows.
  5. <img src="https://img.shields.io/github/stars/awesomezun/claude-statusline?style=flat-square&color=cba6f7" alt="Stars"/>
  6. <img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-89b4fa?style=flat-square" alt="Platforms"/>
  7. <img src="https://img.shields.io/badge/presets-5%20sizes%20%C3%97%203%20styles-f5c2e7?style=flat-square" alt="5 sizes × 3 styles"/>
  8. <img src="https://img.shields.io/badge/plans-Pro%20%7C%20Max%20%7C%20Ultra-a6e3a1?style=flat-square" alt="Pro, Max, Ultra"/>
  9. <img src="https://img.shields.io/badge/license-MIT-fab387?style=flat-square" alt="MIT"/>
  10. <br/><br/>
  11. <img src="assets/reels/terminal.webp" alt="A Claude Code session at work with the large preset under the prompt: context climbing to 40%, the 5-hour limit to 34%, the weekly limit at 65%" width="820"/>
  12. <br/><br/>
  13. <a href="#install"><img src="https://img.shields.io/badge/Install-one%20line-cba6f7?style=for-the-badge" alt="Install: one line"/></a>&nbsp;<a href="#desktop"><img src="https://img.shields.io/badge/New-desktop%20%2B%20%2Fcockpit-fab387?style=for-the-badge" alt="New: the desktop app and /cockpit"/></a>&nbsp;<a href="#presets"><img src="https://img.shields.io/badge/Presets-15-89b4fa?style=for-the-badge" alt="15 presets: 5 sizes × 3 styles"/></a>&nbsp;<a href="https://awesomezun.github.io/claude-statusline/"><img src="https://img.shields.io/badge/Gallery-web-a6e3a1?style=for-the-badge" alt="Web gallery: every preset"/></a>
  14. [🇰🇷 한국어](README.ko.md) · [Desktop & cockpit](#desktop) · [v3.7](#v37) · [At a glance](#overview) · [Install](#install) · [Presets](#presets) · [Plan](#plans) · [Mods](#mods) · [What it shows](#fields) · [FAQ](#faq)
  15. </div>
  16. ---
  17. <a id="desktop"></a>
  18. ## ✨ New: in the Claude desktop app, with a cockpit
  19. <div align="center">
  20. <img src="assets/reels/desktop.webp" alt="The Claude desktop app: the large preset in the band above the prompt; then /cockpit opens a pane beside the chat with two dials, a status strip, fuel gauges and the sessions, and switches to the dashboard" width="820"/>
  21. </div>
  22. <table>
  23. <tr>
  24. <td width="33%" valign="top">
  25. **🖥️ The desktop app**<br/>
  26. Its Code tab doesn't run a `statusLine`. As a mod, all 15 presets draw in a band above the prompt there, and in the terminal.
  27. </td>
  28. <td width="33%" valign="top">
  29. **🛩️ `/cockpit`**<br/>
  30. A pane beside the chat, drawn like [1top](https://1top.si)'s menu bar: dials, fuel gauges, a radial token chart, every session and limit. Dark or light.
  31. </td>
  32. <td width="33%" valign="top">
  33. **⚡ One flag**<br/>
  34. Add `--mods` to the install line, or pick *Mods* when the installer asks. → [Mods](#mods) · [Cockpit](#cockpit)
  35. </td>
  36. </tr>
  37. </table>
  38. <div align="center">
  39. <img src="assets/reels/cockpit.webp" alt="The cockpit, dark beside light: the cluster with its dials moving, then the dashboard with the radial token chart, the model mix and the account cards" width="820"/>
  40. <sub>Beta: needs a Claude Code with mods (early access), on macOS or Linux.</sub>
  41. </div>
  42. <a id="v37"></a>
  43. ## 🆕 v3.7: Fable 5.2, the prompt cache, free limit resets, your account
  44. <div align="center">
  45. <img src="assets/presets/xlarge.png" alt="xlarge on Fable 5.2: the signed-in account and its plan beside the model, a Cache line at 92% hit, warm until 6:46pm with one miss after a tool change, and a free reset mark at the end of the 7D line" width="820"/>
  46. </div>
  47. <table>
  48. <tr>
  49. <td width="25%" valign="top">
  50. **🧠 Fable 5.2**<br/>
  51. Claude Code's new default Fable model, with its effort and its 1M context. Fable 5.1 and the Mythos models read the same way, in the band and the cockpit too.
  52. </td>
  53. <td width="25%" valign="top">
  54. **💾 Prompt cache**<br/>
  55. How much input came from the cache (`cache 92%`), until when it stays warm, and once it's cold what your next turn writes again. In every preset; xlarge gives it a line.
  56. </td>
  57. <td width="25%" valign="top">
  58. **🎫 Free limit resets**<br/>
  59. When claude.ai has given you a free limit reset you haven't used, the limits line ends with a 🎫 mark. Use it from Settings › Usage on the web or in the desktop app. → [FAQ](#faq)
  60. </td>
  61. <td width="25%" valign="top">
  62. **👤 Your account**<br/>
  63. The signed-in account's name and plan (`Alex · Max 5x`) beside the model, so you know which account the limits belong to. → [FAQ](#faq)
  64. </td>
  65. </tr>
  66. </table>
  67. ---
  68. <a id="overview"></a>
  69. ## 🧭 At a glance
  70. **15 presets: 5 sizes × 3 styles.** When you install, you pick a size (how much you see) and a style (how it looks). Your plan isn't a choice: Ultra included, it's applied automatically.
  71. <div align="center">
  72. <img src="assets/reels/presets.webp" alt="The presets one after another: xsmall, small, medium, large and xlarge, then large-plain, large-simple and xsmall-simple" width="820"/>
  73. </div>
  74. | Size ↓ · Style → | Emoji (default) | No emoji | Simple text |
  75. |---|---|---|---|
  76. | **[xsmall](#xsmall)** · 2 lines | `xsmall` | `xsmall-plain` | `xsmall-simple` (1 line) |
  77. | **[small](#small)** · 2 lines | `small` | `small-plain` | `small-simple` |
  78. | **[medium](#medium)** · 4 lines | `medium` | `medium-plain` | `medium-simple` |
  79. | **[large](#large)** · 5 lines ⭐ recommended | **`large`** | `large-plain` | `large-simple` |
  80. | **[xlarge](#xlarge)** · 6 lines | `xlarge` | `xlarge-plain` | `xlarge-simple` |
  81. - **Emoji** is the default: icons and gradient bars. A size on its own means this style (`large`).
  82. - **No emoji** (`-plain`) keeps the layout and the bars and drops only the emoji. It's the steadiest choice where emoji widths drift: tmux, SSH, Windows consoles.
  83. - **Simple text** (`-simple`) is text and numbers only, so the fields differ a little by size. Its colors compare usage with how much of the limit window has passed: green = under pace, yellow = on pace, red = ahead of time (or ≥ 90%).
  84. - Sizes can be abbreviated (`xs` · `s` · `m` · `l` · `xl`): `l-plain` = `large-plain`. The older names `simple` and `oneline` are `small-simple` and `xsmall-simple`.
  85. - New here? Start with **`large`**. You can switch any time.
  86. Want it in the Claude desktop app too? Install it as a [mod (beta)](#mods).
  87. > [!NOTE]
  88. > **Ultra is applied automatically.** Ultra has no 5-hour limit, so on Ultra every preset shows one weekly line with a per-day budget in place of the 5H and 7D lines. There's nothing to pick, and changing plans never needs a reinstall. → [Plan](#plans)
  89. ---
  90. <a id="install"></a>
  91. ## 🚀 Install
  92. ### Option 1. Ask your AI agent (easiest)
  93. Tell Claude Code:
  94. ```text
  95. Install https://github.com/awesomezun/claude-statusline
  96. ```
  97. It asks for a size, a style and where to show it, then installs. Name a preset up front (`… with large-plain`) and it installs straight away.
  98. ### Option 2. One line in the terminal
  99. **macOS / Linux**
  100. ```bash
  101. curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 153 on GitHub
  102. ```
  103. **Windows (PowerShell)**
  104. ```powershell
  105. irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
  106. ```
  107. The installer asks for a size (1–5), a style (1–3), then where to show it (1 Statusline, 2 [Mods](#mods); macOS / Linux). Already know your preset? Append it:
  108. ```bash
  109. curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash -s -- large-plain
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 164 on GitHub
  110. ```
  111. Then **restart Claude Code**.
  112. <details>
  113. <summary>Other ways to install: clone · when security software blocks it on Windows · plugin marketplace</summary>
  114. <br/>
  115. **Clone and run**
  116. ```bash
  117. git clone https://github.com/awesomezun/claude-statusline.git && cd claude-statusline
  118. ./install.sh large-plain # macOS / Linux (leave out the preset to be asked)
  119. ./install.ps1 large-plain # Windows PowerShell
  120. ```
  121. **If security software blocks `irm | iex` on Windows**, download the installer, read it, then run it:
  122. ```powershell
  123. Invoke-WebRequest -Uri https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 -OutFile .\install.ps1
  124. notepad .\install.ps1
  125. powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
  126. ```
  127. **Plugin marketplace**
  128. ```
  129. /plugin marketplace add awesomezun/claude-statusline
  130. /plugin install awesome-statusline
  131. ```
  132. Then run `/statusline-setup`, or pass a preset directly: `/statusline-setup large-plain`.
  133. </details>
  134. ---
  135. <a id="presets"></a>
  136. ## 🎨 The 15 presets
  137. Each size in its three styles: emoji, no emoji (`-plain`) and simple text (`-simple`). Shown on Pro / Max; for Ultra, see [Plan](#plans).
  138. <a id="xsmall"></a>
  139. ### xsmall (`xs`) · 2 lines
  140. Model · effort · folder · branch, and three small bars. The simple-text style fits on one line.
  141. <div align="center">
  142. <img src="assets/presets/xsmall.png" alt="xsmall: emoji style" width="820"/>
  143. <img src="assets/presets/xsmall-plain.png" alt="xsmall-plain: no emoji" width="820"/>
  144. <img src="assets/presets/xsmall-simple.png" alt="xsmall-simple: simple text" width="820"/>
  145. </div>
  146. <a id="small"></a>
  147. ### small (`s`) · 2 lines
  148. Adds the full path, git changes, output style and time to reset.
  149. <div align="center">
  150. <img src="assets/presets/small.png" alt="small: emoji style" width="820"/>
  151. <img src="assets/presets/small-plain.png" alt="small-plain: no emoji" width="820"/>
  152. <img src="assets/presets/small-simple.png" alt="small-simple: simple text" width="820"/>
  153. </div>
  154. <a id="medium"></a>
  155. ### medium (`m`) · 4 lines
  156. Adds a wide context bar with the token count, and commits ahead.
  157. <div align="center">
  158. <img src="assets/presets/medium.png" alt="medium: emoji style" width="820"/>
  159. <img src="assets/presets/medium-plain.png" alt="medium-plain: no emoji" width="820"/>
  160. <img src="assets/presets/medium-simple.png" alt="medium-simple: simple text" width="820"/>
  161. </div>
  162. <a id="large"></a>
  163. ### large (`l`) · 5 lines ⭐ recommended
  164. Adds the session time, and one line per limit with its reset time.
  165. <div align="center">
  166. <img src="assets/presets/large.png" alt="large: emoji style" width="820"/>
  167. <img src="assets/presets/large-plain.png" alt="large-plain: no emoji" width="820"/>
  168. <img src="assets/presets/large-simple.png" alt="large-simple: simple text" width="820"/>
  169. </div>
  170. <a id="xlarge"></a>
  171. ### xlarge (`xl`) · 6 lines
  172. Adds a prompt cache line with its misses, 40-block bars everywhere and full reset dates.
  173. <div align="center">
  174. <img src="assets/presets/xlarge.png" alt="xlarge: emoji style" width="820"/>
  175. <img src="assets/presets/xlarge-plain.png" alt="xlarge-plain: no emoji" width="820"/>
  176. <img src="assets/presets/xlarge-simple.png" alt="xlarge-simple: simple text" width="820"/>
  177. </div>
  178. ---
  179. <a id="plans"></a>
  180. ## 📊 Plan: automatic, Ultra included
  181. **Nothing to choose.** Each plan has different usage limits, Claude Code passes the statusline only the ones your plan has, and the statusline draws exactly those. All 15 presets work this way, and switching plans never needs a reinstall.
  182. | Plan | Limits Claude Code sends | What the statusline shows |
  183. |---|---|---|
  184. | **Pro · Max** | 5-hour + weekly | a `5H` bar and a `7D` bar, each with its reset time |
  185. | **Ultra** | weekly only (no 5-hour limit) | one `Weekly` bar, its reset time, and a **per-day budget** |
  186. The **per-day budget** (`≈22%/day`) is the weekly allowance you have left divided by the days until it resets: use about that much per day and you won't hit the limit before the reset. With less than a day to go it shows what's left instead, e.g. `9% left`.
  187. <div align="center">
  188. <img src="assets/presets/plans.png" alt="The same large preset: 5H + 7D on Pro / Max, one Weekly line with a per-day budget on Ultra" width="820"/>
  189. </div>
  190. ---
  191. <a id="mods"></a>
  192. ## 🧩 Mods (beta): also in the Claude desktop app
  193. The statusline is a `statusLine` command, and the Claude desktop app's Code tab doesn't run one. **Mods** draws the same lines in the band above the prompt instead, through a Claude Code mod (early access), and that band shows in the desktop app too.
  194. <div align="center">
  195. <img src="assets/presets/desktop.png" alt="The large preset drawn by the mod above the prompt in the Claude desktop app" width="820"/>
  196. </div>
  197. | | Statusline (default) | Mods (beta) |
  198. |---|---|---|
  199. | Where | under the prompt, in the terminal | in a band above the prompt: the terminal and the Claude desktop app |
  200. | Presets | all 15 | all 15 (the mod runs the same renderer) |
  201. | Runs on | macOS · Linux · Windows | macOS · Linux |
  202. | Needs | Claude Code | a Claude Code with mods (early access; tested on 2.1.316 and on 2.1.309, the one the desktop app ships) and its `claude` CLI |
  203. **Install**: pick "Mods" when the installer asks where it should show, tell your AI agent (`Install https://github.com/awesomezun/claude-statusline as a mod`), or add `--mods`:
  204. ```bash
  205. curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash -s -- large --mods
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 305 on GitHub
  206. ```
  207. Then start a new session, in the terminal or in the desktop app's Code tab.
  208. - The installer copies the mod to `~/.claude/awesome-statusline-mod/` and installs it with `claude plugin install` as `awesome-statusline-mod@awesome-statusline-local`. The preset is the mod's `preset` option.
  209. - It removes an Awesome Statusline `statusLine`, so the terminal doesn't show the lines twice. Any other statusLine is left alone; while one is set, the terminal keeps it and the band shows only in the desktop app. Change this with the `terminal` option (`auto` · `show` · `hide`) in `/plugin configure awesome-statusline-mod@awesome-statusline-local`.
  210. - Until your first message in a session, effort comes from your settings and the usage rows may read `loading..`; from the first reply on they show the session's real values.
  211. - The VS Code extension has no band above the prompt, so the mod doesn't show there.
  212. - **Back to the statusline**: reinstall without `--mods`. **Remove the mod**: `claude plugin uninstall awesome-statusline-mod@awesome-statusline-local`, then delete `~/.claude/awesome-statusline-mod/`.
  213. <a id="cockpit"></a>
  214. ### Cockpit pane (prototype)
  215. With the mod installed, **`/cockpit`** opens a pane beside the chat drawn like [1top](https://1top.si)'s menu bar, in a dark and a light theme:
  216. - **Cluster**: two dials (tokens per hour, and weekly limit used per hour), a status strip (working, waiting, done, sign-in, low limit), an odometer with a trip counter, and what is left of each limit as fuel gauges.
  217. - **Dashboard**: a radial token chart around the hour, the model mix, and account cards with use per hour and a day's trend.
  218. - **Below either**: sessions (ranked by weekly limit used), token flow, limits, usage map, heatmap, resources, and this session (context, where each limit ends up at the pace so far, the tools running now). There's also a *Compact now* button.
  219. - **Period** from 10 minutes to 24 hours. The view, theme, period and language are buttons at the top and stay as you left them.
  220. With the 1top app running on the same computer, the cockpit reads 1top's local read-only API and shows every AI it tracks: Claude Code, Codex and the rest. Without it, it shows this computer's resources and the Claude Code sessions running the mod. While the cockpit is open, the band above the prompt steps aside. To open it at the start of every session, set the mod's `cockpit` option to `auto`. The desktop app draws it as graphics, the terminal as text.
  221. <div align="center">
  222. <table>
  223. <tr><th>Cluster · dark</th><th>Dashboard · dark</th></tr>
  224. <tr><td><img src="assets/presets/cockpit-cluster-dark.png" alt="The cluster, dark: two dials, the status strip, the odometer and fuel gauges, with the sessions below" width="380"/></td><td><img src="assets/presets/cockpit-dashboard-dark.png" alt="The dashboard, dark: a radial token chart, the model mix and account cards, with the account limits below" width="380"/></td></tr>
  225. <tr><th>Cluster · light</th><th>Dashboard · light</th></tr>
  226. <tr><td><img src="assets/presets/cockpit-cluster-light.png" alt="The cluster, light: two dials, the status strip, the odometer and fuel gauges, with the token flow below" width="380"/></td><td><img src="assets/presets/cockpit-dashboard-light.png" alt="The dashboard, light: a radial token chart, the model mix and account cards, with the heatmap below" width="380"/></td></tr>
  227. </table>
  228. </div>
  229. ---
  230. <a id="fields"></a>
  231. ## 🔍 What it shows
  232. | Element | Meaning |
  233. |---------|---------|
  234. | 🤖 **Model** | Current model (`Fable 5.2`, `Opus 5.5`, …) |
  235. | 👤 **Account** | The signed-in claude.ai account's name and plan (`Alex · Max 5x`); small screens show the name only |
  236. | ⚡ **Effort** | Reasoning effort: `low` · `medium` · `high` · `xhigh` · `max`. Live with `/effort`; hidden on models without effort |
  237. | 💡 **Thinking** | Extended thinking is on |
  238. | 🎨 **Output style** | Active output style (hidden while it's `default`) |
  239. | 📂 🌿 **Folder · Git** | Folder, branch, commits ahead ↑ / behind ↓, staged `+` · modified `!` · untracked `?` files |
  240. | 🐍 **Env** | Active conda / virtualenv (only when one is active) |
  241. | 🧠 **Context** | Context-window usage bar and token count |
  242. | 💾 **Cache** | Share of input read from the prompt cache (green from 80%, yellow from 50%), until when it stays warm, and once it's cold what the next turn writes again. Shows after the first reply (Claude Code 2.1.251+) |
  243. | ⏰ **Time** | Session duration |
  244. | 🚀 **5H** · ⭐ **7D** | 5-hour and weekly limit usage with reset times (Pro · Max) |
  245. | ⭐ **Weekly** | Weekly limit usage, reset time and per-day budget (Ultra) |
  246. | 🎫 **Free reset** | You hold a free limit reset from claude.ai that you haven't used (see the [FAQ](#faq)) |
  247. The no-emoji and simple-text styles use text labels such as `Context`, `Usage 5H` and `time` in place of the icons. Colors follow the [Catppuccin](https://catppuccin.com/) palette, and every glyph is a standard emoji or Unicode block — no Nerd Font needed.
  248. ---
  249. <a id="change"></a>
  250. ## 🔧 Change preset or uninstall
  251. **Change**: give your AI agent this repo's URL and the preset you want, and it reinstalls (e.g. `Switch https://github.com/awesomezun/claude-statusline to medium-simple`). From a terminal, re-run the installer with the new preset:
  252. ```bash
  253. curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash -s -- medium-simple
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 371 on GitHub
  254. ```
  255. **Uninstall**: remove the `statusLine` entry from `~/.claude/settings.json` and delete `~/.claude/awesome-statusline.sh` (`awesome-statusline.ps1` on Windows). Every install also leaves a `settings.json.backup-<timestamp>` you can restore. Installed as a mod? See [Mods (beta)](#mods).
  256. ---
  257. <a id="requirements"></a>
  258. ## ✅ Requirements
  259. | | macOS · Linux | Windows |
  260. |---|---|---|
  261. | Runs on | Bash 3.2+ (built in) | PowerShell 5.1+ (built in) |
  262. | JSON parsing | `jq` (the installer adds it via brew / apt / dnf / pacman / zypper / apk if missing) | not needed |
  263. | Not needed | Node, Nerd Font | Node, Nerd Font, Git Bash, `jq` |
  264. On Windows the installer writes a native `awesome-statusline.ps1` and points Claude Code at `powershell -NoProfile …`, which avoids Git Bash, `.sh` file associations and `jq` PATH problems.
  265. ---
  266. <a id="faq"></a>
  267. ## 🙋 FAQ
  268. **Do I need to reinstall when I change plans?** No. The statusline follows the limits Claude Code reports, so it shows 5H + 7D on Pro · Max and Weekly on Ultra by itself.
  269. **The limit lines say `loading..`.** Usage data arrives after your first message in a session, so `loading..` shows until then. It only arrives when you're signed in with a claude.ai subscription (Pro · Max · Ultra); with an API key it stays at `loading..`. On Ultra, if it's still `loading..` after your first message, you have an old version — ask your AI agent to reinstall.
  270. **I'm on Ultra and see only one Weekly bar.** That's expected: Ultra has no 5-hour limit.
  271. **I don't see `⚡effort`.** Your current model doesn't support effort, so the field is hidden on purpose. Switch to a model that supports `/effort` (e.g. Opus 5.5).
  272. **What does `cache 92%` mean, and why does it say `cold`?** Claude Code caches the start of your conversation, so the next turn reads it back instead of processing it again: reads are cheaper and count less toward your limits. `92%` is the share of this session's input that came from the cache. The cache stays warm for a while after each turn (5 minutes or an hour); past that it's `cold`, and the next turn writes the whole conversation again, the size shown after `re-caches`. A `miss` is a turn that processed again what the cache already held; xlarge names the likely cause (a tool or the system prompt changed, idle past the TTL).
  273. **Does it show how many free limit resets I have?** It shows whether you have one, not how many. claude.ai hands out free limit resets now and then; you use them from Settings › Usage on the web or in the desktop app, not from Claude Code. The statusline JSON doesn't carry them; Claude Code notes in its `~/.claude.json` only whether your account holds an unused one, and the 🎫 mark reads that. The count is only behind your login, and the statusline never touches your credentials. Nothing is sent anywhere.
  274. **Can I hide my account name?** Yes. Add `"env": {"AWESOME_STATUSLINE_ACCOUNT": "off"}` to `~/.claude/settings.json`. The name and plan come from the login Claude Code keeps in `~/.claude.json` (your email is never shown). Sessions on an API key or a cloud provider don't show an account.
  275. **Can I turn the emoji off?** Yes. Add `-plain` to any size for the same layout without emoji (`large-plain`), or `-simple` for text with no bars (`large-simple`).
  276. **Does it work in the Claude desktop app?** With [Mods (beta)](#mods), yes. The desktop app's Code tab doesn't run `statusLine` commands, but it draws the mod's band above the prompt.
  277. **Does it slow Claude Code down?** No. It's a small local script that takes about 0.1 s per refresh.
  278. **Why emoji instead of Nerd Font icons?** So it looks right out of the box in any terminal, with no font setup. See how it looks in your font in the [12-font showcase](demo.md).
  279. **Where are my old settings?** Every install backs up `settings.json` to `settings.json.backup-<timestamp>` before changing it.
  280. **Bars look banded or yellow turns olive inside tmux.** Claude Code drops to 256 colours inside tmux. The statusline notices and draws 256-colour gradients instead; for the full gradient, set `"env": {"CLAUDE_CODE_TMUX_TRUECOLOR": "1"}` in `~/.claude/settings.json` (the installer does it when tmux supports 24-bit colour). Details: [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
  281. **Characters stack vertically inside tmux.** Enable truecolor in `~/.tmux.conf` (`set -ga terminal-overrides ",xterm-256color:RGB"`) and reload tmux. Details: [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
  282. **The statusline is blank, or blank terminal windows keep popping up (Windows).** Re-run `install.ps1`. It switches to the native PowerShell renderer and drops the Git Bash / `jq` dependency. Details: [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
  283. ---
  284. <a id="changelog"></a>
  285. ## 🆕 Changelog
  286. Built to keep pace with Claude Code. Full notes for each release are on [Releases](https://github.com/awesomezun/claude-statusline/releases).
  287. | Date | Update |
  288. |------|--------|
  289. | **2026‑11‑09** | **v3.7.0** · **Fable 5.2** support (and the Mythos models, in the band and the cockpit) · **prompt cache** in every preset: hit ratio, warm until, and what a cold cache writes again; xlarge gets a cache line with misses and their likely cause · **free limit reset** mark when you hold an unused one · the signed-in **account** and its plan (`Alex · Max 5x`; `AWESOME_STATUSLINE_ACCOUNT=off` hides it) · the mod works the cache figures out from each request, so the desktop app shows them too · README with motion reels and a desktop & cockpit section up front |
  290. | **2026‑11‑02** | **v3.6.0** · **Mods (beta)** · install as a Claude Code mod with `--mods`: the same 15 presets in the band above the prompt, so it also shows in the Claude desktop app (macOS / Linux) · the installer asks where it should show · `/cockpit` pane (prototype): 1top-style cluster and dashboard, dark and light, with accounts, token flow, usage map and running sessions · README shows the 15 presets size by size |
  291. | **2026‑11‑01** | **v3.5.1** · three styles for every size (simple text `m-simple`, `l-simple`, `xl-simple` added) · installs ask size, then style · **clean gradients inside tmux** (when Claude Code drops to 256 colours the bars use 256-colour gradients, and the installer turns on `CLAUDE_CODE_TMUX_TRUECOLOR` when tmux supports 24-bit colour) · fixed the first bar cell darkening on light themes with minimum contrast (VS Code, Orca) · README reorganized around "two choices (size, style) + one automatic (plan)" |
  292. | **2026‑10‑31** | **Ultra plan support + redesign** · Ultra has no 5-hour limit, so it gets a weekly bar with a per-day budget (the bars used to freeze at `0% (loading..)`) · every size redesigned (aligned columns, fixed-width %, resets shown as *in 2h10m · 01:50*, empty fields hidden) · no-emoji style (`-plain`) · text presets `simple` and `oneline` · one renderer for every preset, ~4× faster per refresh |
  293. | **2026‑10‑17** | **Windows on non-English locales** · no more `Unknown` / 0% when Claude Code sends non-ASCII text (e.g. a Korean session name) · context gauge guards against stale window-size reports |
  294. | **2026‑06‑03** | **Install size picker** · installing through Claude Code always asks for a size (`large` recommended) |
  295. | **2026‑06‑02** | **Windows native renderer** · PowerShell statusline, no Git Bash or `jq` needed on Windows |
  296. | **2026‑05‑31** | **Opus 4.8** support · reasoning **effort** (`high`/`xhigh`/`max`) and **thinking** indicators · one-line cross-platform installer · 5 sizes (`xs`–`xl`) · JetBrains Mono |
  297. | **2026‑04‑01** | **1M-token context window** support (Opus) · usage bars render before the first chat |
  298. | **2026‑01‑19** | Multi-mode display system · plugin marketplace |
  299. | **2026‑01‑18** | Catppuccin gradient bars · live **5h / 7d** usage-limit monitoring |
  300. ---
  301. <div align="center">
  302. Built with 🩵 for the Claude Code community · [Catppuccin](https://catppuccin.com/) theme · MIT License
  303. <sub>Awesome Statusline is an independent community project, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic, PBC.</sub>
  304. ⭐ **Star it if it made your terminal nicer.**
  305. <a href="https://www.star-history.com/?repos=AwesomeJun%2FCC-statusline&type=date&legend=top-left">
  306. <picture>
  307. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=AwesomeJun/CC-statusline&type=date&theme=dark&legend=top-left&sealed_token=ntTNhwQ951y6lOVznUbvdeYGCi23yOBbRnadWt5pMTIRfdp6L3KPB1Dwy65vNWI7CIY4R1MzU6yloqyfkwmlEbMoguscV-kFRG5PCqCVyP4_G4XgShBDtg" />
  308. <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=AwesomeJun/CC-statusline&type=date&legend=top-left&sealed_token=ntTNhwQ951y6lOVznUbvdeYGCi23yOBbRnadWt5pMTIRfdp6L3KPB1Dwy65vNWI7CIY4R1MzU6yloqyfkwmlEbMoguscV-kFRG5PCqCVyP4_G4XgShBDtg" />
  309. <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=AwesomeJun/CC-statusline&type=date&legend=top-left&sealed_token=ntTNhwQ951y6lOVznUbvdeYGCi23yOBbRnadWt5pMTIRfdp6L3KPB1Dwy65vNWI7CIY4R1MzU6yloqyfkwmlEbMoguscV-kFRG5PCqCVyP4_G4XgShBDtg" />
  310. </picture>
  311. </a>
  312. </div>
  313. <br/>
  314. <!-- gitreels:start -->
  315. <p align="center">
  316. <img src="assets/reel.gif" alt="Awesome Statusline — 30-second motion reel" width="820">
  317. <br>
  318. <a href="https://gitreels.com"><img src="https://gitreels.com/badge.svg" alt="Made with GitReels" height="24"></a>
  319. <a href="https://gitreels.com/awesomezun/claude-statusline"><img src="https://gitreels.com/api/badges/rotw/awesomezun/claude-statusline.svg" alt="Reel of the Week #2 on GitReels" height="24"></a>
  320. </p>
  321. <!-- gitreels:end -->
docs/build.py · Bundled script · 248 lines · 2 findings marked
  1. #!/usr/bin/env python3
  2. """Generate docs/index.html from the REAL statusline output.
  3. Runs the renderer (scripts/awesome-statusline.sh) for every preset against a
  4. representative mock session (see docs/_demo.py), captures the truecolor ANSI
  5. it prints, and converts that to HTML — so gradients and exact colors match the
  6. terminal pixel-for-pixel instead of being hand-approximated.
  7. Each element with an id is captured to assets/presets/<id>.png
  8. (by docs/shoot.py):
  9. #hero large, the recommended preset
  10. #<preset> one card per preset, 15 in all: each of the five sizes in
  11. emoji, -plain and -simple (Pro / Max), e.g. #large-plain
  12. #plans automatic - the same preset on Pro / Max and on Ultra
  13. """
  14. import sys
  15. sys.dont_write_bytecode = True # keep docs/ free of __pycache__ from the import below
  16. import html as H
  17. import pathlib
  18. import re
  19. sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
  20. from _demo import ROOT, ansi_to_html, render # noqa: E402
  21. SIZES = [ # (preset, abbr, lines)
  22. ("xsmall", "xs", "2 lines"),
  23. ("small", "s", "2 lines"),
  24. ("medium", "m", "4 lines"),
  25. ("large", "l", "5 lines"),
  26. ("xlarge", "xl", "6 lines"),
  27. ]
  28. ABBR = {name: abbr for name, abbr, _ in SIZES}
  29. def rows(preset: str, plan: str = "pro") -> str:
  30. raw = render(preset, plan).rstrip("\n")
  31. return "".join(f'<div class="row">{ansi_to_html(ln)}</div>' for ln in raw.split("\n"))
  32. def card(title, sub, badge, body_html, tag="") -> str:
  33. tag_html = f'<span class="tag">{H.escape(tag)}</span>' if tag else ""
  34. return f'''
  35. <div class="card">
  36. <div class="card-head"><div class="name">{title} <span class="abbr">({sub})</span>{tag_html}</div><div class="lines">{badge}</div></div>
  37. <div class="term">
  38. <div class="term-bar"><span class="dot r"></span><span class="dot y"></span><span class="dot g"></span></div>
  39. <div class="term-body">{body_html}</div>
  40. </div>
  41. </div>'''
  42. def cards(items) -> str:
  43. return "\n".join(card(*it) for it in items)
  44. HERO = cards([("large", "l", "recommended", rows("large"))])
  45. STYLES = [ # (suffix, label)
  46. ("", "emoji"),
  47. ("-plain", "no emoji"),
  48. ("-simple", "simple text"),
  49. ]
  50. SIZE_NOTE = {
  51. "xsmall": "model · effort · folder · branch, three small bars",
  52. "small": "+ full path, git changes, output style, time to reset",
  53. "medium": "+ wide context bar with token count, commits ahead",
  54. "large": "+ session time, one line per limit with its reset time",
  55. "xlarge": "+ a prompt cache line, 40-block bars everywhere, full reset dates",
  56. }
  57. def line_count(preset: str) -> str:
  58. n = len(render(preset).rstrip("\n").split("\n"))
  59. return f"{n} line" + ("" if n == 1 else "s")
  60. def preset_card(name: str, abbr: str, suffix: str, label: str) -> str:
  61. preset = name + suffix
  62. badge = f"{label} · {line_count(preset)}" + (" · recommended" if preset == "large" else "")
  63. return f'<div class="pc" id="{preset}">{card(preset, abbr + suffix, badge, rows(preset))}</div>'
  64. SIZE_SECTIONS = "\n".join(f'''
  65. <div class="size-sec" id="size-{name}">
  66. <div class="section-title">{name} <span class="abbr">({abbr})</span></div>
  67. <p class="note">{SIZE_NOTE[name]}</p>
  68. <div class="grid">{"".join(preset_card(name, abbr, suffix, label) for suffix, label in STYLES)}
  69. </div>
  70. </div>''' for name, abbr, _ in SIZES)
  71. PLAN_CARDS = cards([
  72. ("large", "on Pro / Max", "5-hour + weekly limits", rows("large", "pro")),
  73. ("large", "on Ultra", "weekly limit only", rows("large", "ultra")),
  74. ])
  75. HTML = f'''<!DOCTYPE html>
  76. <html lang="en">
  77. <head>
  78. <meta charset="UTF-8" />
  79. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  80. <title>Awesome Statusline — for Claude Code</title>
  81. <link rel="preconnect" href="https://fonts.googleapis.com">
  82. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  83. <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
  84. <style>__CSS__</style>
  85. </head>
  86. <body>
  87. <div class="wrap">
  88. <div class="hero">
  89. <h1><span class="spark">⚡</span> Awesome Statusline</h1>
  90. <p class="tag">A beautiful statusline for Claude Code — <b>context</b>, <b>usage limits</b> &amp; reasoning <b style="color:var(--peach)">⚡effort</b>, all at a glance. One line to install on macOS, Linux &amp; Windows.</p>
  91. <div class="badges">
  92. <span class="badge hot">⚡ effort · 💡 thinking</span>
  93. <span class="badge cool">macOS · Linux · Windows</span>
  94. <span class="badge">5 sizes × 3 styles</span>
  95. <span class="badge">Pro · Max · Ultra, automatic</span>
  96. <span class="badge">Catppuccin</span>
  97. </div>
  98. </div>
  99. <div id="hero">
  100. <div class="grid">{HERO}
  101. </div>
  102. </div>
  103. <div class="section-title">Two choices · one automatic</div>
  104. <div class="axes">
  105. <div class="axis"><div class="k">1 · Size</div><div class="v">xs · s · m · l · xl</div><p>How much you see. You pick it.</p></div>
  106. <div class="axis"><div class="k">2 · Style</div><div class="v">emoji · -plain · -simple</div><p>How it looks. You pick it.</p></div>
  107. <div class="axis auto"><div class="k">3 · Plan</div><div class="v">Pro / Max · Ultra</div><p>Which limits show. Automatic.</p></div>
  108. </div>
  109. <p class="note">Size + style = a preset: 5 &times; 3 = 15, e.g. <code>large</code>, <code>l-plain</code>, <code>m-simple</code>.</p>
  110. <div class="section-title">15 presets · 5 sizes × 3 styles</div>
  111. <p class="note">Every size in the three styles, on Pro / Max.</p>
  112. {SIZE_SECTIONS}
  113. <div id="plans">
  114. <div class="section-title">Automatic · Plan — nothing to choose</div>
  115. <div class="grid">{PLAN_CARDS}
  116. </div>
  117. <p class="note">Every preset follows the limits Claude Code reports: Ultra has no 5-hour limit, so it gets one weekly line with a per-day budget.</p>
  118. </div>
  119. <div class="section-title">Why this one</div>
  120. <div class="why">
  121. <div class="item"><h3>⚡ <span>Effort &amp; thinking</span></h3><p>Surfaces <b style="color:var(--peach)">/effort</b> (high · xhigh · max) and <b style="color:var(--yellow)">extended thinking</b> — live, from Claude Code's official JSON.</p></div>
  122. <div class="item"><h3>📊 <span>Every plan, every window</span></h3><p>Pro and Max get 5-hour + weekly bars; Ultra (weekly only) gets a weekly bar with a per-day budget. Each limit is read on its own.</p></div>
  123. <div class="item"><h3>🖥️ <span>Truly cross-platform</span></h3><p>Bash on macOS and Linux, a native PowerShell renderer on Windows — no Git Bash or <code>jq</code> needed there.</p></div>
  124. <div class="item"><h3>📐 <span>5 sizes × 3 styles</span></h3><p>Pick how much you see with one word — <code>xs</code> to <code>xl</code> — then add <code>-plain</code> (no emoji) or <code>-simple</code> (text only) if you like. The plan is detected for you.</p></div>
  125. </div>
  126. <div class="section-title">Install</div>
  127. <div class="install"><span class="c"># macOS / Linux</span>
  128. curl -fsSL https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 153 on GitHub
  129. <span class="c"># Windows (PowerShell)</span>
  130. irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
  131. </div>
  132. <footer>Built with 🩵 for the Claude Code community · <b>Catppuccin</b> theme · MIT License</footer>
  133. </div>
  134. </body>
  135. </html>
  136. '''.replace("__CSS__", """
  137. :root{
  138. --base:#1e1e2e; --mantle:#181825; --crust:#11111b; --s0:#313244; --s1:#45475a;
  139. --text:#cdd6f4; --sub:#a6adc8; --over:#6c7086; --teal:#94e2d5; --peach:#fab387;
  140. --yellow:#f9e2af; --mauve:#cba6f7;
  141. }
  142. *{box-sizing:border-box;margin:0;padding:0}
  143. body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  144. background:radial-gradient(1200px 600px at 50% -10%, #25253a 0%, var(--mantle) 55%, var(--crust) 100%);
  145. color:var(--text);line-height:1.6;padding:64px 24px;min-height:100vh}
  146. .wrap{max-width:1000px;margin:0 auto}
  147. .hero{text-align:center;margin-bottom:52px}
  148. .hero h1{font-size:54px;font-weight:800;letter-spacing:-1.5px;margin-bottom:14px}
  149. .hero h1 .spark{color:var(--peach)}
  150. .hero p.tag{font-size:19px;color:var(--sub);max-width:680px;margin:0 auto 22px}
  151. .hero p.tag b{color:var(--text)}
  152. .badges{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:18px}
  153. .badge{font-size:12.5px;padding:5px 11px;border-radius:999px;background:var(--s0);color:var(--sub);border:1px solid var(--s1)}
  154. .badge.hot{background:rgba(250,179,135,.14);color:var(--peach);border-color:rgba(250,179,135,.3)}
  155. .badge.cool{background:rgba(148,226,213,.12);color:var(--teal);border-color:rgba(148,226,213,.28)}
  156. .section-title{font-size:14px;text-transform:uppercase;letter-spacing:2px;color:var(--over);text-align:center;margin:48px 0 22px}
  157. .grid{display:flex;flex-direction:column;gap:22px}
  158. .card{background:var(--mantle);border:1px solid var(--s0);border-radius:16px;overflow:hidden;box-shadow:0 18px 50px -20px rgba(0,0,0,.7)}
  159. .card-head{display:flex;align-items:center;justify-content:space-between;padding:12px 18px;border-bottom:1px solid var(--s0)}
  160. .card-head .name{font-weight:700;font-size:15px}
  161. .card-head .name .abbr{color:var(--over);font-weight:500}
  162. .card-head .lines{font-size:12px;color:var(--over);background:var(--s0);padding:3px 9px;border-radius:999px}
  163. .term{background:var(--base)}
  164. .term-bar{display:flex;gap:7px;padding:11px 14px;border-bottom:1px solid rgba(255,255,255,.04)}
  165. .dot{width:11px;height:11px;border-radius:50%}
  166. .dot.r{background:#f38ba8}.dot.y{background:#f9e2af}.dot.g{background:#a6e3a1}
  167. .term-body{font-family:"JetBrains Mono",Menlo,Consolas,monospace,"Apple Color Emoji","Noto Color Emoji";
  168. font-size:13.5px;line-height:1.42;padding:12px 18px;white-space:pre;overflow-x:auto}
  169. .term-body .row{display:block}
  170. .cg{display:inline-block;width:1ch;height:1.02em;vertical-align:-.12em;
  171. background-color:currentColor;background-repeat:repeat;background-position:0 0;
  172. image-rendering:pixelated}
  173. .cg-full{background-color:currentColor}
  174. .cg-shade-light{background-color:currentColor;
  175. -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='black'/%3E%3C/svg%3E");
  176. mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='black'/%3E%3C/svg%3E");
  177. -webkit-mask-size:2px 2px;mask-size:2px 2px;
  178. -webkit-mask-repeat:repeat;mask-repeat:repeat}
  179. .cg-shade-medium{background-color:currentColor;
  180. -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='black'/%3E%3Crect x='1' y='1' width='1' height='1' fill='black'/%3E%3C/svg%3E");
  181. mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='black'/%3E%3Crect x='1' y='1' width='1' height='1' fill='black'/%3E%3C/svg%3E");
  182. -webkit-mask-size:2px 2px;mask-size:2px 2px;
  183. -webkit-mask-repeat:repeat;mask-repeat:repeat}
  184. .cg-shade-dark{background-color:currentColor;
  185. -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='2' height='1' fill='black'/%3E%3Crect y='1' width='1' height='1' fill='black'/%3E%3C/svg%3E");
  186. mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' viewBox='0 0 2 2'%3E%3Crect width='2' height='1' fill='black'/%3E%3Crect y='1' width='1' height='1' fill='black'/%3E%3C/svg%3E");
  187. -webkit-mask-size:2px 2px;mask-size:2px 2px;
  188. -webkit-mask-repeat:repeat;mask-repeat:repeat}
  189. .why{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-top:8px}
  190. @media(max-width:680px){.why{grid-template-columns:1fr}.hero h1{font-size:40px}}
  191. .why .item{background:var(--mantle);border:1px solid var(--s0);border-radius:14px;padding:18px 20px}
  192. .why .item h3{font-size:15px;margin-bottom:6px;display:flex;align-items:center;gap:8px}
  193. .why .item p{font-size:13.5px;color:var(--sub)}
  194. .install{background:var(--crust);border:1px solid var(--s0);border-radius:14px;padding:18px 20px;margin-top:10px;font-family:"JetBrains Mono",monospace;font-size:13px;color:#a6e3a1;overflow-x:auto}
  195. .install .c{color:var(--over)}
  196. footer{text-align:center;color:var(--over);font-size:13px;margin-top:60px}
  197. footer b{color:var(--mauve)}
  198. #hero,#plans,.size-sec{padding:28px 0 18px}
  199. #plans .section-title,.size-sec .section-title{margin-top:0}
  200. .size-sec .section-title{font-family:"JetBrains Mono",monospace;margin-bottom:4px}
  201. .size-sec .section-title .abbr{color:var(--over)}
  202. .size-sec .note{margin:0 0 14px}
  203. .size-sec .grid{gap:0}
  204. .pc{padding:10px 0 28px}
  205. .axes{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
  206. @media(max-width:680px){.axes{grid-template-columns:1fr}}
  207. .axis{background:var(--mantle);border:1px solid var(--s0);border-radius:14px;padding:16px 18px}
  208. .axis .k{font-size:12px;text-transform:uppercase;letter-spacing:1.5px;color:var(--over)}
  209. .axis .v{font-family:"JetBrains Mono",monospace;font-size:15px;color:var(--text);margin:6px 0 4px}
  210. .axis p{font-size:13.5px;color:var(--sub)}
  211. .axis.auto{border-style:dashed}
  212. .axis.auto .v{color:var(--teal)}
  213. .card-head .tag{font-size:12px;color:var(--peach);margin-left:8px;font-weight:500}
  214. .note{text-align:center;color:var(--sub);font-size:13.5px;margin-top:14px}
  215. .note code{font-family:"JetBrains Mono",monospace;color:var(--peach)}
  216. """)
  217. (ROOT / "docs" / "index.html").write_text(HTML, encoding="utf-8")
  218. print("wrote docs/index.html")
  219. print("--- large (text) ---")
  220. print(re.sub(r"\x1b\[[0-9;]*m", "", render("large")))
install.ps1 · Bundled script · 273 lines · 3 findings marked
  1. #Requires -Version 5
  2. <#
  3. .SYNOPSIS
  4. Awesome CC Statusline installer for Windows (PowerShell).
  5. .DESCRIPTION
  6. 1. Copies the native Windows PowerShell renderer to ~/.claude/awesome-statusline.ps1.
  7. 2. Patches settings.json -> statusLine (existing settings preserved + backup).
  8. 3. Uses Claude Code's official statusLine.command contract: JSON on stdin,
  9. rendered status text on stdout.
  10. Sizes: xsmall (xs) | small (s) | medium (m) | large (l) | xlarge (xl).
  11. Styles: emoji (default) | -plain (no emoji) | -simple (text only, no bars).
  12. Aliases: simple = small-simple, oneline = xsmall-simple.
  13. .EXAMPLE
  14. ./install.ps1 # install (asks size and style)
  15. ./install.ps1 l # by abbreviation
  16. ./install.ps1 large-plain # by full name, without emoji
  17. ./install.ps1 m-simple # text-only style
  18. #>
  19. # ============================================================================
  20. # HOW TO INSTALL — rules for the AI assistant running this.
  21. # A user may ask the assistant to install from the GitHub URL without cloning
  22. # the repo, so CLAUDE.md / the plugin command are NOT in context. These rules
  23. # are duplicated here (the one file the assistant always reads) and MUST stay
  24. # identical to CLAUDE.md and commands/statusline-setup.md in this repo.
  25. #
  26. # 1. You MUST resolve a preset before installing. Never install without an
  27. # explicit choice by the user. "Auto" / auto-accept mode is NOT an
  28. # exception — the user is present and can answer; ask anyway.
  29. # Recommending `large` (below) is only a hint shown inside the menu; it must
  30. # NEVER become a silent default or let you skip the question. Always ask.
  31. #
  32. # 2. If the user already named a preset — a size (xs/s/m/l/xl or full name),
  33. # optionally with -plain or -simple, or the aliases simple (= small-simple)
  34. # / oneline (= xsmall-simple) — use it and skip Questions A and B. A bare
  35. # size means the emoji style unless the user asked for no emoji or text
  36. # only. If they also said where it should show (statusline; or mods / the
  37. # desktop app), skip Question C too; on Windows always skip it (Statusline).
  38. # Otherwise ask Question C alone.
  39. #
  40. # 3. Otherwise ASK with the AskUserQuestion tool. Match the user's language.
  41. # Step 1 — ONE AskUserQuestion call with THREE questions (on Windows TWO:
  42. # leave out Question C — Mods is macOS / Linux only for now):
  43. # Question A (size) — text (use exactly this, on one line):
  44. # EN: Which size would you like to install? (examples on GitHub: https://github.com/awesomezun/claude-statusline)
  45. # KO: 어떤 크기로 설치할까요? (예시는 GitHub에서 확인: https://github.com/awesomezun/claude-statusline)
  46. # Four options, in EXACTLY this order (do NOT reorder). The recommended
  47. # option is ALWAYS large (option 1) — never substitute anything else:
  48. # 1. large (l) (추천 / Recommended) — most info, good for most users / 추천 기본값
  49. # 2. xlarge (xl) — largest, full detail / 가장 크게, 전체 상세
  50. # 3. medium (m) — balanced layout / 균형 잡힌 레이아웃
  51. # 4. small / xsmall — the two smallest, pick this to choose between them
  52. # / 작은 두 가지 (고르면 한 번 더 선택)
  53. # Question B (style) — text:
  54. # EN: Which style would you like?
  55. # KO: 어떤 스타일로 할까요?
  56. # Three options, in this order:
  57. # 1. With emoji (Recommended) / 이모지 있음 (추천) — icons + gradient bars
  58. # 2. No emoji / 이모지 없음 — same layout and bars, text labels instead of icons
  59. # 3. Simple text / 심플 텍스트형 — text only, no bars or emoji
  60. # Question C (display) — text:
  61. # EN: Where should it show?
  62. # KO: 어디에 표시할까요?
  63. # Two options, in this order:
  64. # 1. Statusline (Recommended) / 상태줄 (추천) — the status line under the prompt, in the terminal
  65. # / 터미널 프롬프트 아래 상태줄
  66. # 2. Mods (beta) / Mods (베타) — the same preset in a band above the prompt, also shown in the
  67. # Claude desktop app / 프롬프트 위 띠로 표시, Claude 데스크톱 앱에서도 보임
  68. # Step 2 — ONLY if the user picked option 4 in Question A, ask again:
  69. # EN: Which of the two smaller sizes? KO: 작은 쪽 중 무엇으로 설치할까요?
  70. # 1. small (s) — space-saving, key info / 공간 절약, 주요 정보
  71. # 2. xsmall (xs) — smallest, essentials only / 가장 작게, 핵심만
  72. # Resolve the preset: the size, plus -plain for "No emoji" or -simple for
  73. # "Simple text" (e.g. large-plain, xsmall-simple), and the display:
  74. # --mods for "Mods", nothing for "Statusline".
  75. # If the user gives nothing / "recommended" / "default", use large (Statusline).
  76. #
  77. # 4. Then install with the resolved preset:
  78. # macOS / Linux: bash install.sh <preset> (or: bash install.sh <preset> --mods)
  79. # Windows PowerShell: ./install.ps1 <preset>
  80. #
  81. # 5. If "auto" mode blocks the install (it downloads code that runs on every
  82. # launch — declining to auto-approve that is correct), do NOT just stop:
  83. # still resolve the preset, then have the user run it themselves so it proceeds:
  84. # macOS / Linux: ! bash install.sh <preset> (add --mods for Mods)
  85. # Windows: ! irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
  86. # or have them leave auto mode (shift+tab) for the one install step.
  87. #
  88. # 6. Only a truly headless one-shot run (claude -p / hook / cron, no way to get
  89. # a reply) may default to large — and you must say that you did.
  90. # ============================================================================
  91. param([string]$Size)
  92. $ErrorActionPreference = 'Stop'
  93. try {
  94. [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  95. } catch {}
  96. function Write-Info($m) { Write-Host $m -ForegroundColor Cyan }
  97. function Write-Ok($m) { Write-Host $m -ForegroundColor Green }
  98. function Write-Err($m) { Write-Host $m -ForegroundColor Red }
  99. # abbreviation OR full name (optionally with -plain / -simple) -> canonical preset, or $null
  100. function Normalize-Mode([string]$s) {
  101. $s = $s.Trim().ToLowerInvariant()
  102. $style = ''
  103. if ($s.EndsWith('-plain')) { $style = '-plain'; $s = $s.Substring(0, $s.Length - 6) }
  104. elseif ($s.EndsWith('-simple')) { $style = '-simple'; $s = $s.Substring(0, $s.Length - 7) }
  105. switch ($s) {
  106. { $_ -in 'xs', 'xsmall' } { return "xsmall$style" }
  107. { $_ -in 's', 'small' } { return "small$style" }
  108. { $_ -in 'm', 'medium' } { return "medium$style" }
  109. { $_ -in 'l', 'large' } { return "large$style" }
  110. { $_ -in 'xl', 'xlarge' } { return "xlarge$style" }
  111. 'simple' { return 'small-simple' } # alias
  112. { $_ -in 'oneline', 'one-line', '1line' } { return 'xsmall-simple' } # alias
  113. }
  114. return $null
  115. }
  116. # --- paths ------------------------------------------------------------------
  117. $ClaudeDir = if ($env:CLAUDE_CONFIG_DIR) { $env:CLAUDE_CONFIG_DIR } else { Join-Path $HOME '.claude' }
  118. $Settings = Join-Path $ClaudeDir 'settings.json'
  119. $Dest = Join-Path $ClaudeDir 'awesome-statusline.ps1'
  120. $ScriptPath = $MyInvocation.MyCommand.Path
  121. $ScriptDir = if ($ScriptPath) { Split-Path -Parent $ScriptPath } else { (Get-Location).Path }
  122. $SrcDir = Join-Path $ScriptDir 'scripts'
  123. $RepoRaw = if ($env:AWESOME_STATUSLINE_RAW) { $env:AWESOME_STATUSLINE_RAW } else { 'https://raw.githubusercontent.com/awesomezun/claude-statusline/main' }
  124. # --- pick preset ------------------------------------------------------------
  125. # Precedence: explicit argument > interactive prompt > 'large' default.
  126. # When no preset is given and a real console is attached, ask (default large).
  127. # In non-interactive contexts (e.g. `irm ... | iex`, CI) we never block — the
  128. # console read throws and we fall straight through to 'large'.
  129. $Mode = 'large'
  130. if ($Size) {
  131. $Mode = Normalize-Mode $Size
  132. if (-not $Mode) {
  133. Write-Err "Unknown preset: '$Size'"
  134. Write-Err "Valid: xsmall|xs small|s medium|m large|l xlarge|xl - each optionally -plain or -simple (aliases: simple, oneline)"
  135. exit 1
  136. }
  137. } elseif ([Environment]::UserInteractive) {
  138. # Korean UI culture? Show the prompt in Korean; otherwise default to English.
  139. $isKo = ([Globalization.CultureInfo]::CurrentUICulture.TwoLetterISOLanguageName -eq 'ko')
  140. Write-Host ""
  141. if ($isKo) {
  142. Write-Host "statusline을 어떤 크기로 설치할까요? (예시는 github에서 확인)"
  143. Write-Host " 예시: https://github.com/awesomezun/claude-statusline"
  144. Write-Host ""
  145. Write-Host " 1. xsmall (xs) 가장 작게 — 2줄, 핵심만"
  146. Write-Host " 2. small (s) 작게 — 2줄, 라벨과 막대"
  147. Write-Host " 3. medium (m) 중간 — 4줄, 넓은 컨텍스트 막대"
  148. Write-Host " 4. large (l) 크게 — 5줄, 세션 시간·리셋 (추천 기본값)"
  149. Write-Host " 5. xlarge (xl) 가장 크게 — 6줄, 전체 상세"
  150. Write-Host ""
  151. Write-Host -NoNewline "선택 [기본값: 4]: "
  152. } else {
  153. Write-Host "Which size would you like to install? (see examples on GitHub)"
  154. Write-Host " Examples: https://github.com/awesomezun/claude-statusline"
  155. Write-Host ""
  156. Write-Host " 1. xsmall (xs) smallest — 2 lines, essentials"
  157. Write-Host " 2. small (s) small — 2 lines, labels + bars"
  158. Write-Host " 3. medium (m) medium — 4 lines, wide context bar"
  159. Write-Host " 4. large (l) large — 5 lines, session time / resets (recommended)"
  160. Write-Host " 5. xlarge (xl) largest — 6 lines, full detail"
  161. Write-Host ""
  162. Write-Host -NoNewline "Choice [default: 4]: "
  163. }
  164. # Under `irm ... | iex` the downloaded script occupies the pipeline, so a plain
  165. # Read-Host can be skipped (the PowerShell analog of the bash `curl | bash`
  166. # stdin problem fixed via /dev/tty). Read from the console host directly; if no
  167. # real console is attached (CI, non-interactive host) ReadLine throws and we
  168. # fall through to the 'large' default instead of blocking.
  169. $interactive = $true
  170. $answer = ''
  171. try { $answer = $Host.UI.ReadLine() } catch { $answer = ''; $interactive = $false }
  172. $answer = "$answer".Trim()
  173. switch ($answer) {
  174. '1' { $Mode = 'xsmall' }
  175. '2' { $Mode = 'small' }
  176. '3' { $Mode = 'medium' }
  177. '4' { $Mode = 'large' }
  178. '' { $Mode = 'large' }
  179. '5' { $Mode = 'xlarge' }
  180. default {
  181. # Allow typing a preset name/alias directly instead of a number.
  182. $Mode = Normalize-Mode $answer
  183. if (-not $Mode) {
  184. if ($isKo) { Write-Host "알 수 없는 입력 '$answer' — 'large'로 설치합니다." }
  185. else { Write-Host "Unknown input '$answer', using 'large'." }
  186. $Mode = 'large'
  187. }
  188. }
  189. }
  190. # A typed name may already carry its style (l-plain, m-simple, simple, ...).
  191. if ($interactive -and -not ($Mode.EndsWith('-plain') -or $Mode.EndsWith('-simple'))) {
  192. Write-Host ""
  193. if ($isKo) {
  194. Write-Host "어떤 스타일로 할까요?"
  195. Write-Host " 1. 이모지 있음 — 아이콘과 그래디언트 막대 (기본값)"
  196. Write-Host " 2. 이모지 없음 — 같은 배치, 아이콘 대신 글자"
  197. Write-Host " 3. 심플 텍스트형 — 막대·이모지 없이 글자만"
  198. Write-Host -NoNewline "선택 [기본값: 1]: "
  199. } else {
  200. Write-Host "Which style?"
  201. Write-Host " 1. With emoji — icons and gradient bars (default)"
  202. Write-Host " 2. No emoji — same layout, text labels instead of icons"
  203. Write-Host " 3. Simple text — text only, no bars or emoji"
  204. Write-Host -NoNewline "Choice [default: 1]: "
  205. }
  206. $st = ''
  207. try { $st = "$($Host.UI.ReadLine())".Trim() } catch { $st = '' }
  208. if ($st -eq '2') { $Mode = "$Mode-plain" }
  209. elseif ($st -eq '3') { $Mode = "$Mode-simple" }
  210. }
  211. }
  212. # --- install the script -----------------------------------------------------
  213. New-Item -ItemType Directory -Force -Path $ClaudeDir | Out-Null
  214. $Src = Join-Path $SrcDir 'awesome-statusline-windows.ps1'
  215. if (Test-Path $Src) {
  216. Copy-Item $Src $Dest -Force
  217. } else {
  218. Write-Info "Local scripts/ not found, downloading Windows renderer from repo..."
  219. Invoke-WebRequest -Uri "$RepoRaw/scripts/awesome-statusline-windows.ps1" -OutFile $Dest
  220. }
  221. # Force UTF-8 *with* BOM. The renderer body contains non-ASCII glyphs
  222. # (progress-bar blocks U+2588/U+2591, emoji). Windows PowerShell 5.1 does not
  223. # auto-detect UTF-8: with no BOM it reads .ps1 files using the system ANSI code
  224. # page (e.g. CP949 on Korean systems), corrupting those bytes into garbage
  225. # tokens that break the parser and leave the status line blank. Writing the BOM
  226. # explicitly guarantees correct parsing on every host (PS 5.1 and 7+).
  227. $scriptText = [System.IO.File]::ReadAllText($Dest, [System.Text.UTF8Encoding]::new($false))
  228. $utf8Bom = [System.Text.UTF8Encoding]::new($true)
  229. [System.IO.File]::WriteAllText($Dest, $scriptText, $utf8Bom)
  230. # --- patch settings.json ----------------------------------------------------
  231. $CommandPath = $Dest.Replace('\', '/')
  232. $Command = "powershell -NoProfile -ExecutionPolicy Bypass -File `"$CommandPath`" -Size $Mode"
  233. $slObj = [pscustomobject]@{ type = 'command'; command = $Command }
  234. if (Test-Path $Settings) {
  235. $backup = "$Settings.backup-" + (Get-Date -Format 'yyyyMMdd-HHmmss')
  236. Copy-Item $Settings $backup -Force
  237. # -Encoding UTF8: PS 5.1 would otherwise read settings.json with the ANSI code
  238. # page and fail on any non-ASCII text already in it.
  239. $json = Get-Content $Settings -Raw -Encoding UTF8 | ConvertFrom-Json
  240. if ($json.PSObject.Properties.Name -contains 'statusLine') {
  241. $json.statusLine = $slObj
  242. } else {
  243. $json | Add-Member -NotePropertyName 'statusLine' -NotePropertyValue $slObj
  244. }
  245. $json | ConvertTo-Json -Depth 20 | Set-Content $Settings -Encoding UTF8
  246. Write-Info "Existing settings backed up to: $backup"
  247. } else {
  248. [pscustomobject]@{ statusLine = $slObj } | ConvertTo-Json -Depth 20 | Set-Content $Settings -Encoding UTF8
  249. }
  250. Write-Ok "Installed Awesome CC Statusline (preset: $Mode)"
  251. Write-Host " script: $Dest"
  252. Write-Host " settings: $Settings (statusLine set)"
  253. Write-Host " command: $Command"
  254. Write-Host ""
  255. Write-Host "Restart Claude Code to see it."
  256. Write-Host "To switch preset later, just ask your AI agent to reinstall with the one you want."
  257. Write-Host ""
  258. Write-Host "Star this repo if you find it useful - it really helps:"
  259. Write-Host " https://github.com/awesomezun/claude-statusline"
install.sh · Bundled script · 463 lines · 1 finding marked
  1. #!/usr/bin/env bash
  2. # ============================================================================
  3. # Awesome CC Statusline — installer (macOS / Linux / Windows-GitBash)
  4. # ----------------------------------------------------------------------------
  5. # Usage:
  6. # ./install.sh # install (asks which preset)
  7. # ./install.sh l # install by abbreviation
  8. # ./install.sh large-plain # install by full name, without emoji
  9. # ./install.sh m-simple # text-only style
  10. # ./install.sh large --mods # Mods (beta): a band above the prompt that also
  11. # # shows in the Claude desktop app
  12. #
  13. # Sizes (smallest -> largest):
  14. # xsmall (xs) 2 lines, minimal (xs-simple: 1 line)
  15. # small (s) 2 lines, labels + bars
  16. # medium (m) 4 lines, wide context bar
  17. # large (l) 5 lines, session time / resets (recommended)
  18. # xlarge (xl) 6 lines, 40-block bars, full detail
  19. # Styles (suffix):
  20. # (none) emoji icons + gradient bars
  21. # -plain same layout, no emoji (e.g. l-plain)
  22. # -simple text only, no bars, no emoji (e.g. l-simple)
  23. # aliases: simple = small-simple, oneline = xsmall-simple
  24. #
  25. # What it does:
  26. # 1. ensures `jq` is installed (auto-installs via the system package manager)
  27. # 2. copies the renderer to ~/.claude/awesome-statusline.sh
  28. # 3. sets settings.json -> statusLine.command (existing settings preserved,
  29. # a timestamped backup is made first)
  30. # With --mods (beta, macOS / Linux), instead of 3:
  31. # 3. copies the mod to ~/.claude/awesome-statusline-mod/ and installs it with
  32. # `claude plugin install` (the preset is the mod's `preset` option)
  33. # 4. removes an Awesome Statusline statusLine entry (backup first), so the
  34. # terminal doesn't show it twice
  35. #
  36. # Honors $CLAUDE_CONFIG_DIR (defaults to ~/.claude) so it is safe to test.
  37. # ============================================================================
  38. #
  39. # ============================================================================
  40. # HOW TO INSTALL — rules for the AI assistant running this.
  41. # A user may ask the assistant to install from the GitHub URL without cloning
  42. # the repo, so CLAUDE.md / the plugin command are NOT in context. These rules
  43. # are duplicated here (the one file the assistant always reads) and MUST stay
  44. # identical to CLAUDE.md and commands/statusline-setup.md in this repo.
  45. #
  46. # 1. You MUST resolve a preset before installing. Never install without an
  47. # explicit choice by the user. "Auto" / auto-accept mode is NOT an
  48. # exception — the user is present and can answer; ask anyway.
  49. # Recommending `large` (below) is only a hint shown inside the menu; it must
  50. # NEVER become a silent default or let you skip the question. Always ask.
  51. #
  52. # 2. If the user already named a preset — a size (xs/s/m/l/xl or full name),
  53. # optionally with -plain or -simple, or the aliases simple (= small-simple)
  54. # / oneline (= xsmall-simple) — use it and skip Questions A and B. A bare
  55. # size means the emoji style unless the user asked for no emoji or text
  56. # only. If they also said where it should show (statusline; or mods / the
  57. # desktop app), skip Question C too; on Windows always skip it (Statusline).
  58. # Otherwise ask Question C alone.
  59. #
  60. # 3. Otherwise ASK with the AskUserQuestion tool. Match the user's language.
  61. # Step 1 — ONE AskUserQuestion call with THREE questions (on Windows TWO:
  62. # leave out Question C — Mods is macOS / Linux only for now):
  63. # Question A (size) — text (use exactly this, on one line):
  64. # EN: Which size would you like to install? (examples on GitHub: https://github.com/awesomezun/claude-statusline)
  65. # KO: 어떤 크기로 설치할까요? (예시는 GitHub에서 확인: https://github.com/awesomezun/claude-statusline)
  66. # Four options, in EXACTLY this order (do NOT reorder). The recommended
  67. # option is ALWAYS large (option 1) — never substitute anything else:
  68. # 1. large (l) (추천 / Recommended) — most info, good for most users / 추천 기본값
  69. # 2. xlarge (xl) — largest, full detail / 가장 크게, 전체 상세
  70. # 3. medium (m) — balanced layout / 균형 잡힌 레이아웃
  71. # 4. small / xsmall — the two smallest, pick this to choose between them
  72. # / 작은 두 가지 (고르면 한 번 더 선택)
  73. # Question B (style) — text:
  74. # EN: Which style would you like?
  75. # KO: 어떤 스타일로 할까요?
  76. # Three options, in this order:
  77. # 1. With emoji (Recommended) / 이모지 있음 (추천) — icons + gradient bars
  78. # 2. No emoji / 이모지 없음 — same layout and bars, text labels instead of icons
  79. # 3. Simple text / 심플 텍스트형 — text only, no bars or emoji
  80. # Question C (display) — text:
  81. # EN: Where should it show?
  82. # KO: 어디에 표시할까요?
  83. # Two options, in this order:
  84. # 1. Statusline (Recommended) / 상태줄 (추천) — the status line under the prompt, in the terminal
  85. # / 터미널 프롬프트 아래 상태줄
  86. # 2. Mods (beta) / Mods (베타) — the same preset in a band above the prompt, also shown in the
  87. # Claude desktop app / 프롬프트 위 띠로 표시, Claude 데스크톱 앱에서도 보임
  88. # Step 2 — ONLY if the user picked option 4 in Question A, ask again:
  89. # EN: Which of the two smaller sizes? KO: 작은 쪽 중 무엇으로 설치할까요?
  90. # 1. small (s) — space-saving, key info / 공간 절약, 주요 정보
  91. # 2. xsmall (xs) — smallest, essentials only / 가장 작게, 핵심만
  92. # Resolve the preset: the size, plus -plain for "No emoji" or -simple for
  93. # "Simple text" (e.g. large-plain, xsmall-simple), and the display:
  94. # --mods for "Mods", nothing for "Statusline".
  95. # If the user gives nothing / "recommended" / "default", use large (Statusline).
  96. #
  97. # 4. Then install with the resolved preset:
  98. # macOS / Linux: bash install.sh <preset> (or: bash install.sh <preset> --mods)
  99. # Windows PowerShell: ./install.ps1 <preset>
  100. #
  101. # 5. If "auto" mode blocks the install (it downloads code that runs on every
  102. # launch — declining to auto-approve that is correct), do NOT just stop:
  103. # still resolve the preset, then have the user run it themselves so it proceeds:
  104. # macOS / Linux: ! bash install.sh <preset> (add --mods for Mods)
  105. # Windows: ! irm https://raw.githubusercontent.com/awesomezun/claude-statusline/main/install.ps1 | iex
  106. # or have them leave auto mode (shift+tab) for the one install step.
  107. #
  108. # 6. Only a truly headless one-shot run (claude -p / hook / cron, no way to get
  109. # a reply) may default to large — and you must say that you did.
  110. # ============================================================================
  111. set -euo pipefail
  112. # --- paths ------------------------------------------------------------------
  113. CLAUDE_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
  114. SETTINGS="$CLAUDE_DIR/settings.json"
  115. DEST="$CLAUDE_DIR/awesome-statusline.sh"
  116. # Resolve script dir safely. Under `curl ... | bash` the script arrives on
  117. # stdin, so BASH_SOURCE is unset — with `set -u` that would crash here. Fall
  118. # back to an empty SCRIPT_DIR, which routes us to the repo-download branch.
  119. if [ -n "${BASH_SOURCE:-}" ]; then
  120. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  121. else
  122. SCRIPT_DIR=""
  123. fi
  124. SRC="$SCRIPT_DIR/scripts/awesome-statusline.sh"
  125. REPO_RAW="${AWESOME_STATUSLINE_RAW:-https://raw.githubusercontent.com/awesomezun/claude-statusline/main}"
  126. MOD_NAME="awesome-statusline-mod"
  127. MOD_DIR="$CLAUDE_DIR/$MOD_NAME"
  128. # The mod's files, relative to mods/awesome-statusline-mod/ in the repo.
  129. MOD_FILES=".claude-plugin/plugin.json .claude-plugin/marketplace.json hooks/hooks.json hooks/register.tsx hooks/ansi.ts hooks/cockpit.tsx hooks/gauges.ts hooks/dash.ts hooks/cluster.ts hooks/sources.ts types/index.d.ts"
  130. # --- output helpers ---------------------------------------------------------
  131. err() { printf '\033[31m%s\033[0m\n' "$*" >&2; }
  132. ok() { printf '\033[32m%s\033[0m\n' "$*"; }
  133. info() { printf '\033[36m%s\033[0m\n' "$*"; }
  134. # map abbreviation OR full name (optionally with -plain / -simple) -> canonical preset
  135. normalize_mode() {
  136. local s style=""
  137. s="$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')"
  138. case "$s" in
  139. *-plain) style="-plain"; s="${s%-plain}" ;;
  140. *-simple) style="-simple"; s="${s%-simple}" ;;
  141. esac
  142. case "$s" in
  143. xs|xsmall) echo "xsmall$style" ;;
  144. s|small) echo "small$style" ;;
  145. m|medium) echo "medium$style" ;;
  146. l|large) echo "large$style" ;;
  147. xl|xlarge) echo "xlarge$style" ;;
  148. simple) echo "small-simple" ;; # alias
  149. oneline|one-line|1line) echo "xsmall-simple" ;; # alias
  150. *) return 1 ;;
  151. esac
  152. }
  153. # --- dependency: jq (auto-install) ------------------------------------------
  154. install_jq() {
  155. info "jq not found — attempting automatic install…"
  156. if command -v brew >/dev/null 2>&1; then brew install jq
  157. elif command -v apt-get >/dev/null 2>&1; then sudo apt-get update && sudo apt-get install -y jq
  158. elif command -v dnf >/dev/null 2>&1; then sudo dnf install -y jq
  159. elif command -v yum >/dev/null 2>&1; then sudo yum install -y jq
  160. elif command -v pacman >/dev/null 2>&1; then sudo pacman -S --noconfirm jq
  161. elif command -v zypper >/dev/null 2>&1; then sudo zypper install -y jq
  162. elif command -v apk >/dev/null 2>&1; then sudo apk add jq
  163. elif command -v winget >/dev/null 2>&1; then winget install --silent --accept-package-agreements --accept-source-agreements jqlang.jq
  164. elif command -v scoop >/dev/null 2>&1; then scoop install jq
  165. elif command -v choco >/dev/null 2>&1; then choco install jq -y
  166. else
  167. err "No supported package manager found. Please install jq manually:"
  168. err " https://jqlang.github.io/jq/download/"
  169. return 1
  170. fi
  171. }
  172. ensure_jq() {
  173. if ! command -v jq >/dev/null 2>&1; then
  174. install_jq || exit 1
  175. command -v jq >/dev/null 2>&1 || { err "jq install did not succeed."; exit 1; }
  176. ok "jq installed."
  177. fi
  178. }
  179. # --- pick preset ------------------------------------------------------------
  180. # Precedence: explicit argument > interactive prompt > 'large' default.
  181. MODE="large"
  182. # Korean locale? Show the prompt in Korean; otherwise default to English.
  183. is_korean_locale() {
  184. case "${LC_ALL:-${LC_MESSAGES:-${LANG:-}}}" in
  185. ko|ko_*|ko.*|ko-*) return 0 ;;
  186. *) return 1 ;;
  187. esac
  188. }
  189. # Ask the user which size and style to install (default large, emoji). Reads stdin.
  190. prompt_size() {
  191. echo
  192. if is_korean_locale; then
  193. echo "statusline을 어떤 크기로 설치할까요? (예시는 github에서 확인)"
  194. echo " 예시: https://github.com/awesomezun/claude-statusline"
  195. echo
  196. echo " 1. xsmall (xs) 가장 작게 — 2줄, 핵심만"
  197. echo " 2. small (s) 작게 — 2줄, 라벨과 막대"
  198. echo " 3. medium (m) 중간 — 4줄, 넓은 컨텍스트 막대"
  199. echo " 4. large (l) 크게 — 5줄, 세션 시간·리셋 (추천 기본값)"
  200. echo " 5. xlarge (xl) 가장 크게 — 6줄, 전체 상세"
  201. echo
  202. printf '선택 [기본값: 4]: '
  203. else
  204. echo "Which size would you like to install? (see examples on GitHub)"
  205. echo " Examples: https://github.com/awesomezun/claude-statusline"
  206. echo
  207. echo " 1. xsmall (xs) smallest — 2 lines, essentials"
  208. echo " 2. small (s) small — 2 lines, labels + bars"
  209. echo " 3. medium (m) medium — 4 lines, wide context bar"
  210. echo " 4. large (l) large — 5 lines, session time / resets (recommended)"
  211. echo " 5. xlarge (xl) largest — 6 lines, full detail"
  212. echo
  213. printf 'Choice [default: 4]: '
  214. fi
  215. local answer=""
  216. read -r answer || answer=""
  217. case "$answer" in
  218. 1) MODE="xsmall" ;;
  219. 2) MODE="small" ;;
  220. 3) MODE="medium" ;;
  221. 4|"") MODE="large" ;;
  222. 5) MODE="xlarge" ;;
  223. *)
  224. # Allow typing a preset name/alias directly instead of a number.
  225. if ! MODE="$(normalize_mode "$answer")"; then
  226. if is_korean_locale; then
  227. echo "알 수 없는 입력 '$answer' — 'large'로 설치합니다."
  228. else
  229. echo "Unknown input '$answer', using 'large'."
  230. fi
  231. MODE="large"
  232. fi
  233. ;;
  234. esac
  235. # A typed name may already carry its style (l-plain, m-simple, simple, …).
  236. case "$MODE" in *-plain|*-simple) return ;; esac
  237. echo
  238. if is_korean_locale; then
  239. echo "어떤 스타일로 할까요?"
  240. echo " 1. 이모지 있음 — 아이콘과 그래디언트 막대 (기본값)"
  241. echo " 2. 이모지 없음 — 같은 배치, 아이콘 대신 글자"
  242. echo " 3. 심플 텍스트형 — 막대·이모지 없이 글자만"
  243. printf '선택 [기본값: 1]: '
  244. else
  245. echo "Which style?"
  246. echo " 1. With emoji — icons and gradient bars (default)"
  247. echo " 2. No emoji — same layout, text labels instead of icons"
  248. echo " 3. Simple text — text only, no bars or emoji"
  249. printf 'Choice [default: 1]: '
  250. fi
  251. local style=""
  252. read -r style || style=""
  253. case "$style" in
  254. 2) MODE="$MODE-plain" ;;
  255. 3) MODE="$MODE-simple" ;;
  256. esac
  257. }
  258. # Ask where it should show (default Statusline). Reads stdin.
  259. prompt_display() {
  260. echo
  261. if is_korean_locale; then
  262. echo "어디에 표시할까요?"
  263. echo " 1. 상태줄 — 터미널 프롬프트 아래 (기본값)"
  264. echo " 2. Mods (베타) — 프롬프트 위 띠, Claude 데스크톱 앱에서도 보임"
  265. printf '선택 [기본값: 1]: '
  266. else
  267. echo "Where should it show?"
  268. echo " 1. Statusline — under the prompt, in the terminal (default)"
  269. echo " 2. Mods (beta) — a band above the prompt, also in the Claude desktop app"
  270. printf 'Choice [default: 1]: '
  271. fi
  272. local answer=""
  273. read -r answer || answer=""
  274. case "$answer" in
  275. 2|m|mods|--mods) DISPLAY_MODE="mods" ;;
  276. esac
  277. }
  278. # Where it shows: statusline (default) or mods (--mods).
  279. DISPLAY_MODE="statusline"
  280. PRESET_ARG=""
  281. DISPLAY_ARG=""
  282. for arg in "$@"; do
  283. case "$arg" in
  284. --mods|mods) DISPLAY_MODE="mods"; DISPLAY_ARG=1 ;;
  285. --statusline|statusline) DISPLAY_MODE="statusline"; DISPLAY_ARG=1 ;;
  286. *)
  287. if [ -n "$PRESET_ARG" ]; then err "Unexpected argument: '$arg'"; exit 1; fi
  288. PRESET_ARG="$arg" ;;
  289. esac
  290. done
  291. ask() {
  292. if [ -z "$PRESET_ARG" ]; then prompt_size; fi
  293. if [ -z "$DISPLAY_ARG" ]; then prompt_display; fi
  294. }
  295. if [ -n "$PRESET_ARG" ] && ! MODE="$(normalize_mode "$PRESET_ARG")"; then
  296. err "Unknown preset: '$PRESET_ARG'"
  297. err "Valid: xsmall|xs small|s medium|m large|l xlarge|xl — each optionally -plain or -simple (aliases: simple, oneline)"
  298. exit 1
  299. fi
  300. if [ -n "$PRESET_ARG" ] && [ -n "$DISPLAY_ARG" ]; then
  301. : # everything given: never prompt
  302. elif [ -n "$PRESET_ARG" ]; then
  303. : # a preset alone keeps the old one-argument behaviour: Statusline
  304. elif [ -t 0 ]; then
  305. # Normal `./install.sh` / `bash install.sh` — stdin is the terminal.
  306. ask
  307. elif { exec 3</dev/tty; } 2>/dev/null; then
  308. # Piped install (`curl ... | bash`): the script body is on stdin, but a
  309. # controlling terminal still exists — prompt through /dev/tty.
  310. ask <&3
  311. exec 3<&-
  312. fi
  313. # Truly non-interactive (CI, Claude Code, redirected stdin with no tty): no
  314. # branch prompts, so MODE stays 'large' (Statusline) and the install never blocks.
  315. if [ "$DISPLAY_MODE" = "mods" ]; then
  316. case "$(uname -s 2>/dev/null)" in
  317. MINGW*|MSYS*|CYGWIN*)
  318. err "Mods is macOS / Linux only for now. On Windows install the statusline: ./install.ps1 $MODE"
  319. exit 1 ;;
  320. esac
  321. fi
  322. # --- run --------------------------------------------------------------------
  323. ensure_jq
  324. mkdir -p "$CLAUDE_DIR"
  325. if [ -n "$SCRIPT_DIR" ] && [ -f "$SRC" ]; then
  326. cp "$SRC" "$DEST"
  327. else
  328. info "Local scripts/ not found, downloading the renderer from repo…"
  329. curl -fsSL "$REPO_RAW/scripts/awesome-statusline.sh" -o "$DEST" \
  330. || { err "Download failed. Check network or \$AWESOME_STATUSLINE_RAW."; exit 1; }
  331. fi
  332. chmod +x "$DEST"
  333. # --- Mods (beta): the same renderer, drawn by a Claude Code mod ----------------
  334. # Finds the claude CLI: PATH first, then where its installers put it.
  335. find_claude() {
  336. if command -v claude >/dev/null 2>&1; then command -v claude; return 0; fi
  337. local c
  338. for c in "$HOME/.local/bin/claude" "$HOME/.claude/local/claude" /opt/homebrew/bin/claude /usr/local/bin/claude; do
  339. if [ -x "$c" ]; then echo "$c"; return 0; fi
  340. done
  341. return 1
  342. }
  343. install_mods() {
  344. local claude_bin staged f terminal_opt
  345. if ! claude_bin="$(find_claude)"; then
  346. err "Mods needs the claude CLI (Claude Code) on this machine, and it was not found."
  347. err "Install Claude Code (https://claude.com/claude-code), or use the statusline: bash install.sh $MODE"
  348. exit 1
  349. fi
  350. # Stage the mod and swap it in whole, so a failed download leaves the old one.
  351. staged="$MOD_DIR.new"
  352. rm -rf "$staged"
  353. for f in $MOD_FILES; do
  354. mkdir -p "$staged/$(dirname "$f")"
  355. if [ -n "$SCRIPT_DIR" ] && [ -f "$SCRIPT_DIR/mods/$MOD_NAME/$f" ]; then
  356. cp "$SCRIPT_DIR/mods/$MOD_NAME/$f" "$staged/$f"
  357. else
  358. curl -fsSL "$REPO_RAW/mods/$MOD_NAME/$f" -o "$staged/$f" \
  359. || { err "Download failed: mods/$MOD_NAME/$f"; rm -rf "$staged"; exit 1; }
  360. fi
  361. done
  362. # The renderer travels with the mod, so the mod runs the version it was made for.
  363. cp "$DEST" "$staged/awesome-statusline.sh"
  364. rm -rf "$MOD_DIR"
  365. mv "$staged" "$MOD_DIR"
  366. # Keep a `terminal` option the person already set; default auto.
  367. terminal_opt="auto"
  368. if [ -f "$SETTINGS" ]; then
  369. terminal_opt="$(jq -r --arg k "$MOD_NAME@awesome-statusline-local" '.pluginConfigs[$k].options.terminal // "auto"' "$SETTINGS" 2>/dev/null || echo auto)"
  370. fi
  371. # Installing again only updates the options: the mod is read from $MOD_DIR in place.
  372. "$claude_bin" plugin install "$MOD_NAME" --marketplace "$MOD_DIR" \
  373. --config "preset=$MODE" --config "terminal=$terminal_opt" \
  374. || { err "claude plugin install failed. Run it yourself to see why:"; \
  375. err " claude plugin install $MOD_NAME --marketplace $MOD_DIR --config preset=$MODE"; exit 1; }
  376. # An Awesome Statusline statusLine would show the same lines a second time in
  377. # the terminal: remove it (backup first). Any other statusLine is left alone;
  378. # the band then stays hidden in the terminal while it is set (option `terminal`).
  379. if [ -f "$SETTINGS" ] && jq -e '(.statusLine.command // "") | test("awesome-statusline")' "$SETTINGS" >/dev/null 2>&1; then
  380. BACKUP="$SETTINGS.backup-$(date +%Y%m%d-%H%M%S)"
  381. cp "$SETTINGS" "$BACKUP"
  382. jq 'del(.statusLine)' "$SETTINGS" > "$SETTINGS.tmp" && mv "$SETTINGS.tmp" "$SETTINGS"
  383. info "Removed the Awesome Statusline statusLine (the mod shows it now). Backup: $BACKUP"
  384. elif [ -f "$SETTINGS" ] && jq -e '(.statusLine.command // "") != ""' "$SETTINGS" >/dev/null 2>&1; then
  385. info "Another statusLine is set: the terminal keeps it and the band shows in the desktop app."
  386. info " To show the band in the terminal too: /plugin configure $MOD_NAME@awesome-statusline-local (terminal: show)"
  387. fi
  388. }
  389. # Invoke via `bash <script>` (not the bare path) so the statusline runs
  390. # identically on every platform. On Windows a bare `.sh` path is opened through
  391. # its file association (`bash --login -i ...`), which spawns visible terminal
  392. # windows and breaks stdin/stdout — calling bash explicitly avoids that.
  393. STATUSLINE_JSON="$(jq -n --arg c "bash ~/.claude/awesome-statusline.sh $MODE" '{type:"command",command:$c}')"
  394. if [ "$DISPLAY_MODE" = "mods" ]; then
  395. install_mods
  396. elif [ -f "$SETTINGS" ]; then
  397. BACKUP="$SETTINGS.backup-$(date +%Y%m%d-%H%M%S)"
  398. cp "$SETTINGS" "$BACKUP"
  399. jq --argjson sl "$STATUSLINE_JSON" '.statusLine = $sl' "$SETTINGS" > "$SETTINGS.tmp" \
  400. && mv "$SETTINGS.tmp" "$SETTINGS"
  401. info "Existing settings backed up to: $BACKUP"
  402. else
  403. jq -n --argjson sl "$STATUSLINE_JSON" '{statusLine: $sl}' > "$SETTINGS"
  404. fi
  405. # --- tmux: keep 24-bit colour ------------------------------------------------
  406. # Inside tmux, Claude Code downgrades every colour to 256 unless
  407. # CLAUDE_CODE_TMUX_TRUECOLOR is set, which turns the gradient bars into uneven
  408. # bands. If this tmux passes 24-bit colour (RGB) through, switch it on (it takes
  409. # effect in new Claude Code sessions); otherwise the statusline falls back to
  410. # its own 256-colour palette and we print how to enable RGB in tmux.
  411. if [ -n "${TMUX:-}" ] && command -v tmux >/dev/null 2>&1; then
  412. if tmux display -p '#{client_termfeatures}' 2>/dev/null | grep -q 'RGB'; then
  413. jq '.env = ((.env // {}) + {"CLAUDE_CODE_TMUX_TRUECOLOR": "1"})' "$SETTINGS" > "$SETTINGS.tmp" \
  414. && mv "$SETTINGS.tmp" "$SETTINGS"
  415. info "tmux with 24-bit colour detected: set env.CLAUDE_CODE_TMUX_TRUECOLOR=1 so gradients stay smooth."
  416. else
  417. info "tmux without 24-bit colour detected: the statusline uses its 256-colour palette."
  418. info " For smooth gradients add to ~/.tmux.conf: set -as terminal-features ',xterm*:RGB'"
  419. fi
  420. fi
  421. if [ "$DISPLAY_MODE" = "mods" ]; then
  422. ok "Installed Awesome Statusline as a mod (preset: $MODE)"
  423. echo " mod: $MOD_DIR"
  424. echo " plugin: $MOD_NAME@awesome-statusline-local (user scope)"
  425. echo
  426. echo "Start a new Claude Code session (terminal, or the desktop app's Code tab):"
  427. echo "the band shows above the prompt."
  428. else
  429. ok "Installed Awesome CC Statusline (preset: $MODE)"
  430. echo " script: $DEST"
  431. echo " settings: $SETTINGS (statusLine set)"
  432. echo
  433. echo "Restart Claude Code (or reload) to see it."
  434. fi
  435. echo "To switch preset later, just ask your AI agent to reinstall with the one you want."
  436. echo
  437. echo "⭐ If you like Awesome Statusline, a GitHub star really helps:"
  438. echo " https://github.com/awesomezun/claude-statusline"

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.