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.
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +27 -0
- package/LICENSE +21 -0
- package/README.md +316 -0
- package/bin/pulse-line.js +12 -0
- package/commands/clear-cache.md +23 -0
- package/commands/config.md +25 -0
- package/commands/debug.md +25 -0
- package/commands/disable.md +27 -0
- package/commands/enable.md +27 -0
- package/commands/install.md +25 -0
- package/commands/language.md +27 -0
- package/commands/reload.md +23 -0
- package/commands/theme.md +27 -0
- package/commands/themes.md +23 -0
- package/commands/uninstall.md +23 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +242 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/config/defaults.d.ts +2 -0
- package/dist/src/config/defaults.js +7 -0
- package/dist/src/config/defaults.js.map +1 -0
- package/dist/src/config/loader.d.ts +6 -0
- package/dist/src/config/loader.js +146 -0
- package/dist/src/config/loader.js.map +1 -0
- package/dist/src/config/migrate-config.d.ts +2 -0
- package/dist/src/config/migrate-config.js +22 -0
- package/dist/src/config/migrate-config.js.map +1 -0
- package/dist/src/config/validator.d.ts +2 -0
- package/dist/src/config/validator.js +7 -0
- package/dist/src/config/validator.js.map +1 -0
- package/dist/src/extractors/account-usage.d.ts +20 -0
- package/dist/src/extractors/account-usage.js +293 -0
- package/dist/src/extractors/account-usage.js.map +1 -0
- package/dist/src/extractors/context.d.ts +7 -0
- package/dist/src/extractors/context.js +20 -0
- package/dist/src/extractors/context.js.map +1 -0
- package/dist/src/extractors/cost.d.ts +5 -0
- package/dist/src/extractors/cost.js +13 -0
- package/dist/src/extractors/cost.js.map +1 -0
- package/dist/src/extractors/git.d.ts +6 -0
- package/dist/src/extractors/git.js +35 -0
- package/dist/src/extractors/git.js.map +1 -0
- package/dist/src/extractors/index.d.ts +25 -0
- package/dist/src/extractors/index.js +33 -0
- package/dist/src/extractors/index.js.map +1 -0
- package/dist/src/extractors/mcp.d.ts +5 -0
- package/dist/src/extractors/mcp.js +72 -0
- package/dist/src/extractors/mcp.js.map +1 -0
- package/dist/src/extractors/model.d.ts +9 -0
- package/dist/src/extractors/model.js +20 -0
- package/dist/src/extractors/model.js.map +1 -0
- package/dist/src/extractors/output-style.d.ts +9 -0
- package/dist/src/extractors/output-style.js +13 -0
- package/dist/src/extractors/output-style.js.map +1 -0
- package/dist/src/extractors/rate-limits.d.ts +8 -0
- package/dist/src/extractors/rate-limits.js +39 -0
- package/dist/src/extractors/rate-limits.js.map +1 -0
- package/dist/src/extractors/session.d.ts +5 -0
- package/dist/src/extractors/session.js +67 -0
- package/dist/src/extractors/session.js.map +1 -0
- package/dist/src/extractors/thinking.d.ts +10 -0
- package/dist/src/extractors/thinking.js +16 -0
- package/dist/src/extractors/thinking.js.map +1 -0
- package/dist/src/extractors/third-party-api.d.ts +13 -0
- package/dist/src/extractors/third-party-api.js +193 -0
- package/dist/src/extractors/third-party-api.js.map +1 -0
- package/dist/src/extractors/transcript.d.ts +5 -0
- package/dist/src/extractors/transcript.js +67 -0
- package/dist/src/extractors/transcript.js.map +1 -0
- package/dist/src/extractors/workspace.d.ts +9 -0
- package/dist/src/extractors/workspace.js +43 -0
- package/dist/src/extractors/workspace.js.map +1 -0
- package/dist/src/formatters/duration.d.ts +1 -0
- package/dist/src/formatters/duration.js +19 -0
- package/dist/src/formatters/duration.js.map +1 -0
- package/dist/src/formatters/index.d.ts +7 -0
- package/dist/src/formatters/index.js +16 -0
- package/dist/src/formatters/index.js.map +1 -0
- package/dist/src/formatters/layout.d.ts +10 -0
- package/dist/src/formatters/layout.js +38 -0
- package/dist/src/formatters/layout.js.map +1 -0
- package/dist/src/formatters/progress-bar.d.ts +2 -0
- package/dist/src/formatters/progress-bar.js +23 -0
- package/dist/src/formatters/progress-bar.js.map +1 -0
- package/dist/src/formatters/segment.d.ts +9 -0
- package/dist/src/formatters/segment.js +18 -0
- package/dist/src/formatters/segment.js.map +1 -0
- package/dist/src/formatters/separator.d.ts +1 -0
- package/dist/src/formatters/separator.js +11 -0
- package/dist/src/formatters/separator.js.map +1 -0
- package/dist/src/i18n/index.d.ts +8 -0
- package/dist/src/i18n/index.js +31 -0
- package/dist/src/i18n/index.js.map +1 -0
- package/dist/src/i18n/locales/en.d.ts +1 -0
- package/dist/src/i18n/locales/en.js +26 -0
- package/dist/src/i18n/locales/en.js.map +1 -0
- package/dist/src/i18n/locales/zh.d.ts +1 -0
- package/dist/src/i18n/locales/zh.js +26 -0
- package/dist/src/i18n/locales/zh.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +176 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/parser/stdin-parser.d.ts +3 -0
- package/dist/src/parser/stdin-parser.js +58 -0
- package/dist/src/parser/stdin-parser.js.map +1 -0
- package/dist/src/themes/builtin/cyberpunk.d.ts +2 -0
- package/dist/src/themes/builtin/cyberpunk.js +47 -0
- package/dist/src/themes/builtin/cyberpunk.js.map +1 -0
- package/dist/src/themes/builtin/dark.d.ts +2 -0
- package/dist/src/themes/builtin/dark.js +47 -0
- package/dist/src/themes/builtin/dark.js.map +1 -0
- package/dist/src/themes/builtin/forest.d.ts +2 -0
- package/dist/src/themes/builtin/forest.js +47 -0
- package/dist/src/themes/builtin/forest.js.map +1 -0
- package/dist/src/themes/builtin/light.d.ts +2 -0
- package/dist/src/themes/builtin/light.js +47 -0
- package/dist/src/themes/builtin/light.js.map +1 -0
- package/dist/src/themes/builtin/ocean.d.ts +2 -0
- package/dist/src/themes/builtin/ocean.js +47 -0
- package/dist/src/themes/builtin/ocean.js.map +1 -0
- package/dist/src/themes/icon-provider.d.ts +2 -0
- package/dist/src/themes/icon-provider.js +10 -0
- package/dist/src/themes/icon-provider.js.map +1 -0
- package/dist/src/themes/icon-sets/nerd.d.ts +17 -0
- package/dist/src/themes/icon-sets/nerd.js +20 -0
- package/dist/src/themes/icon-sets/nerd.js.map +1 -0
- package/dist/src/themes/icon-sets/text.d.ts +17 -0
- package/dist/src/themes/icon-sets/text.js +21 -0
- package/dist/src/themes/icon-sets/text.js.map +1 -0
- package/dist/src/themes/index.d.ts +4 -0
- package/dist/src/themes/index.js +56 -0
- package/dist/src/themes/index.js.map +1 -0
- package/dist/src/types/pulse-config.d.ts +58 -0
- package/dist/src/types/pulse-config.js +50 -0
- package/dist/src/types/pulse-config.js.map +1 -0
- package/dist/src/types/pulse-input.d.ts +83 -0
- package/dist/src/types/pulse-input.js +4 -0
- package/dist/src/types/pulse-input.js.map +1 -0
- package/dist/src/types/theme.d.ts +50 -0
- package/dist/src/types/theme.js +4 -0
- package/dist/src/types/theme.js.map +1 -0
- package/dist/src/utils/ansi.d.ts +6 -0
- package/dist/src/utils/ansi.js +31 -0
- package/dist/src/utils/ansi.js.map +1 -0
- package/dist/src/utils/cache.d.ts +11 -0
- package/dist/src/utils/cache.js +128 -0
- package/dist/src/utils/cache.js.map +1 -0
- package/dist/src/utils/claude-settings-env.d.ts +11 -0
- package/dist/src/utils/claude-settings-env.js +108 -0
- package/dist/src/utils/claude-settings-env.js.map +1 -0
- package/dist/src/utils/constants.d.ts +3 -0
- package/dist/src/utils/constants.js +43 -0
- package/dist/src/utils/constants.js.map +1 -0
- package/dist/src/utils/display-sanitize.d.ts +7 -0
- package/dist/src/utils/display-sanitize.js +69 -0
- package/dist/src/utils/display-sanitize.js.map +1 -0
- package/dist/src/utils/fs.d.ts +5 -0
- package/dist/src/utils/fs.js +79 -0
- package/dist/src/utils/fs.js.map +1 -0
- package/dist/src/utils/git.d.ts +7 -0
- package/dist/src/utils/git.js +56 -0
- package/dist/src/utils/git.js.map +1 -0
- package/dist/src/utils/logger.d.ts +9 -0
- package/dist/src/utils/logger.js +53 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/model-display-env.d.ts +12 -0
- package/dist/src/utils/model-display-env.js +53 -0
- package/dist/src/utils/model-display-env.js.map +1 -0
- package/dist/src/utils/provider-credentials.d.ts +12 -0
- package/dist/src/utils/provider-credentials.js +145 -0
- package/dist/src/utils/provider-credentials.js.map +1 -0
- package/dist/test/advanced-extractors.test.d.ts +1 -0
- package/dist/test/advanced-extractors.test.js +96 -0
- package/dist/test/advanced-extractors.test.js.map +1 -0
- package/dist/test/benchmark.d.ts +1 -0
- package/dist/test/benchmark.js +67 -0
- package/dist/test/benchmark.js.map +1 -0
- package/dist/test/display-sanitize.test.d.ts +1 -0
- package/dist/test/display-sanitize.test.js +28 -0
- package/dist/test/display-sanitize.test.js.map +1 -0
- package/dist/test/extractors.test.d.ts +1 -0
- package/dist/test/extractors.test.js +261 -0
- package/dist/test/extractors.test.js.map +1 -0
- package/dist/test/formatters.test.d.ts +1 -0
- package/dist/test/formatters.test.js +62 -0
- package/dist/test/formatters.test.js.map +1 -0
- package/dist/test/git.test.d.ts +1 -0
- package/dist/test/git.test.js +85 -0
- package/dist/test/git.test.js.map +1 -0
- package/dist/test/migrate-config.test.d.ts +1 -0
- package/dist/test/migrate-config.test.js +23 -0
- package/dist/test/migrate-config.test.js.map +1 -0
- package/dist/test/model-display-env.test.d.ts +1 -0
- package/dist/test/model-display-env.test.js +125 -0
- package/dist/test/model-display-env.test.js.map +1 -0
- package/dist/test/parser.test.d.ts +1 -0
- package/dist/test/parser.test.js +108 -0
- package/dist/test/parser.test.js.map +1 -0
- package/dist/test/provider-credentials.test.d.ts +1 -0
- package/dist/test/provider-credentials.test.js +62 -0
- package/dist/test/provider-credentials.test.js.map +1 -0
- package/dist/test/themes.test.d.ts +1 -0
- package/dist/test/themes.test.js +83 -0
- package/dist/test/themes.test.js.map +1 -0
- package/dist/test/third-party-api.test.d.ts +1 -0
- package/dist/test/third-party-api.test.js +99 -0
- package/dist/test/third-party-api.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +43 -0
- 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
|
+

|
|
8
|
+

|
|
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
|
+
```
|