cc-viewer 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -16,9 +16,9 @@ npm install -g cc-viewer
16
16
  ccv
17
17
  ```
18
18
 
19
- 该命令会自动将监控脚本注入到本地安装的 Claude Code 中,并在 shell 配置文件(`~/.zshrc` 或 `~/.bashrc`)中添加自动重注入 hook。之后正常使用 Claude Code,打开浏览器访问 `http://localhost:7008` 即可查看监控界面。
19
+ 该命令会自动配置本地安装的 Claude Code 以启用监控,并在 shell 配置文件(`~/.zshrc` 或 `~/.bashrc`)中添加自动修复 hook。之后正常使用 Claude Code,打开浏览器访问 `http://localhost:7008` 即可查看监控界面。
20
20
 
21
- Claude Code 更新后无需手动操作,下次运行 `claude` 时会自动检测并重新注入。
21
+ Claude Code 更新后无需手动操作,下次运行 `claude` 时会自动检测并重新配置。
22
22
 
23
23
  ### 卸载
24
24
 
@@ -26,7 +26,7 @@ Claude Code 更新后无需手动操作,下次运行 `claude` 时会自动检
26
26
  ccv --uninstall
27
27
  ```
28
28
 
29
- 一键清理 cli.js 中的注入代码和 shell 配置文件中的 hook。
29
+ 一键清理 cli.js 中的配置和 shell 配置文件中的 hook。
30
30
 
31
31
  ## 功能
32
32
 
@@ -52,8 +52,8 @@ ccv --uninstall
52
52
  - `thinking` 块默认折叠,点击展开查看思考过程
53
53
  - `tool_use` 显示为紧凑的工具调用卡片(Bash、Read、Edit、Write、Glob、Grep、Task 等均有专属展示)
54
54
  - 用户选择型消息(AskUserQuestion)以问答形式展示
55
- - 系统注入标签(`<system-reminder>`、`<project-reminder>` 等)自动折叠
56
- - 自动过滤系统注入文本,只展示用户的真实输入
55
+ - 系统标签(`<system-reminder>`、`<project-reminder>` 等)自动折叠
56
+ - 自动过滤系统文本,只展示用户的真实输入
57
57
  - 支持多 session 分段展示(`/compact`、`/clear` 等操作后自动分段)
58
58
  - 每条消息显示精确到秒的时间戳
59
59
 
package/cli.js CHANGED
@@ -137,23 +137,25 @@ if (showAll) {
137
137
 
138
138
  try {
139
139
  const cliResult = injectCliJs();
140
- if (cliResult === 'exists') {
141
- console.log(t('cli.inject.exists'));
142
- } else {
143
- console.log(t('cli.inject.success'));
144
- }
145
-
146
140
  const shellResult = installShellHook();
147
- if (shellResult.status === 'installed') {
148
- console.log(t('cli.hook.installed', { path: shellResult.path }));
149
- } else if (shellResult.status === 'exists') {
150
- console.log(t('cli.hook.exists', { path: shellResult.path }));
141
+
142
+ if (cliResult === 'exists' && shellResult.status === 'exists') {
143
+ console.log(t('cli.alreadyWorking'));
151
144
  } else {
152
- console.log(t('cli.hook.fail', { error: shellResult.error }));
145
+ if (cliResult === 'exists') {
146
+ console.log(t('cli.inject.exists'));
147
+ } else {
148
+ console.log(t('cli.inject.success'));
149
+ }
150
+
151
+ if (shellResult.status === 'installed') {
152
+ console.log(t('cli.hook.installed', { path: shellResult.path }));
153
+ } else if (shellResult.status !== 'exists') {
154
+ console.log(t('cli.hook.fail', { error: shellResult.error }));
155
+ }
153
156
  }
154
157
 
155
158
  console.log(t('cli.usage.hint'));
156
- console.log(t('cli.usage.uninstallHint'));
157
159
  } catch (err) {
158
160
  if (err.code === 'ENOENT') {
159
161
  console.error(t('cli.inject.notFound', { path: cliPath }));