pulse-line 1.0.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.
Files changed (211) hide show
  1. package/.claude-plugin/marketplace.json +20 -0
  2. package/.claude-plugin/plugin.json +27 -0
  3. package/LICENSE +21 -0
  4. package/README.md +316 -0
  5. package/bin/pulse-line.js +12 -0
  6. package/commands/clear-cache.md +23 -0
  7. package/commands/config.md +25 -0
  8. package/commands/debug.md +25 -0
  9. package/commands/disable.md +27 -0
  10. package/commands/enable.md +27 -0
  11. package/commands/install.md +25 -0
  12. package/commands/language.md +27 -0
  13. package/commands/reload.md +23 -0
  14. package/commands/theme.md +27 -0
  15. package/commands/themes.md +23 -0
  16. package/commands/uninstall.md +23 -0
  17. package/dist/src/cli.d.ts +2 -0
  18. package/dist/src/cli.js +242 -0
  19. package/dist/src/cli.js.map +1 -0
  20. package/dist/src/config/defaults.d.ts +2 -0
  21. package/dist/src/config/defaults.js +7 -0
  22. package/dist/src/config/defaults.js.map +1 -0
  23. package/dist/src/config/loader.d.ts +6 -0
  24. package/dist/src/config/loader.js +146 -0
  25. package/dist/src/config/loader.js.map +1 -0
  26. package/dist/src/config/migrate-config.d.ts +2 -0
  27. package/dist/src/config/migrate-config.js +22 -0
  28. package/dist/src/config/migrate-config.js.map +1 -0
  29. package/dist/src/config/validator.d.ts +2 -0
  30. package/dist/src/config/validator.js +7 -0
  31. package/dist/src/config/validator.js.map +1 -0
  32. package/dist/src/extractors/account-usage.d.ts +20 -0
  33. package/dist/src/extractors/account-usage.js +293 -0
  34. package/dist/src/extractors/account-usage.js.map +1 -0
  35. package/dist/src/extractors/context.d.ts +7 -0
  36. package/dist/src/extractors/context.js +20 -0
  37. package/dist/src/extractors/context.js.map +1 -0
  38. package/dist/src/extractors/cost.d.ts +5 -0
  39. package/dist/src/extractors/cost.js +13 -0
  40. package/dist/src/extractors/cost.js.map +1 -0
  41. package/dist/src/extractors/git.d.ts +6 -0
  42. package/dist/src/extractors/git.js +35 -0
  43. package/dist/src/extractors/git.js.map +1 -0
  44. package/dist/src/extractors/index.d.ts +25 -0
  45. package/dist/src/extractors/index.js +33 -0
  46. package/dist/src/extractors/index.js.map +1 -0
  47. package/dist/src/extractors/mcp.d.ts +5 -0
  48. package/dist/src/extractors/mcp.js +72 -0
  49. package/dist/src/extractors/mcp.js.map +1 -0
  50. package/dist/src/extractors/model.d.ts +9 -0
  51. package/dist/src/extractors/model.js +20 -0
  52. package/dist/src/extractors/model.js.map +1 -0
  53. package/dist/src/extractors/output-style.d.ts +9 -0
  54. package/dist/src/extractors/output-style.js +13 -0
  55. package/dist/src/extractors/output-style.js.map +1 -0
  56. package/dist/src/extractors/rate-limits.d.ts +8 -0
  57. package/dist/src/extractors/rate-limits.js +39 -0
  58. package/dist/src/extractors/rate-limits.js.map +1 -0
  59. package/dist/src/extractors/session.d.ts +5 -0
  60. package/dist/src/extractors/session.js +67 -0
  61. package/dist/src/extractors/session.js.map +1 -0
  62. package/dist/src/extractors/thinking.d.ts +10 -0
  63. package/dist/src/extractors/thinking.js +16 -0
  64. package/dist/src/extractors/thinking.js.map +1 -0
  65. package/dist/src/extractors/third-party-api.d.ts +13 -0
  66. package/dist/src/extractors/third-party-api.js +193 -0
  67. package/dist/src/extractors/third-party-api.js.map +1 -0
  68. package/dist/src/extractors/transcript.d.ts +5 -0
  69. package/dist/src/extractors/transcript.js +67 -0
  70. package/dist/src/extractors/transcript.js.map +1 -0
  71. package/dist/src/extractors/workspace.d.ts +9 -0
  72. package/dist/src/extractors/workspace.js +43 -0
  73. package/dist/src/extractors/workspace.js.map +1 -0
  74. package/dist/src/formatters/duration.d.ts +1 -0
  75. package/dist/src/formatters/duration.js +19 -0
  76. package/dist/src/formatters/duration.js.map +1 -0
  77. package/dist/src/formatters/index.d.ts +7 -0
  78. package/dist/src/formatters/index.js +16 -0
  79. package/dist/src/formatters/index.js.map +1 -0
  80. package/dist/src/formatters/layout.d.ts +10 -0
  81. package/dist/src/formatters/layout.js +38 -0
  82. package/dist/src/formatters/layout.js.map +1 -0
  83. package/dist/src/formatters/progress-bar.d.ts +2 -0
  84. package/dist/src/formatters/progress-bar.js +23 -0
  85. package/dist/src/formatters/progress-bar.js.map +1 -0
  86. package/dist/src/formatters/segment.d.ts +9 -0
  87. package/dist/src/formatters/segment.js +18 -0
  88. package/dist/src/formatters/segment.js.map +1 -0
  89. package/dist/src/formatters/separator.d.ts +1 -0
  90. package/dist/src/formatters/separator.js +11 -0
  91. package/dist/src/formatters/separator.js.map +1 -0
  92. package/dist/src/i18n/index.d.ts +8 -0
  93. package/dist/src/i18n/index.js +31 -0
  94. package/dist/src/i18n/index.js.map +1 -0
  95. package/dist/src/i18n/locales/en.d.ts +1 -0
  96. package/dist/src/i18n/locales/en.js +26 -0
  97. package/dist/src/i18n/locales/en.js.map +1 -0
  98. package/dist/src/i18n/locales/zh.d.ts +1 -0
  99. package/dist/src/i18n/locales/zh.js +26 -0
  100. package/dist/src/i18n/locales/zh.js.map +1 -0
  101. package/dist/src/index.d.ts +1 -0
  102. package/dist/src/index.js +176 -0
  103. package/dist/src/index.js.map +1 -0
  104. package/dist/src/parser/stdin-parser.d.ts +3 -0
  105. package/dist/src/parser/stdin-parser.js +58 -0
  106. package/dist/src/parser/stdin-parser.js.map +1 -0
  107. package/dist/src/themes/builtin/cyberpunk.d.ts +2 -0
  108. package/dist/src/themes/builtin/cyberpunk.js +47 -0
  109. package/dist/src/themes/builtin/cyberpunk.js.map +1 -0
  110. package/dist/src/themes/builtin/dark.d.ts +2 -0
  111. package/dist/src/themes/builtin/dark.js +47 -0
  112. package/dist/src/themes/builtin/dark.js.map +1 -0
  113. package/dist/src/themes/builtin/forest.d.ts +2 -0
  114. package/dist/src/themes/builtin/forest.js +47 -0
  115. package/dist/src/themes/builtin/forest.js.map +1 -0
  116. package/dist/src/themes/builtin/light.d.ts +2 -0
  117. package/dist/src/themes/builtin/light.js +47 -0
  118. package/dist/src/themes/builtin/light.js.map +1 -0
  119. package/dist/src/themes/builtin/ocean.d.ts +2 -0
  120. package/dist/src/themes/builtin/ocean.js +47 -0
  121. package/dist/src/themes/builtin/ocean.js.map +1 -0
  122. package/dist/src/themes/icon-provider.d.ts +2 -0
  123. package/dist/src/themes/icon-provider.js +10 -0
  124. package/dist/src/themes/icon-provider.js.map +1 -0
  125. package/dist/src/themes/icon-sets/nerd.d.ts +17 -0
  126. package/dist/src/themes/icon-sets/nerd.js +20 -0
  127. package/dist/src/themes/icon-sets/nerd.js.map +1 -0
  128. package/dist/src/themes/icon-sets/text.d.ts +17 -0
  129. package/dist/src/themes/icon-sets/text.js +21 -0
  130. package/dist/src/themes/icon-sets/text.js.map +1 -0
  131. package/dist/src/themes/index.d.ts +4 -0
  132. package/dist/src/themes/index.js +56 -0
  133. package/dist/src/themes/index.js.map +1 -0
  134. package/dist/src/types/pulse-config.d.ts +58 -0
  135. package/dist/src/types/pulse-config.js +50 -0
  136. package/dist/src/types/pulse-config.js.map +1 -0
  137. package/dist/src/types/pulse-input.d.ts +83 -0
  138. package/dist/src/types/pulse-input.js +4 -0
  139. package/dist/src/types/pulse-input.js.map +1 -0
  140. package/dist/src/types/theme.d.ts +50 -0
  141. package/dist/src/types/theme.js +4 -0
  142. package/dist/src/types/theme.js.map +1 -0
  143. package/dist/src/utils/ansi.d.ts +6 -0
  144. package/dist/src/utils/ansi.js +31 -0
  145. package/dist/src/utils/ansi.js.map +1 -0
  146. package/dist/src/utils/cache.d.ts +11 -0
  147. package/dist/src/utils/cache.js +128 -0
  148. package/dist/src/utils/cache.js.map +1 -0
  149. package/dist/src/utils/claude-settings-env.d.ts +11 -0
  150. package/dist/src/utils/claude-settings-env.js +108 -0
  151. package/dist/src/utils/claude-settings-env.js.map +1 -0
  152. package/dist/src/utils/constants.d.ts +3 -0
  153. package/dist/src/utils/constants.js +43 -0
  154. package/dist/src/utils/constants.js.map +1 -0
  155. package/dist/src/utils/display-sanitize.d.ts +7 -0
  156. package/dist/src/utils/display-sanitize.js +69 -0
  157. package/dist/src/utils/display-sanitize.js.map +1 -0
  158. package/dist/src/utils/fs.d.ts +5 -0
  159. package/dist/src/utils/fs.js +79 -0
  160. package/dist/src/utils/fs.js.map +1 -0
  161. package/dist/src/utils/git.d.ts +7 -0
  162. package/dist/src/utils/git.js +56 -0
  163. package/dist/src/utils/git.js.map +1 -0
  164. package/dist/src/utils/logger.d.ts +9 -0
  165. package/dist/src/utils/logger.js +53 -0
  166. package/dist/src/utils/logger.js.map +1 -0
  167. package/dist/src/utils/model-display-env.d.ts +12 -0
  168. package/dist/src/utils/model-display-env.js +53 -0
  169. package/dist/src/utils/model-display-env.js.map +1 -0
  170. package/dist/src/utils/provider-credentials.d.ts +12 -0
  171. package/dist/src/utils/provider-credentials.js +145 -0
  172. package/dist/src/utils/provider-credentials.js.map +1 -0
  173. package/dist/test/advanced-extractors.test.d.ts +1 -0
  174. package/dist/test/advanced-extractors.test.js +96 -0
  175. package/dist/test/advanced-extractors.test.js.map +1 -0
  176. package/dist/test/benchmark.d.ts +1 -0
  177. package/dist/test/benchmark.js +67 -0
  178. package/dist/test/benchmark.js.map +1 -0
  179. package/dist/test/display-sanitize.test.d.ts +1 -0
  180. package/dist/test/display-sanitize.test.js +28 -0
  181. package/dist/test/display-sanitize.test.js.map +1 -0
  182. package/dist/test/extractors.test.d.ts +1 -0
  183. package/dist/test/extractors.test.js +261 -0
  184. package/dist/test/extractors.test.js.map +1 -0
  185. package/dist/test/formatters.test.d.ts +1 -0
  186. package/dist/test/formatters.test.js +62 -0
  187. package/dist/test/formatters.test.js.map +1 -0
  188. package/dist/test/git.test.d.ts +1 -0
  189. package/dist/test/git.test.js +85 -0
  190. package/dist/test/git.test.js.map +1 -0
  191. package/dist/test/migrate-config.test.d.ts +1 -0
  192. package/dist/test/migrate-config.test.js +23 -0
  193. package/dist/test/migrate-config.test.js.map +1 -0
  194. package/dist/test/model-display-env.test.d.ts +1 -0
  195. package/dist/test/model-display-env.test.js +125 -0
  196. package/dist/test/model-display-env.test.js.map +1 -0
  197. package/dist/test/parser.test.d.ts +1 -0
  198. package/dist/test/parser.test.js +108 -0
  199. package/dist/test/parser.test.js.map +1 -0
  200. package/dist/test/provider-credentials.test.d.ts +1 -0
  201. package/dist/test/provider-credentials.test.js +62 -0
  202. package/dist/test/provider-credentials.test.js.map +1 -0
  203. package/dist/test/themes.test.d.ts +1 -0
  204. package/dist/test/themes.test.js +83 -0
  205. package/dist/test/themes.test.js.map +1 -0
  206. package/dist/test/third-party-api.test.d.ts +1 -0
  207. package/dist/test/third-party-api.test.js +99 -0
  208. package/dist/test/third-party-api.test.js.map +1 -0
  209. package/dist/tsconfig.tsbuildinfo +1 -0
  210. package/package.json +43 -0
  211. package/skills/pulse-configuration/SKILL.md +267 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "pulse-line",
3
+ "owner": {
4
+ "name": "knqiufan",
5
+ "email": "knqiufan@gmail.com"
6
+ },
7
+ "metadata": {
8
+ "description": "A highly customizable status bar for Claude Code — 15 modules, 5 themes, i18n (zh/en), third-party API monitoring, and more",
9
+ "version": "1.0.0"
10
+ },
11
+ "plugins": [
12
+ {
13
+ "name": "pulse-line",
14
+ "source": "./",
15
+ "description": "Real-time status bar showing model, context usage, git branch, cache, MCP status, account usage, turns, thinking, and more. Supports 5 themes, i18n (Chinese/English), and third-party API monitoring for Zhipu, DeepSeek, and MiniMax.",
16
+ "category": "monitoring",
17
+ "tags": ["statusline", "status-bar", "monitoring", "pulse-line", "claude-code", "i18n", "themes"]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "pulse-line",
3
+ "version": "1.0.0",
4
+ "description": "A highly customizable status bar plugin for Claude Code with multi-theme support, i18n, and real-time monitoring",
5
+ "author": {
6
+ "name": "knqiufan",
7
+ "url": "https://github.com/knqiufan"
8
+ },
9
+ "homepage": "https://github.com/knqiufan/pulse-line",
10
+ "repository": "https://github.com/knqiufan/pulse-line",
11
+ "license": "MIT",
12
+ "keywords": ["claude-code", "statusline", "status-bar", "monitoring", "productivity", "pulse-line"],
13
+ "commands": [
14
+ "./commands/install.md",
15
+ "./commands/theme.md",
16
+ "./commands/themes.md",
17
+ "./commands/enable.md",
18
+ "./commands/disable.md",
19
+ "./commands/language.md",
20
+ "./commands/config.md",
21
+ "./commands/reload.md",
22
+ "./commands/clear-cache.md",
23
+ "./commands/debug.md",
24
+ "./commands/uninstall.md"
25
+ ],
26
+ "skills": "./skills/"
27
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Pulse Line Team
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 ADDED
@@ -0,0 +1,316 @@
1
+ # Pulse Line
2
+
3
+ **English** | [中文](#中文)
4
+
5
+ A highly customizable status bar plugin for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) with multi-theme support, i18n, and real-time monitoring.
6
+
7
+ ![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)
8
+ ![Node.js >=18](https://img.shields.io/badge/node-%3E%3D18-green.svg)
9
+
10
+ ## Installation
11
+
12
+ ### Plugin Marketplace (recommended)
13
+
14
+ ```
15
+ /plugin marketplace add knqiufan/pulse-line
16
+ /plugin install pulse-line
17
+ ```
18
+
19
+ Then restart Claude Code. Pulse Line will auto-initialize on first run.
20
+
21
+ ### npx (zero install)
22
+
23
+ Set the status bar command in your Claude Code `settings.json`:
24
+
25
+ ```json
26
+ {
27
+ "statusLine": {
28
+ "type": "command",
29
+ "command": "npx -y pulse-line@latest"
30
+ }
31
+ }
32
+ ```
33
+
34
+ No global install needed — `npx` fetches and runs the latest version automatically. For a globally installed version, run `npm install -g pulse-line` and use `"command": "pulse-line"` instead.
35
+
36
+ ## Features
37
+
38
+ - **15 Modules** — Model, Git branch, Context usage, Cache ratio, MCP status, Account usage, Turns, Thinking, and more
39
+ - **5 Built-in Themes** — Dark, Light, Cyberpunk, Forest, Ocean
40
+ - **i18n Support** — English (default) and Chinese, switchable via `/pulse-line:language`
41
+ - **3rd Party API Usage** — Monitor Zhipu (GLM), DeepSeek, MiniMax account balance and quota
42
+ - **Configurable Layout** — Custom module order, 3 segments per row, customizable separators
43
+ - **Slash Commands** — 11 built-in commands for easy management
44
+
45
+ ## Usage
46
+
47
+ All commands are available as slash commands within Claude Code:
48
+
49
+ | Command | Description |
50
+ |---------|-------------|
51
+ | `/pulse-line:install` | Initialize configuration |
52
+ | `/pulse-line:theme <name>` | Switch theme (dark, light, cyberpunk, forest, ocean) |
53
+ | `/pulse-line:themes` | List available themes |
54
+ | `/pulse-line:enable <module>` | Enable a module |
55
+ | `/pulse-line:disable <module>` | Disable a module |
56
+ | `/pulse-line:language <zh\|en>` | Switch display language |
57
+ | `/pulse-line:config` | Open config in editor |
58
+ | `/pulse-line:reload` | Reload configuration |
59
+ | `/pulse-line:clear-cache` | Clear all cached data |
60
+ | `/pulse-line:debug` | Toggle debug mode |
61
+ | `/pulse-line:uninstall` | Remove configuration |
62
+
63
+ CLI commands are also available outside Claude Code:
64
+
65
+ ```bash
66
+ pulse-line enable thinking # Enable a module
67
+ pulse-line disable cost # Disable a module
68
+ pulse-line theme cyberpunk # Switch theme
69
+ pulse-line language zh # Switch to Chinese
70
+ pulse-line clear-cache # Clear cache
71
+ ```
72
+
73
+ ## Modules
74
+
75
+ | Module | ID | Default | Description |
76
+ |--------|----|---------|-------------|
77
+ | Model | `model` | On | Current AI model name |
78
+ | Git Branch | `git` | On | Branch name and ahead/behind count |
79
+ | Workspace | `workspace` | On | Current project name |
80
+ | Context Usage | `context` | On | Context window usage with progress bar |
81
+ | Cache | `cacheRatio` | On | Cached token count (K/M format) |
82
+ | MCP | `mcpStatus` | On | Number of active MCP servers |
83
+ | Account | `accountUsage` | On | 3rd-party API quota and balance |
84
+ | Turns | `turns` | On | Conversation turn count |
85
+ | Thinking | `thinking` | On | Extended thinking status |
86
+ | Cost | `cost` | Off | Session cost in USD |
87
+ | Duration | `duration` | Off | Session duration |
88
+ | Rate Limits | `rateLimits` | Off | Anthropic API rate limit (5h window) |
89
+ | Weekly Quota | `weeklyQuota` | Off | Anthropic API weekly quota |
90
+ | Output Style | `outputStyle` | Off | Current output style |
91
+ | Third-party API | `thirdPartyApi` | Off | Async API provider query |
92
+
93
+ ## 3rd Party Account Usage
94
+
95
+ Pulse Line can monitor account balance and quota for third-party API providers:
96
+
97
+ | Provider | Env Variables | Display |
98
+ |----------|---------------|---------|
99
+ | Zhipu (GLM) | `ZHIPU_API_KEY`, `ZHIPU_BASE_URL` | Usage % with countdown |
100
+ | DeepSeek | `DEEPSEEK_API_KEY` | Balance in CNY |
101
+ | MiniMax | `MINIMAX_API_KEY`, `MINIMAX_GROUP_ID` | Usage % with countdown |
102
+
103
+ Providers are auto-detected from your Claude Code settings. You can also configure manually:
104
+
105
+ ```bash
106
+ pulse-line config # Edit providers array in accountUsage module
107
+ ```
108
+
109
+ > [!NOTE]
110
+ > Account usage data is obtained from third-party provider APIs. If the provider does not expose this information via its API, it cannot be displayed. Data shown is for reference only — always refer to the provider's official dashboard for accurate figures.
111
+
112
+ ## Configuration
113
+
114
+ Config file: `~/.claude/pulse/config.json`
115
+
116
+ ```json
117
+ {
118
+ "theme": "dark",
119
+ "language": "en",
120
+ "iconSet": "text",
121
+ "separator": " │ ",
122
+ "padding": 1,
123
+ "modules": {
124
+ "model": { "enabled": true, "order": 1, "icon": "[Model]" },
125
+ "git": { "enabled": true, "order": 2, "icon": "[Git]" },
126
+ "workspace": { "enabled": true, "order": 3, "icon": "[Workspace]" },
127
+ "context": { "enabled": true, "order": 4, "barWidth": 12 }
128
+ },
129
+ "advanced": {
130
+ "debugMode": false,
131
+ "cacheEnabled": true,
132
+ "cacheTTL": 300
133
+ }
134
+ }
135
+ ```
136
+
137
+ ## Local Development
138
+
139
+ ```bash
140
+ git clone https://github.com/knqiufan/pulse-line.git
141
+ cd pulse-line
142
+ npm install
143
+ npm run build
144
+ npm link
145
+
146
+ # Load as local plugin in Claude Code
147
+ claude --plugin-dir /path/to/pulse-line
148
+ ```
149
+
150
+ ## Requirements
151
+
152
+ - Node.js >= 18.0.0
153
+ - Claude Code CLI
154
+
155
+ ## License
156
+
157
+ [MIT](LICENSE)
158
+
159
+ ---
160
+
161
+ <a id="中文"></a>
162
+
163
+ # 中文
164
+
165
+ **[English](#pulse-line)** | 中文
166
+
167
+ 一个高度可定制的 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 状态栏插件,支持多主题、国际化和实时监控。
168
+
169
+ ## 安装
170
+
171
+ ### Plugin Marketplace(推荐)
172
+
173
+ ```
174
+ /plugin marketplace add knqiufan/pulse-line
175
+ /plugin install pulse-line
176
+ ```
177
+
178
+ 重启 Claude Code 即可,首次运行 Pulse Line 会自动初始化配置。
179
+
180
+ ### npx(零安装)
181
+
182
+ 在 Claude Code 的 `settings.json` 中设置状态栏命令:
183
+
184
+ ```json
185
+ {
186
+ "statusLine": {
187
+ "type": "command",
188
+ "command": "npx -y pulse-line@latest"
189
+ }
190
+ }
191
+ ```
192
+
193
+ 无需全局安装 —— `npx` 每次自动拉取最新版执行。如果想全局安装,运行 `npm install -g pulse-line`,然后将 command 设为 `"pulse-line"` 即可。
194
+
195
+ ## 功能特性
196
+
197
+ - **15 个模块** — 当前模型、Git 分支、上下文使用率、缓存、MCP 状态、账户用量、轮次、思考模式等
198
+ - **5 个内置主题** — Dark、Light、Cyberpunk、Forest、Ocean
199
+ - **国际化支持** — 默认英文,中文可通过 `/pulse-line:language zh` 切换
200
+ - **第三方 API 用量** — 监控智谱 (GLM)、DeepSeek、MiniMax 账户余额和配额
201
+ - **可配置布局** — 自定义模块顺序,每行 3 个指标,可自定义分隔符
202
+ - **斜杠命令** — 11 个内置命令,方便管理
203
+
204
+ ## 使用方法
205
+
206
+ 所有命令均可在 Claude Code 中通过斜杠命令使用:
207
+
208
+ | 命令 | 说明 |
209
+ |------|------|
210
+ | `/pulse-line:install` | 初始化配置 |
211
+ | `/pulse-line:theme <name>` | 切换主题 (dark, light, cyberpunk, forest, ocean) |
212
+ | `/pulse-line:themes` | 列出可用主题 |
213
+ | `/pulse-line:enable <module>` | 启用模块 |
214
+ | `/pulse-line:disable <module>` | 禁用模块 |
215
+ | `/pulse-line:language <zh\|en>` | 切换显示语言 |
216
+ | `/pulse-line:config` | 在编辑器中打开配置 |
217
+ | `/pulse-line:reload` | 重新加载配置 |
218
+ | `/pulse-line:clear-cache` | 清除所有缓存数据 |
219
+ | `/pulse-line:debug` | 切换调试模式 |
220
+ | `/pulse-line:uninstall` | 移除配置 |
221
+
222
+ 也可以在 Claude Code 外使用 CLI 命令:
223
+
224
+ ```bash
225
+ pulse-line enable thinking # 启用模块
226
+ pulse-line disable cost # 禁用模块
227
+ pulse-line theme cyberpunk # 切换主题
228
+ pulse-line language zh # 切换为中文
229
+ pulse-line clear-cache # 清除缓存
230
+ ```
231
+
232
+ ## 模块列表
233
+
234
+ | 模块 | ID | 默认 | 说明 |
235
+ |------|----|------|------|
236
+ | 当前模型 | `model` | 开启 | 当前 AI 模型名称 |
237
+ | Git 分支 | `git` | 开启 | 分支名及领先/落后数 |
238
+ | 工作区 | `workspace` | 开启 | 当前项目名 |
239
+ | 上下文使用率 | `context` | 开启 | 上下文窗口使用率(含进度条) |
240
+ | 缓存 | `cacheRatio` | 开启 | 缓存 token 数量(K/M 格式) |
241
+ | MCP | `mcpStatus` | 开启 | 活跃 MCP 服务器数量 |
242
+ | 账户 | `accountUsage` | 开启 | 第三方 API 配额和余额 |
243
+ | 轮次 | `turns` | 开启 | 对话轮次 |
244
+ | 思考 | `thinking` | 开启 | 扩展思考模式状态 |
245
+ | 费用 | `cost` | 关闭 | 会话费用(美元) |
246
+ | 时长 | `duration` | 关闭 | 会话持续时间 |
247
+ | 限速 | `rateLimits` | 关闭 | Anthropic API 限速(5 小时窗口) |
248
+ | 配额 | `weeklyQuota` | 关闭 | Anthropic API 周配额 |
249
+ | 风格 | `outputStyle` | 关闭 | 当前输出风格 |
250
+ | 第三方 API | `thirdPartyApi` | 关闭 | 异步 API 供应商查询 |
251
+
252
+ ## 第三方账户用量
253
+
254
+ Pulse Line 可以监控第三方 API 供应商的账户余额和配额:
255
+
256
+ | 供应商 | 环境变量 | 显示内容 |
257
+ |--------|----------|----------|
258
+ | 智谱 (GLM) | `ZHIPU_API_KEY`、`ZHIPU_BASE_URL` | 使用率百分比及倒计时 |
259
+ | DeepSeek | `DEEPSEEK_API_KEY` | 余额(人民币) |
260
+ | MiniMax | `MINIMAX_API_KEY`、`MINIMAX_GROUP_ID` | 使用率百分比及倒计时 |
261
+
262
+ 供应商会从 Claude Code 设置中自动检测,也可手动配置:
263
+
264
+ ```bash
265
+ pulse-line config # 编辑 accountUsage 模块的 providers 数组
266
+ ```
267
+
268
+ > [!NOTE]
269
+ > 账户用量数据来源于第三方供应商 API,若官方未提供相关接口则无法显示。显示数据仅供参考,请以供应商官方后台为准。
270
+
271
+ ## 配置
272
+
273
+ 配置文件:`~/.claude/pulse/config.json`
274
+
275
+ ```json
276
+ {
277
+ "theme": "dark",
278
+ "language": "en",
279
+ "iconSet": "text",
280
+ "separator": " │ ",
281
+ "padding": 1,
282
+ "modules": {
283
+ "model": { "enabled": true, "order": 1, "icon": "[Model]" },
284
+ "git": { "enabled": true, "order": 2, "icon": "[Git]" },
285
+ "workspace": { "enabled": true, "order": 3, "icon": "[Workspace]" },
286
+ "context": { "enabled": true, "order": 4, "barWidth": 12 }
287
+ },
288
+ "advanced": {
289
+ "debugMode": false,
290
+ "cacheEnabled": true,
291
+ "cacheTTL": 300
292
+ }
293
+ }
294
+ ```
295
+
296
+ ## 本地开发
297
+
298
+ ```bash
299
+ git clone https://github.com/knqiufan/pulse-line.git
300
+ cd pulse-line
301
+ npm install
302
+ npm run build
303
+ npm link
304
+
305
+ # 在 Claude Code 中作为本地插件加载
306
+ claude --plugin-dir /path/to/pulse-line
307
+ ```
308
+
309
+ ## 系统要求
310
+
311
+ - Node.js >= 18.0.0
312
+ - Claude Code CLI
313
+
314
+ ## 许可证
315
+
316
+ [MIT](LICENSE)
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ // Route to CLI if arguments present, otherwise render pulse
3
+
4
+ const args = process.argv.slice(2);
5
+
6
+ if (args.length === 0 && !process.stdin.isTTY) {
7
+ // No arguments and stdin provided -> render pulse
8
+ require('../dist/src/index.js');
9
+ } else {
10
+ // Has arguments -> CLI mode
11
+ require('../dist/src/cli.js');
12
+ }
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Clear all pulse cache files
3
+ ---
4
+
5
+ # Clear Cache
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:clear-cache
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Clear all cached data for the pulse status bar, including API query results and session data. Useful when data appears stale or after configuration changes that don't seem to take effect.
16
+
17
+ ## Instructions
18
+
19
+ Run the following shell command:
20
+
21
+ ```bash
22
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" clear-cache
23
+ ```
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Edit node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" configuration in editor
3
+ ---
4
+
5
+ # Edit Configuration
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:config
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Opens `~/.claude/pulse/config.json` in your editor. Changes take effect on save.
16
+
17
+ ## Instructions
18
+
19
+ Run the following shell command:
20
+
21
+ ```bash
22
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" config
23
+ ```
24
+
25
+ The config file will open in the user's default editor. After saving, the new config takes effect immediately.
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Toggle debug mode on or off
3
+ ---
4
+
5
+ # Toggle Debug Mode
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:debug <on|off>
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Enable or disable debug mode. When enabled, verbose logs are written to stderr (requires `PULSE_DEBUG=1` env var).
16
+
17
+ ## Instructions
18
+
19
+ Run the following shell command with the mode provided by the user:
20
+
21
+ ```bash
22
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" debug <on|off>
23
+ ```
24
+
25
+ If the user did not specify `on` or `off`, ask which mode they want.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Disable a status bar module
3
+ ---
4
+
5
+ # Disable Module
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:disable <module>
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Disable a status bar module. Changes take effect immediately on the next status bar render.
16
+
17
+ Available module IDs: `model`, `context`, `git`, `accountUsage`, `cost`, `duration`, `workspace`, `turns`, `cacheRatio`, `rateLimits`, `weeklyQuota`, `mcpStatus`, `thinking`, `outputStyle`, `thirdPartyApi`.
18
+
19
+ ## Instructions
20
+
21
+ Run the following shell command with the module name provided by the user:
22
+
23
+ ```bash
24
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" disable <module>
25
+ ```
26
+
27
+ If the user did not provide a module name, list the available modules and ask which one they want to disable.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Enable a status bar module
3
+ ---
4
+
5
+ # Enable Module
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:enable <module>
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Enable a status bar module. Changes take effect immediately on the next status bar render.
16
+
17
+ Available module IDs: `model`, `context`, `git`, `accountUsage`, `cost`, `duration`, `workspace`, `turns`, `cacheRatio`, `rateLimits`, `weeklyQuota`, `mcpStatus`, `thinking`, `outputStyle`, `thirdPartyApi`.
18
+
19
+ ## Instructions
20
+
21
+ Run the following shell command with the module name provided by the user:
22
+
23
+ ```bash
24
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" enable <module>
25
+ ```
26
+
27
+ If the user did not provide a module name, list the available modules and ask which one they want to enable.
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Install pulse-line to Claude Code user settings
3
+ ---
4
+
5
+ # Install Pulse Line
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:install
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Initialize pulse-line in your Claude Code user settings. After installation, restart Claude Code to see the status bar.
16
+
17
+ ## Instructions
18
+
19
+ Run the following shell command:
20
+
21
+ ```bash
22
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" install
23
+ ```
24
+
25
+ Then tell the user to restart Claude Code for the status bar to take effect.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Switch display language (zh, en)
3
+ ---
4
+
5
+ # Switch Language
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:language <lang>
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Switch the display language of the status bar labels. Available languages: `zh` (Chinese, default), `en` (English).
16
+
17
+ Changes take effect immediately on the next status bar render.
18
+
19
+ ## Instructions
20
+
21
+ Run the following shell command with the language code provided by the user:
22
+
23
+ ```bash
24
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" language <lang>
25
+ ```
26
+
27
+ If the user did not provide a language, ask which one they want: `zh` (Chinese) or `en` (English).
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Reload pulse-line configuration
3
+ ---
4
+
5
+ # Reload Configuration
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:reload
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Reload the configuration file manually. Useful when you've edited `~/.claude/pulse/config.json` directly.
16
+
17
+ ## Instructions
18
+
19
+ Run the following shell command:
20
+
21
+ ```bash
22
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" reload
23
+ ```
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Switch status bar theme (dark, light, cyberpunk, forest, ocean)
3
+ ---
4
+
5
+ # Switch Theme
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:theme <name>
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Switch the visual theme of the status bar. Available themes: `dark`, `light`, `cyberpunk`, `forest`, `ocean`.
16
+
17
+ Changes take effect immediately on the next status bar render.
18
+
19
+ ## Instructions
20
+
21
+ Run the following shell command with the theme name provided by the user:
22
+
23
+ ```bash
24
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" theme <name>
25
+ ```
26
+
27
+ If the user did not provide a theme name, ask which theme they want to switch to.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: List all available status bar themes
3
+ ---
4
+
5
+ # List All Themes
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:themes
11
+ ```
12
+
13
+ ## Description
14
+
15
+ List all available themes for the status bar.
16
+
17
+ ## Instructions
18
+
19
+ Run the following shell command:
20
+
21
+ ```bash
22
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" themes
23
+ ```
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Uninstall pulse-line from Claude Code
3
+ ---
4
+
5
+ # Uninstall Pulse Line
6
+
7
+ ## Command
8
+
9
+ ```
10
+ /pulse-line:uninstall
11
+ ```
12
+
13
+ ## Description
14
+
15
+ Uninstall pulse-line. Configuration files are preserved — delete `~/.claude/pulse/` manually to remove everything.
16
+
17
+ ## Instructions
18
+
19
+ Run the following shell command:
20
+
21
+ ```bash
22
+ node "${CLAUDE_PLUGIN_ROOT}/bin/pulse-line.js" uninstall
23
+ ```
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};