Title: feat(cli): 添加可插拔状态栏 (statusline) by dengmik-commits · Pull Request #193 · lessweb/deepcode-cli · GitHub
Open Graph Title: feat(cli): 添加可插拔状态栏 (statusline) by dengmik-commits · Pull Request #193 · lessweb/deepcode-cli
X Title: feat(cli): 添加可插拔状态栏 (statusline) by dengmik-commits · Pull Request #193 · lessweb/deepcode-cli
Description: feat(cli): 可插拔状态栏 (statusline)
概述
为 Deep Code CLI 增加 可插拔状态栏:在输入框下方渲染一行由用户配置的 segment(git 分支、模型信息、token/会话统计、工具调用次数等),通过 settings.json 的 statusline 字段声明,无需改动 CLI 源码即可扩展。
灵感来自 Claude Code 的 statusline 机制,但实现完全本地化、零外部依赖。
动机
CLI 长会话中常需要随时观察的上下文(当前模型/思考强度、cwd、git 分支、已用 token、context 占用百分比、工具调用分布……)目前散落在各处或需要中断会话去查。提供一个由用户自由组合的状态栏后:
模型/思考模式切换一目了然
token 使用接近 compact 阈值时及早察觉
工具调用热度统计帮助 review 会话行为
任何外部信息(CI 状态、TODO 数、ts 错误数 ...)都可由用户写脚本接入
设计
配置入口
新增顶层字段 settings.json#statusline:
{
"statusline": {
"enabled": true,
"refreshMs": 2000,
"separator": " · ",
"providers": [
{ "type": "module", "id": "model", "path": "./.deepcode/plugins/model-info.mjs", "color": "white" },
{ "type": "module", "id": "cwd", "path": "./.deepcode/plugins/cwd.mjs", "color": "cyan" },
{ "type": "module", "id": "branch", "path": "./.deepcode/plugins/git-branch.mjs", "color": "magenta" },
{ "type": "module", "id": "session", "path": "./.deepcode/plugins/session-stats.mjs","color": "yellow" },
{ "type": "module", "id": "tools", "path": "./.deepcode/plugins/tool-usage.mjs", "color": "green" }
]
}
}
用户级 (~/.deepcode/settings.json) 与项目级 (
Open Graph Description: feat(cli): 可插拔状态栏 (statusline) 概述 为 Deep Code CLI 增加 可插拔状态栏:在输入框下方渲染一行由用户配置的 segment(git 分支、模型信息、token/会话统计、工具调用次数等),通过 settings.json 的 statusline 字段声明,无需改动 CLI 源码即可扩展。 灵感来自 Claude Code 的 statuslin...
X Description: feat(cli): 可插拔状态栏 (statusline) 概述 为 Deep Code CLI 增加 可插拔状态栏:在输入框下方渲染一行由用户配置的 segment(git 分支、模型信息、token/会话统计、工具调用次数等),通过 settings.json 的 statusline 字段声明,无需改动 CLI 源码即可扩展。 灵感来自 Claude Code 的 statuslin...
Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/193
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:fc2134a4-1756-bee4-1055-19df827b90f7 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C9EE:2422A3:8BFD11:BFEEF4:6A4DD80E |
| html-safe-nonce | 400b31913cb853cf8a1296d89fefb64ecaa274011606bf52a145a0707c6f9cb9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUVFOjI0MjJBMzo4QkZEMTE6QkZFRUY0OjZBNEREODBFIiwidmlzaXRvcl9pZCI6Ijg4Nzg3ODM5NTYzMjY5MzA0NDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | adf68f255063389914be32b2563c5536fe9b1534bfbcc306b032e7cef5af3356 |
| hovercard-subject-tag | pull_request:3916560459 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/193/files |
| twitter:image | https://avatars.githubusercontent.com/u/270912164?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/270912164?s=400&v=4 |
| og:image:alt | feat(cli): 可插拔状态栏 (statusline) 概述 为 Deep Code CLI 增加 可插拔状态栏:在输入框下方渲染一行由用户配置的 segment(git 分支、模型信息、token/会话统计、工具调用次数等),通过 settings.json 的 statusline 字段声明,无需改动 CLI 源码即可扩展。 灵感来自 Claude Code 的 statuslin... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git |
| octolytics-dimension-user_id | 118287711 |
| octolytics-dimension-user_login | lessweb |
| octolytics-dimension-repository_id | 1223512305 |
| octolytics-dimension-repository_nwo | lessweb/deepcode-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1223512305 |
| octolytics-dimension-repository_network_root_nwo | lessweb/deepcode-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width