ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 shelltime

shelltime-statusline

Claude Code 的 ShellTime 提示列:在終端機與桌面應用程式中顯示 Git、模型、工作階段與每日費用、配額、代理時間和 context

shelltime@shelltime

shelltime/claude-code-mods/tree/main/plugins/shelltime-statusline

已翻譯

關於這個 mod

shelltime-statusline

這是 Claude Code 的 ShellTime 提示列外掛。它會在提示列上方的橫條中繪製 ShellTime 提示列。它執行於終端機,也執行於 Claude 桌面應用程式的 Code 分頁;該處不會繪製 settings.json 中的 statusLine 命令。

在終端機中,它與 shelltime cc statusline 顯示同一列,使用 Claude Code 的主題色彩,因此會跟隨 /theme:

🌿 main* | 🤖 Opus 5.5 | 💰 $1.23 | 📊 $12.50 | 🚦 5h:23% 7d:45% | ⏱️ 1h5m | 📈 42%

在桌面應用程式中,它是一列平面內容,沒有邊框或內距,使用在淺色與深色主題下都清楚的色調。配額與 context 會在每個百分比旁顯示細列。桌面應用程式不顯示模型,因為編輯器頁尾已經顯示它。

🌿 main*   💰 $1.23   📊 $12.50   🚦 5h ━━── 23%  7d ━━━─ 45%   ⏱️ 1h5m   📈 ━━── 42%

| 區段 | 顯示內容 | 顏色 | 連結 | | --- | --- | --- | --- | | 🌿 | Git 分支;工作樹有變更時顯示 * | 綠色;不在儲存庫內時為灰色 - | | | 🤖 | 模型(僅終端機) | | | | 💰 | 本次工作階段費用 | 青色 | shelltime.xyz 上的工作階段 | | 📊 | 今天的 Claude Code 費用 | 黃色(桌面端為琥珀色);沒有資料時為灰色 - | 你的編碼代理頁面 | | 🚦 | 已使用的 5 小時與 7 天配額 | 綠色,50% 起為黃色,80% 起為紅色;桌面端每個配額桶都有自己的列與顏色 | claude.ai 用量 | | ⏱️ | 今天的 AI 代理時間 | 洋紅色;沒有資料時為灰色 - | 你的個人資料 | | 📈 | 已使用的 context 視窗,桌面端有列 | 綠色,50% 起為黃色,80% 起為紅色 | |

安裝

claude plugin marketplace add shelltime/claude-code-mods
claude plugin install shelltime-statusline@shelltime

同一台機器上的桌面工作階段會載入相同的已安裝外掛。

設定

這個外掛不需要設定。它依照 CLI 相同的順序讀取 ShellTime CLI 自己的設定檔 ~/.shelltime/config.yaml(也支援 .yml / .toml,並將 config.local.* 合併在上面)。執行一次 shelltime init 後,外掛就會取得你的權杖。檔案變更會在下一次重新整理時讀取。

外掛不需要 shelltime 二進位檔或其常駐程式。沒有權杖時,它仍會顯示 Git、模型、工作階段費用、配額與 context。每日費用和代理時間顯示 -,也不會向 ShellTime 傳送任何內容。

數字的來源

| | shelltime cc statusline | 此外掛 | | --- | --- | --- | | git | 常駐程式執行 git | 執行相同的 git 命令(GIT_OPTIONAL_LOCKS=0) | | 模型、工作階段費用、context | Claude Code 的提示列 JSON | 相同的數值,直接來自 Claude Code | | 配額 | 常駐程式使用鑰匙圈中的 OAuth 權杖呼叫 Anthropic 用量 API | Claude Code 已從上一次 API 回應讀取的速率限制。不存取鑰匙圈,可在任何作業系統上執行 | | 每日費用、代理時間 | 常駐程式查詢 ShellTime API | 相同的 GraphQL 查詢,最多每 15 s 一次 | | 工作階段 → 專案對應 | 傳送至 ShellTime API | 相同的請求,每個工作階段與資料夾各一次 |

和原生提示列一樣,它會隨著對話變化重新整理:傳送提示時、每次工具呼叫後,以及一輪結束時。工作階段閒置時不會輪詢。

終端機

如果 ~/.claude/settings.json 也有執行 shelltime cc statusline 的 statusLine,終端機會顯示兩列。可以保留兩列,也可以移除其中一列。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add shelltime/claude-code-mods
claude plugin install shelltime-statusline
原文 / README

shelltime-statusline

The ShellTime statusline as a Claude Code mod. It draws the ShellTime statusline in a band above the prompt. It runs in the terminal and in the Code tab of the Claude desktop app, where the statusLine command from settings.json is not drawn.

In the terminal it is the same line as shelltime cc statusline, in Claude Code's theme colors, so it follows /theme:

🌿 main* | 🤖 Opus 5.5 | 💰 $1.23 | 📊 $12.50 | 🚦 5h:23% 7d:45% | ⏱️ 1h5m | 📈 42%

In the desktop app it is one flat row, with no borders or padding, in tones that read on the light and the dark theme. Quota and context get a thin bar beside each percentage. The model is left out there, since the composer's footer already shows it.

🌿 main*   💰 $1.23   📊 $12.50   🚦 5h ━━── 23%  7d ━━━─ 45%   ⏱️ 1h5m   📈 ━━── 42%

| Segment | Shows | Color | Link | | --- | --- | --- | --- | | 🌿 | Git branch, with * when the tree is dirty | green, gray - outside a repo | | | 🤖 | Model (terminal only) | | | | 💰 | This session's cost | cyan | the session on shelltime.xyz | | 📊 | Today's Claude Code cost | yellow (amber on desktop), gray - with none | your coding agent page | | 🚦 | 5-hour and 7-day quota used | green, yellow from 50%, red from 80%; on desktop each bucket has its own bar and color | claude.ai usage | | ⏱️ | Today's AI agent time | magenta, gray - with none | your profile | | 📈 | Context window used, with a bar on desktop | green, yellow from 50%, red from 80% | |

Install

claude plugin marketplace add shelltime/claude-code-mods
claude plugin install shelltime-statusline@shelltime

Desktop sessions on the same machine load the same installed plugins.

Configuration

There is nothing to configure in the mod. It reads the ShellTime CLI's own config file, ~/.shelltime/config.yaml (or .yml / .toml, with config.local.* merged over it), in the same order the CLI does. Run shelltime init once and the mod picks up your token. Changes to the file are picked up on the next refresh.

The mod doesn't need the shelltime binary or its daemon. Without a token it still shows git, model, session cost, quota and context. Daily cost and agent time show -, and nothing is sent to ShellTime.

Where the numbers come from

| | shelltime cc statusline | this mod | | --- | --- | --- | | git | the daemon runs git | runs the same git commands (GIT_OPTIONAL_LOCKS=0) | | model, session cost, context | Claude Code's statusline JSON | the same figures, from Claude Code directly | | quota | the daemon calls Anthropic's usage API with the OAuth token from the Keychain | the rate limits Claude Code already read from its last API response. No Keychain access, works on any OS | | daily cost, agent time | the daemon queries ShellTime's API | the same GraphQL query, at most once every 15 s | | session → project mapping | sent to ShellTime's API | the same request, once per session and directory |

Like the native statusline, it refreshes as the conversation changes: when you send a prompt, after each tool call, and when a turn ends. It doesn't poll while the session is idle.

Terminal

If ~/.claude/settings.json also has a statusLine running shelltime cc statusline, the terminal shows both lines. Keep both, or remove one.

更多類似作品