npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pulse-line

v1.0.6

Published

Customizable status bar for Claude Code

Readme

Pulse Line

一个高度可定制的 Claude Code 状态栏插件

支持多主题、国际化和实时监控

MIT License Node.js npm

中文 | English


特性

  • 17 个模块 — 当前模型、Git 分支、上下文使用率、缓存、MCP 状态、账户用量、轮次、思考模式、规则统计、工具分析等
  • 5 个内置主题 — Dark、Light、Cyberpunk、Forest、Ocean
  • 国际化支持 — 中/英文切换
  • 第三方 API 监控 — 智谱 (GLM)、DeepSeek、MiniMax 账户余额和配额
  • 自适应布局 — 自定义模块顺序,按终端宽度自动换行,可配置每行模块数上限和分隔符
  • 13 个斜杠命令 — 在 Claude Code 中直接管理

快速开始

方式一:Plugin Marketplace(推荐)

在 Claude Code 中执行:

/plugin marketplace add knqiufan/pulse-line
/plugin install pulse-line

安装完成后,重启 Claude Code,插件会在下次会话启动时自动配置状态栏。

方式二:一键命令安装

npx -y pulse-line@latest install

这条命令会自动完成所有配置,执行后重启 Claude Code 即可。

注意:此方式会自动尝试注册插件。如果你还需要 /pulse-line:* 斜杠命令,请在 Claude Code 中额外执行:

/plugin marketplace add knqiufan/pulse-line
/plugin install pulse-line

方式三:全局安装

npm install -g pulse-line
pulse-line install

提示:也可以直接让 Claude Code 帮你安装——在对话中告诉它"帮我安装 pulse-line 状态栏",它会自动完成配置。

命令一览

斜杠命令(Claude Code 内使用)

| 命令 | 说明 | |------|------| | /pulse-line:install | 初始化配置 | | /pulse-line:theme <name> | 切换主题 | | /pulse-line:themes | 列出可用主题 | | /pulse-line:enable <module> | 启用模块 | | /pulse-line:disable <module> | 禁用模块 | | /pulse-line:language <zh\|en> | 切换显示语言 | | /pulse-line:config | 在编辑器中打开配置 | | /pulse-line:reload | 重新加载配置 | | /pulse-line:clear-cache | 清除缓存 | | /pulse-line:timeline | 调试/导出已采集的工具分析数据 | | /pulse-line:rules | 查看/管理项目规则文件 | | /pulse-line:debug | 切换调试模式 | | /pulse-line:uninstall | 卸载配置 |

CLI 命令(终端中使用)

pulse-line theme cyberpunk     # 切换主题
pulse-line language zh         # 切换为中文
pulse-line enable thinking     # 启用模块
pulse-line disable cost        # 禁用模块
pulse-line clear-cache         # 清除缓存
pulse-line timeline --last 20  # 查看最近工具调用
pulse-line rules list          # 列出项目规则文件
pulse-line rules pattern add "docs/**/*.md"  # 添加包含模式

模块列表

| 模块 | ID | 默认状态 | 说明 | |------|----|----------|------| | 当前模型 | model | ✅ 开启 | 当前 AI 模型名称 | | Git 分支 | git | ✅ 开启 | 分支名及领先/落后数 | | 工作区 | workspace | ✅ 开启 | 当前项目名 | | 上下文使用率 | context | ✅ 开启 | 上下文窗口使用率(含进度条) | | 缓存 | cacheRatio | ✅ 开启 | 缓存 token 数量(K/M 格式) | | MCP | mcpStatus | ✅ 开启 | 活跃 MCP 服务器数量 | | 账户用量 | accountUsage | ✅ 开启 | 第三方 API 配额和余额 | | 轮次 | turns | ✅ 开启 | 对话轮次 | | 思考模式 | thinking | ✅ 开启 | 扩展思考状态 | | 费用 | cost | ❌ 关闭 | 会话费用(美元) | | 时长 | duration | ❌ 关闭 | 会话持续时间 | | 限速 | rateLimits | ❌ 关闭 | Anthropic API 限速(5h 窗口) | | 配额 | weeklyQuota | ❌ 关闭 | Anthropic API 周配额 | | 输出风格 | outputStyle | ❌ 关闭 | 当前输出风格 | | 第三方 API | thirdPartyApi | ❌ 关闭 | 异步 API 供应商查询 | | 规则 | rules | ✅ 开启 | 项目规则/Skill 文件数量统计,显示规则与 Skill 明细 | | 工具分析 | toolTimeline | ❌ 关闭 | 独立工具调用统计分析面板,包含最近调用 |

配置

配置文件位于 ~/.claude/pulse/config.json,可通过 pulse-line config 打开编辑。

{
  "theme": "dark",
  "language": "zh",
  "iconSet": "text",
  "separator": " │ ",
  "padding": 1,
  "maxPerLine": 5,
  "modules": {
    "model": { "enabled": true, "order": 1, "icon": "[当前模型]" },
    "git": { "enabled": true, "order": 2, "icon": "[Git 分支]" },
    "workspace": { "enabled": true, "order": 3, "icon": "[工作区]" },
    "context": { "enabled": true, "order": 4, "showBar": true, "barWidth": 12 },
    "rules": {
      "enabled": true,
      "order": 16,
      "icon": "[规则]",
      "includePatterns": [],
      "excludePatterns": []
    },
    "toolTimeline": {
      "enabled": false,
      "order": 17,
      "icon": "[工具]",
      "displayMode": "analytics-panel",
      "maxEvents": 100,
      "maxDisplayEvents": 5,
      "panelWidth": 59
    }
  },
  "advanced": {
    "debugMode": false,
    "cacheEnabled": true,
    "cacheTTL": 300
  }
}

配置说明

| 字段 | 类型 | 说明 | |------|------|------| | theme | string | 主题名称 | | language | "zh" | "en" | 显示语言 | | separator | string | 模块间的分隔符 | | padding | number (0-10) | 分隔符两侧的空格数 | | maxPerLine | number (1-20) | 每行模块数上限,实际显示数量会按终端宽度自动调整 | | iconSet | "text" | "nerd" | 图标模式,text 为 ASCII 安全字符 |

自适应布局

Pulse Line 会在 Windows、macOS 和 Linux 上探测终端宽度,并在 Claude Code 截断状态栏之前自动把指标项换到下一行。maxPerLine 仍然作为每行模块数上限,实际每行显示几个模块会根据当前终端宽度动态调整。工具分析面板也会跟随终端宽度收窄显示。

工具分析

安装插件后,Pulse Line 会通过 Claude Code 的 PostToolUse / PostToolUseFailure / SubagentStop hook 记录工具调用摘要和子 agent 元数据到本地缓存,不上传任何遥测数据。启用 toolTimeline 后,主视图会在普通状态栏下方显示独立的工具分析面板,展示总工具调用数、当前 context token、主 agent / 子 agent 工具数、子 agent 名称、最耗时工具和最近 5 条调用。

timeline 命令保留为调试和导出入口,不再作为主要查看方式:

pulse-line enable toolTimeline
pulse-line timeline
pulse-line timeline --last 10
pulse-line timeline --json
pulse-line timeline clear

第三方 API 监控

Pulse Line 支持监控第三方 API 供应商的账户余额和配额:

| 供应商 | 环境变量 | 显示内容 | |--------|----------|----------| | 智谱 (GLM) | ZHIPU_API_KEYZHIPU_BASE_URL | 使用率 % 及倒计时 | | DeepSeek | DEEPSEEK_API_KEY | 余额(CNY) | | MiniMax | MINIMAX_API_KEYMINIMAX_GROUP_ID | 使用率 % 及倒计时 |

供应商会从 Claude Code 设置中自动检测,也可手动配置 accountUsage.providers 数组。

注意:账户用量数据来源于第三方供应商 API,若官方未提供相关接口则无法显示。显示数据仅供参考,请以供应商官方后台为准。

主题预览

| 主题 | 风格描述 | |------|----------| | dark | 蓝绿色系,专业沉稳 | | light | 明亮清爽,适合浅色终端 | | cyberpunk | 霓虹高对比,赛博朋克风 | | forest | 自然绿色系,大地色调 | | ocean | 深蓝色系,海洋质感 |

本地开发

git clone https://github.com/knqiufan/pulse-line.git
cd pulse-line
npm install
npm run build
npm link

# 在 Claude Code 中作为本地插件加载
claude --plugin-dir /path/to/pulse-line

系统要求

  • Node.js >= 18.0.0
  • Claude Code CLI

常见问题

  1. 确认 ~/.claude/settings.json 中包含 statusLine 字段
  2. 执行 npx -y pulse-line@latest install 重新配置
  3. 重启 Claude Code
  1. 确保 config.jsoniconSet"text"(默认值)
  2. 如果使用了 Nerd Font,可设为 "nerd"
  3. 执行 pulse-line reload 应用变更
  1. 执行 pulse-line reload
  2. 或重启 Claude Code

贡献

欢迎提交 Issue 和 Pull Request!

许可证

MIT