cline-kit 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,113 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); dictionary data changes are versioned inside
5
+ each `dictionaries/<locale>.json` rather than here.
6
+
7
+ ## [0.1.0] - 2026-09-20
8
+
9
+ First public release. Windows only.
10
+
11
+ ### Added
12
+
13
+ - **`sidebar-groups` feature** — keeps every registered Cline workspace visible in the sidebar's
14
+ project grouping. Cline natively lists only folders that already have sessions, so registered-but-empty
15
+ projects are simply absent. Empty projects get a native-styled group with an "open this project" action
16
+ that drives Cline's own workspace picker (chip → search → result row) rather than rewriting its storage.
17
+ - `ckit` CLI: `start`, `stop`, `status`, `doctor`, `attach`, `install`, `uninstall`, `update`, `audit`,
18
+ `features`, `feature enable|disable`, `dict`, `config`.
19
+ - Overlay engine (`src/engine.js`): whole-string text-node replacement plus `placeholder`, `aria-label`
20
+ and `title` attribute translation, driven by a `MutationObserver` with a 1.2 s rescan for portals.
21
+ - Five locale dictionaries in `dictionaries/`: **zh-CN** (reference, 476 strings + 6 prefix rules +
22
+ 24 regex rules, proofread against the running app), plus **zh-TW**, **ja**, **ko**, **vi** carrying the
23
+ same key set. Switch with `ckit config --dictionary=ja`; the change applies to the open window with no
24
+ reload, and `ckit update` follows whichever locale is selected.
25
+ - Locale authoring pipeline: `scripts/new-locale.js` (skeleton copied from the reference key set),
26
+ `scripts/apply-locale.js` (fills values from a flat map so nobody hand-edits the JSON),
27
+ `scripts/build-zh-tw.js` (OpenCC s2tw plus a Taiwan software term table), and
28
+ `scripts/locale-switch-check.js` (proves each locale reaches the live DOM).
29
+ - `scripts/selftest.js` (`npm test`, 24 dependency-free checks): path/label/container logic, registry
30
+ parsing and key-version discovery, dictionary schema validation, locale completeness against the
31
+ reference, payload versioning, and a ship-clean check that fails on a personal profile path, this
32
+ machine's username, a GitHub token or a stray e-mail inside shipped files.
33
+ - `ckit doctor` — asks the live webview what is actually installed (payload build, per-feature build,
34
+ rows added vs registered workspaces, dictionary sources, idle DOM write rate) instead of trusting what
35
+ the launcher intended, so a Cline update that renames a class shows up as a FAIL rather than an empty
36
+ sidebar.
37
+ - `ckit attach --port=N` — inject once into a Cline that already exposes a debug port, for anyone who
38
+ keeps their own launcher and does not want this tool to own the shortcut.
39
+ - Feature-plugin mechanism: `src/features/` with per-feature toggles that hot-apply within ~4 s, and
40
+ shared pure helpers in `src/features/sidebar-groups.logic.js`.
41
+ - Cline path auto-detection: running process → registry uninstall entries → common install directories →
42
+ `PATH`, with `ckit config --cline-path` as the override.
43
+ - Random loopback debug port per session; never written as a system-wide environment variable.
44
+ - Installer that repoints existing Start Menu / Desktop Cline shortcuts at a hidden launcher, storing the
45
+ original target so `ckit uninstall` restores it exactly.
46
+ - Optional dictionary updates from a configurable raw GitHub URL, with strict validation and offline
47
+ fallback; `ckit config --auto-update=off` removes all network access.
48
+ - Local override file (`%APPDATA%\cline-kit\<locale>.local.json`) that wins over bundled and cached data.
49
+ - `ckit audit` — walks the screens over CDP, filters hidden-but-mounted panels by hit-testing each node,
50
+ and reports only strings the dictionary does not cover.
51
+ - `ckit.cmd` so a release-zip download has an entry point without a global install.
52
+ - CI: `npm test` plus a CLI smoke pass on tag, a portable Windows zip artifact, and npm publish gated on
53
+ an `NPM_TOKEN` secret.
54
+
55
+ ### Changed
56
+
57
+ - Positioned as **Cline-kit**, an enhancement kit: the sidebar behaviour is the product and localisation
58
+ is one optional layer riding the same injection channel. The npm package, the checkout folder and the
59
+ `%APPDATA%` state directory stay lowercase `cline-kit` because npm ids cannot contain capitals.
60
+ - `sidebar-groups` keeps project grouping on (Cline does not persist it), but yields for the rest of the
61
+ session as soon as the user touches Cline's own sort control, with a 6 s cooldown so a mode-detection
62
+ mismatch cannot turn into a click loop.
63
+ - Workspaces are recognised as *projects* or *containers* by structure: a registered path that contains
64
+ other registered paths, or sits inside the detected install directory, is not a project. No per-machine
65
+ hardcoded paths; `ckit config --hide=<path>` adds an exception.
66
+ - Registry access follows the highest `cline.code.workspace-selection.vN` key instead of pinning v2
67
+ (`ckit config --storage-key=` forces one), and drops non-string entries.
68
+ - Project labels are generated across the whole registry: a duplicate folder name reads
69
+ `LLM (workspace)`, further collisions get a counter, and every row's tooltip is the full path. Rows we
70
+ cannot be certain are absent from the native list no longer claim "no sessions yet".
71
+ - The workspace-chip lookup matches structurally (anything outside the sidebar container) instead of
72
+ guessing `left > 280px`, and the picker list matches `max-h-*` instead of `max-h-48`.
73
+ - CLI output, help text and the feature title are English-first; Chinese instructions live in
74
+ `README.zh-CN.md` and `docs/`.
75
+ - The injector no longer runs with `src/` as its working directory; that locked the checkout so files
76
+ could not be renamed or replaced while it was alive.
77
+
78
+ ### Fixed
79
+
80
+ - Changing locale mid-session left the previous language on screen, because the overlay kept no record of
81
+ what it had replaced. The engine now stores the original text per node and attribute and re-translates
82
+ from English when the dictionary changes; a string the new locale lacks falls back to English instead
83
+ of staying translated.
84
+ - An identical value is never written back. That one missing comparison was enough for the observer and
85
+ the translator to chase each other's mutations and freeze the webview; `ckit doctor`'s idle write-rate
86
+ check now surfaces that class of bug instead of hanging the app.
87
+ - CDP commands time out. A wedged or navigating renderer used to hang `ckit status` / `doctor` / `audit`
88
+ indefinitely; they report FAIL now.
89
+ - Two workspaces with the same folder name collapsed into a single row; they are now both listed.
90
+ - Payload re-evaluation used to fail silently on the second injection of the same document
91
+ (`Identifier 'DICT' has already been declared`), which killed every hot update; the payload is wrapped
92
+ in its own closure and evaluate errors are logged and reported.
93
+ - The engine's reload guard keyed on the dictionary version only, so editing the engine itself never took
94
+ effect; it now keys on the engine build hash plus the dictionary version and language.
95
+ - Remote dictionaries are rejected when a rule pattern contains a nested quantifier (`(a+)+`), which
96
+ would otherwise be compiled inside the webview.
97
+ - Launcher scripts are written with a BOM (`launch-cline-kit.ps1` UTF-8, `.vbs` UTF-16LE); without them
98
+ Windows read the install path as ANSI and the shortcut silently did nothing on non-ASCII paths.
99
+ - PowerShell path comparisons used `JSON.stringify`, which leaves doubled backslashes that PowerShell
100
+ keeps literally, so shortcut detection matched nothing; paths are now single-quoted literals.
101
+
102
+ ### Known limitations
103
+
104
+ - Windows only: the injection route relies on `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS`.
105
+ - Launch through the kit. Opening `cline-app.exe` directly has no debug port, so you get plain Cline.
106
+ - Selectors are Cline's internal class names, not a public API; a Cline redesign needs `sidebar-groups`
107
+ updated (`ckit doctor` tells you when it stopped matching).
108
+ - zh-TW / ja / ko / vi are complete but machine-assisted and not reviewed by native speakers; zh-CN is the
109
+ only corpus proofread against the running app.
110
+ - Per-model description strings from the remote provider catalogue stay English.
111
+ - Provider, model, product and tool-identifier names are deliberately never translated.
112
+ - Changing workspace makes Cline rebuild its window (new process, default geometry): that is Cline's own
113
+ behaviour, not the overlay's.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 chentaoxing
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/NOTICE ADDED
@@ -0,0 +1,60 @@
1
+ # NOTICE
2
+
3
+ Cline-kit
4
+ Copyright (c) 2026 chentaoxing
5
+
6
+ ## Unofficial
7
+
8
+ This project is **not** affiliated with, endorsed by, or supported by Cline or its contributors.
9
+ "Cline" is a name/brand of its respective owners; it is used here descriptively to identify which
10
+ application this tool patches at runtime.
11
+
12
+ ## What is under MIT
13
+
14
+ All source code in `src/` and `scripts/`, all documentation, and the `zh-CN` translation content in
15
+ `dictionaries/` are original work of this project's authors and are licensed under the MIT License
16
+ (see `LICENSE`).
17
+
18
+ ## Where the English strings come from
19
+
20
+ The dictionary keys are **English UI strings of the Cline desktop app**. They were obtained two ways:
21
+
22
+ 1. by walking the rendered UI of the shipping app (v0.0.32) with the overlay's own `audit` command;
23
+ 2. by reading the app's own source at `apps/examples/desktop-app` in the public repository
24
+ [`cline/cline`](https://github.com/cline/cline), which is distributed under the **Apache License
25
+ 2.0**. The English text is quoted as-is because it is the lookup key; the Chinese values are
26
+ original translations written by this project and are not derived from any upstream translation.
27
+
28
+ No source code, bundle, or binary from `cline/cline` is copied, distributed, or shipped in this
29
+ repository. The tool never modifies `cline-app.exe`.
30
+
31
+ ## Design credit (ideas, not code)
32
+
33
+ Two community projects in the same space shaped decisions here. **No code from either is included or
34
+ translated**; both are cited so readers can compare approaches:
35
+
36
+ * [`ExSchwi/cline-desktop-zh-cn`](https://github.com/ExSchwi/cline-desktop-zh-cn) (Apache-2.0) — the
37
+ idea of keying localisation data against the app version with a documented fallback strategy. This
38
+ project instead keys the injected payload on a content hash and treats `audit` as the regression
39
+ detector; see `docs/dictionary-pipeline.zh-CN.md` for the trade-off.
40
+ * [`JACK5920/cline-desktop-zh`](https://github.com/JACK5920/cline-desktop-zh) (MIT) — confirmation
41
+ that a silent launcher plus a dictionary plus a DOM overlay is a workable shape, and the idea of
42
+ separating whole-element replacement from text-node replacement.
43
+
44
+ ## Icons
45
+
46
+ No Cline logo or icon asset is bundled. The Start Menu shortcut created by `ckit install`
47
+ references the icon **inside the user's own locally installed `cline-app.exe`** by path, so no image
48
+ file is copied into this repository or into a release archive.
49
+
50
+ ## Locale dictionaries - provenance and review status
51
+
52
+ `dictionaries/zh-CN.json` is the reference corpus: its English keys are strings read out of the running
53
+ app and out of `apps/examples/desktop-app` in the Apache-2.0 `cline/cline` repository; its Chinese values
54
+ are original work of this project.
55
+
56
+ `zh-TW.json`, `ja.json`, `ko.json` and `vi.json` hold the same 476 keys, translated with machine
57
+ assistance and then terminology-checked inside this project. zh-TW additionally went through a
58
+ character-sense review rather than a simplified-to-traditional swap. None of the four has been reviewed
59
+ by a native speaker of the target language, and each file says so in its own `note` field. They contain
60
+ no code, no assets and no text taken from any third-party translation project.
package/README.md ADDED
@@ -0,0 +1,188 @@
1
+ # Cline-kit
2
+
3
+ Enhancements for the **Cline desktop app** on Windows, delivered as a runtime overlay — no patched
4
+ binaries, no fork.
5
+
6
+ [中文说明](README.zh-CN.md)
7
+
8
+ *The product name is **Cline-kit**; the npm package, the on-disk folder and the `%APPDATA%` state
9
+ directory are lowercase `cline-kit` because npm ids cannot contain capitals. The CLI is `ckit`.*
10
+
11
+ **Flagship feature:** Cline's sidebar project groups only show folders that already have sessions.
12
+ Every project you registered but have not opened yet is simply invisible. `cline-kit` keeps all of
13
+ them listed, with the same styling as the native groups, and lets you switch into an empty project
14
+ straight from the sidebar.
15
+
16
+ **Secondary feature:** UI locale packs (简体中文 today; 繁體中文 / 日本語 / 한국어 / Tiếng Việt use the
17
+ same format). Locales exist because the same injection channel can carry them — they are not what the
18
+ project is for.
19
+
20
+ ## The sidebar problem
21
+
22
+ Native Cline groups sessions by project (the `Sort sessions: Time ⇄ Project` toggle), but the group
23
+ list is derived from *existing sessions*. Register 17 project folders, keep sessions in 3 of them, and
24
+ the sidebar shows 3. The `sidebar-groups` feature fixes that:
25
+
26
+ | | before | after |
27
+ | --- | --- | --- |
28
+ | registered projects shown | 3 | 17 |
29
+ | projects without sessions | hidden | listed and expandable, marked "No sessions yet" |
30
+ | switching into an empty project | not possible from the sidebar | one click, driven through Cline's own workspace picker |
31
+
32
+ Nothing is written into Cline's storage: switching a project drives the app's own picker (chip →
33
+ search → result row), so the behaviour is identical to doing it by hand.
34
+
35
+ ## How it works
36
+
37
+ ```
38
+ ckit start
39
+ ├── launches cline-app.exe with WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=<random>
40
+ ├── connects to the DevTools endpoint on 127.0.0.1
41
+ └── a keep-alive injector installs engine.js + enabled features (+ locale data when a dictionary is loaded)
42
+ └── MutationObserver keeps the project groups present and, with a locale active,
43
+ replaces English text nodes and placeholder/aria-label/title attributes
44
+ ```
45
+
46
+ `cline-app.exe` is never modified: signature, install directory and auto-update all stay as shipped.
47
+ Feature code and locale data are independent — run cline-kit for the sidebar only, for locales only,
48
+ or both.
49
+
50
+ ## Requirements
51
+
52
+ * Windows 10/11 (macOS/Linux not supported yet — see [Limitations](#limitations))
53
+ * [Node.js](https://nodejs.org) 20.10 or newer (global `WebSocket` and `fetch`)
54
+ * The Cline desktop app installed (verified against v0.0.32)
55
+
56
+ ## Install
57
+
58
+ Three routes, same tool. All of them need Node.js on `PATH`; none of them touch `cline-app.exe`.
59
+
60
+ **1. npm (recommended, once the package is published)**
61
+
62
+ ```bash
63
+ npm install -g cline-kit
64
+ ckit install # point your existing Cline shortcut at the kit launcher
65
+ ckit start # launch Cline with the enhancements now
66
+ ```
67
+
68
+ **2. Release zip (no global install)**
69
+
70
+ Download `cline-kit-vX.Y.Z-win.zip` from [Releases](https://github.com/chentaoxing/Cline-kit/releases), unzip anywhere, and run the bundled
71
+ shim once from that folder:
72
+
73
+ ```cmd
74
+ ckit.cmd install
75
+ ckit.cmd start
76
+ ```
77
+
78
+ **3. From source (contributing)**
79
+
80
+ ```bash
81
+ git clone https://github.com/chentaoxing/Cline-kit.git
82
+ cd cline-kit
83
+ npm install -g . # or call it directly: node src/cli.js <command>
84
+ npm test # 22 checks, no dependencies
85
+ ```
86
+
87
+ Then in every case:
88
+
89
+ ```bash
90
+ ckit doctor # confirms the overlay is live inside the running window
91
+ ```
92
+
93
+ `ckit install` locates the Cline shortcut in the Start Menu / Desktop, saves its original target in
94
+ `%APPDATA%\cline-kit\config.json`, and repoints it at a hidden launcher. Opening Cline the normal way
95
+ then gives you the enhanced sidebar. If you would rather keep your own launcher, skip `install` and run
96
+ `ckit start` (or `ckit attach --port=N` against a Cline you started with a debug port).
97
+
98
+ ## Usage
99
+
100
+ | Command | What it does |
101
+ | --- | --- |
102
+ | `ckit start` | Launch Cline with the overlay attached (`--restart` closes the running instance first) |
103
+ | `ckit stop` | Stop the background injector; Cline itself is untouched |
104
+ | `ckit status` | Detected Cline path, debug port, injector process, loaded build version |
105
+ | `ckit doctor` | Ask the live window what is really installed: payload build, rows added, native groups |
106
+ | `ckit attach` | Inject once into a Cline you started yourself (`--port=N`), without owning the shortcut |
107
+ | `ckit features` | List feature plugins and whether each is on |
108
+ | `ckit feature enable\|disable <id>` | Toggle a feature (applies within ~4 s, no restart) |
109
+ | `ckit install` / `uninstall` | Repoint / restore your Cline shortcut |
110
+ | `ckit update` | Pull the latest locale dictionary from GitHub (`--force` to check now) |
111
+ | `ckit audit` | Walk the UI and list strings still in English |
112
+ | `ckit dict` | Dictionary statistics and the local override path |
113
+ | `ckit config` | Inspect or set `--cline-path`, `--port`, `--auto-update=on\|off` |
114
+
115
+ ## Features
116
+
117
+ `ckit features` shows the live list.
118
+
119
+ * **`sidebar-groups`** (on by default) — the always-listed project groups described above. It decides
120
+ what counts as a project on its own: a registered path that contains other registered paths, or sits
121
+ inside the app's install directory, is treated as a container and not listed. No per-machine
122
+ configuration is needed. If you click Cline's own sort control, your choice wins for the rest of the
123
+ session; otherwise the kit keeps project grouping on. Two projects that share a folder name are
124
+ labelled with their parent folder - `LLM (workspace)` - and every row carries the full path as its
125
+ tooltip. Design notes: [`docs/features.zh-CN.md`](docs/features.zh-CN.md).
126
+ * **locale packs** (`dictionaries/<locale>.json`) — whole-string text replacement only, so model
127
+ names, provider names, tool identifiers and code cannot be mangled. The corpus is 476 strings plus
128
+ 30 pattern rules, built by combining a UI walk with extraction from the app's own source. Five
129
+ dictionaries ship: **zh-CN** (reference, proofread against the running app), **zh-TW**, **ja**,
130
+ **ko**, **vi** - complete but machine-assisted and *not* reviewed by native speakers, so a pull
131
+ request fixing a term is genuinely welcome. Switch with `ckit config --dictionary=ja`; the change
132
+ applies to the open window without a reload, and `ckit update` follows the locale you picked.
133
+ Authoring guide: [`docs/dictionary-pipeline.zh-CN.md`](docs/dictionary-pipeline.zh-CN.md).
134
+
135
+ ## Limitations
136
+
137
+ * **Windows only.** The injection route relies on a WebView2 environment variable; macOS/Linux use
138
+ WKWebView/WebKitGTK and need a different mechanism.
139
+ * **No standalone executable on purpose.** Packaging Node inside a `.exe` would remove the Node
140
+ requirement, but unsigned binaries attract SmartScreen and antivirus warnings, and the injector has
141
+ to keep talking to a local DevTools port anyway. npm or the zip are the supported routes.
142
+ * **Launch through the kit.** Opening `cline-app.exe` directly (or via a shortcut that was never
143
+ repointed) has no debug port to attach to, so you get plain Cline.
144
+ * **Cline updates can break things.** If the app renames a label, the locale leaves it in English; if
145
+ it restructures the sidebar, `sidebar-groups` needs updating. Run `ckit audit` and open an issue.
146
+ * **Per-model description blurbs stay English** — free-form text from a remote provider catalogue.
147
+ * **Same-named projects.** Cline's own group headers expose only the folder name, never the path, so if
148
+ the registry holds two different `LLM` folders and one already has a native group, the kit cannot tell
149
+ which one that is. It lists both, qualified with the parent folder, and drops the "no sessions yet"
150
+ line on those rows rather than asserting something it does not know.
151
+ * Proper nouns are never translated: Cline, provider and model names, tool identifiers, paths.
152
+
153
+ ## Security
154
+
155
+ `ckit start` opens a DevTools port on `127.0.0.1` for as long as Cline runs; any process running as
156
+ you can drive the Cline UI through it. The port is random per session, loopback-only, and never set as
157
+ a system-wide environment variable. Remote dictionaries are validated (shape, size, anchored regexes)
158
+ and rejected outright if malformed. Details in [SECURITY.md](SECURITY.md).
159
+
160
+ ## Uninstall
161
+
162
+ ```bash
163
+ ckit uninstall # restores the original Cline shortcut and stops the injector
164
+ del /q "%APPDATA%\cline-kit" # optional: remove config, cache, logs
165
+ npm uninstall -g cline-kit
166
+ ```
167
+
168
+ ## Relationship to other projects
169
+
170
+ [`JACK5920/cline-desktop-zh`](https://github.com/JACK5920/cline-desktop-zh) and
171
+ [`ExSchwi/cline-desktop-zh-cn`](https://github.com/ExSchwi/cline-desktop-zh-cn) cover the **language**
172
+ half of this well and are worth using if all you want is a Chinese UI;
173
+ [`cline-chinese`](https://github.com/HybridTalentComputing/cline-chinese) is a fork of the **VS Code
174
+ extension**, a different surface again. cline-kit overlaps them only on locales — its reason to exist
175
+ is the sidebar/project behaviour, plus the packaging (reversible installer, path auto-detection,
176
+ random port, feature toggles, `ckit audit`). Design credit is recorded in [NOTICE](NOTICE).
177
+
178
+ The better long-term outcome is upstream: an official language setting, and a sidebar that lists all
179
+ registered projects. See [`docs/upstream-i18n.md`](docs/upstream-i18n.md) for the threads we have
180
+ engaged on ([#12518](https://github.com/cline/cline/issues/12518),
181
+ [#13811](https://github.com/cline/cline/pull/13811)).
182
+
183
+ ## License
184
+
185
+ MIT — see [LICENSE](LICENSE). [NOTICE](NOTICE) records provenance: unofficial project, no upstream code
186
+ or assets shipped, English locale keys are Cline's own UI strings read from `apps/examples/desktop-app`
187
+ in the Apache-2.0 [`cline/cline`](https://github.com/cline/cline) repository, translated values are
188
+ original. Not affiliated with, endorsed by, or part of Cline.
@@ -0,0 +1,168 @@
1
+ # Cline-kit(中文说明)
2
+
3
+ 给 **Cline 桌面版**(Windows)加功能的运行时覆盖层——不改二进制,不 fork。
4
+
5
+ [English README](README.md)
6
+
7
+ *产品名写作 **Cline-kit**;npm 包名、代码目录和 `%APPDATA%` 状态目录都是小写 `cline-kit`(npm 包名不允许大写)。命令行是 `ckit`。*
8
+
9
+ **主打功能:** Cline 侧边栏的「项目分组」只显示**已经有会话**的文件夹。你登记过但还没打开过的项目,
10
+ 在界面上根本不存在。cline-kit 把所有已登记项目常驻列出,样式与原生分组一致,并且可以直接从侧边栏
11
+ 切进一个还没有会话的项目。
12
+
13
+ **附属功能:** 界面语言包(目前简体中文;繁體中文 / 日本語 / 한국어 / Tiếng Việt 用同一套格式)。
14
+ 语言包之所以在这里,是因为同一条注入通道顺带能承载它——它不是这个项目存在的理由。
15
+
16
+ ## 要解决的问题
17
+
18
+ Cline 原生其实有一半:侧边栏那个 `会话排序:时间 ⇄ 项目` 开关就是按项目分组。但分组列表是从
19
+ *已有会话*推导出来的——登记 17 个项目文件夹、只在其中 3 个里建过会话,侧边栏就只有 3 个。
20
+ `sidebar-groups` 补的就是这一段:
21
+
22
+ | | 之前 | 之后 |
23
+ | --- | --- | --- |
24
+ | 显示的已登记项目 | 3 | 17 |
25
+ | 没有会话的项目 | 完全不出现 | 列出、可展开,标注「暂无会话」 |
26
+ | 切进空项目 | 侧边栏做不到 | 一键,走 Cline 自己的工作区选择器 |
27
+
28
+ 不写 Cline 的任何存储:切换项目是驱动它自己的选择器(chip → 搜索框填路径 → 点结果行),
29
+ 行为与你手动操作完全一致。
30
+
31
+ ## 工作原理
32
+
33
+ ```
34
+ ckit start
35
+ ├── 以 WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=<随机端口> 启动 cline-app.exe
36
+ ├── 连接 127.0.0.1 上的 DevTools 接口
37
+ └── 常驻注入器装载 engine.js + 已启用插件(加载词典时一并装载语言数据)
38
+ └── MutationObserver 维持项目分组常驻;启用语言包时替换英文文本节点
39
+ 与 placeholder / aria-label / title 属性
40
+ ```
41
+
42
+ `cline-app.exe` 一个字节都没改:签名、安装目录、自动更新全部照旧。插件代码与语言数据彼此独立——
43
+ 可以只用项目栏、只用语言包,或两个都开。
44
+
45
+ ## 环境要求
46
+
47
+ * Windows 10/11(macOS / Linux 暂不支持,见[已知限制](#已知限制))
48
+ * [Node.js](https://nodejs.org) 20.10 及以上(需要全局 `WebSocket` 与 `fetch`)
49
+ * 已安装 Cline 桌面版(在 v0.0.32 上验证)
50
+
51
+ ## 安装
52
+
53
+ 三条路都是同一个工具,都要求 `PATH` 里有 Node.js,都不碰 `cline-app.exe`。
54
+
55
+ **1. npm(推荐,发布后适用)**
56
+
57
+ ```bash
58
+ npm install -g cline-kit
59
+ ```
60
+
61
+ **2. Release 压缩包(不装到全局)**
62
+
63
+ 从 Releases 下载 `cline-kit-vX.Y.Z-win.zip`,解压到任意目录,在该目录里跑一次自带的启动脚本:
64
+
65
+ ```cmd
66
+ ckit.cmd install
67
+ ckit.cmd start
68
+ ```
69
+
70
+ **3. 源码(要改代码时)**
71
+
72
+ ```bash
73
+ git clone https://github.com/chentaoxing/Cline-kit.git
74
+ cd cline-kit
75
+ npm install -g . # 或直接用:node src/cli.js <命令>
76
+ npm test # 22 项无依赖自检
77
+ ```
78
+
79
+ 装完统一确认一次:
80
+
81
+ ```bash
82
+ ckit doctor # 直接问运行中的窗口:增强层到底进没进去
83
+ ```
84
+
85
+ `ckit install` 会在开始菜单 / 桌面找到 Cline 快捷方式,把原始目标备份进 `%APPDATA%\cline-kit\config.json`,
86
+ 再改为指向一个无黑框启动器。之后正常点开 Cline 就带增强功能。想继续用自己的启动方式,就跳过 `install`,
87
+ 用 `ckit start`,或者对一个已经开着调试端口的 Cline 用 `ckit attach --port=N`。
88
+
89
+ ## 命令
90
+
91
+ | 命令 | 作用 |
92
+ | --- | --- |
93
+ | `ckit start` | 以增强层启动 Cline(`--restart` 先退出正在运行的实例) |
94
+ | `ckit stop` | 结束后台注入器,不影响 Cline 本身 |
95
+ | `ckit status` | 探测到的 Cline 路径、调试端口、注入器进程、已装载构建版本 |
96
+ | `ckit doctor` | 直接问正在运行的窗口装了些什么:构建版本、补了几行、原生分组数 |
97
+ | `ckit attach` | 往你自己启动、已开调试端口的 Cline 注入一次(`--port=N`),不接管快捷方式 |
98
+ | `ckit features` | 列出功能插件与开关状态 |
99
+ | `ckit feature enable\|disable <id>` | 开关某个插件(约 4 秒生效,无需重启) |
100
+ | `ckit install` / `uninstall` | 改写 / 还原 Cline 快捷方式 |
101
+ | `ckit update` | 从 GitHub 拉取最新语言词典(`--force` 立即检查) |
102
+ | `ckit audit` | 走查界面,列出仍是英文的字符串 |
103
+ | `ckit dict` | 词典统计与本地覆盖文件路径 |
104
+ | `ckit config` | 查看或设置 `--cline-path`、`--port`、`--auto-update=on\|off`、`--dictionary=<语言>`、`--hide=<路径>` |
105
+
106
+ ## 功能
107
+
108
+ `ckit features` 看实时列表。
109
+
110
+ * **`sidebar-groups`**(默认开启)——上面说的常驻项目分组。它自己判断什么算项目:某个登记路径如果
111
+ 包含着其他登记路径,或者位于应用安装目录内,就当作容器不显示,因此**不需要按机器配置**。
112
+ 如果你亲手点了 Cline 的排序按钮,本会话内就以你的选择为准不再干预;否则增强层会持续保持分组模式。
113
+ 两个同名项目(比如两块盘上都有 `LLM`)会带上上级目录名显示成 `LLM (workspace)`,仍然重名就加序号,
114
+ 而鼠标悬停始终是完整路径。设计说明见 [`docs/features.zh-CN.md`](docs/features.zh-CN.md)。
115
+ * **语言包**(`dictionaries/<locale>.json`)——只做**整串精确匹配**替换,因此不会误伤模型名、服务商名、
116
+ 工具标识和代码。语料为 476 条词条 + 30 条规则,来源是「界面走查 + 从应用自身源码提取」两路合并。
117
+ 现在随包附带 5 份词典:**zh-CN**(基准,逐条对着运行中的界面校对过)、**zh-TW**、**ja**、**ko**、
118
+ **vi** —— 后四份条目齐全但属于机器辅助翻译、未经母语者审校,术语有偏差欢迎提 PR 直接改。
119
+ 切换:`ckit config --dictionary=ja`,正在打开的窗口**不需要重启或刷新**就会跟着变;
120
+ `ckit update` 也只更新你选的那一份。制作流程见
121
+ [`docs/dictionary-pipeline.zh-CN.md`](docs/dictionary-pipeline.zh-CN.md)。
122
+
123
+ ## 已知限制
124
+
125
+ * **仅 Windows。** 注入依赖 WebView2 的环境变量;macOS/Linux 用 WKWebView / WebKitGTK,需要另一套机制。
126
+ * **故意不出独立 exe。** 把 Node 打进可执行文件确实能省掉运行环境,但未签名的单文件程序会被
127
+ SmartScreen 和杀软拦,而注入器本来也要一直开着本地调试端口。npm 或 Release 压缩包就是官方路径。
128
+ * **必须经由增强层启动。** 直接双击 `cline-app.exe`(或用没被改写的快捷方式)没有可注入的调试端口,
129
+ 得到的是原版界面。
130
+ * **Cline 升级可能失效。** 文案改了,语言包会留英文;侧边栏结构改了,`sidebar-groups` 需要跟进。
131
+ 跑一次 `ckit audit` 并开 issue。
132
+ * **模型下方的一句英文简介不覆盖**——来自云端目录的自由文本,条数随服务商变化。
133
+ * **同名项目。** Cline 自己的分组标题只有文件夹名、没有路径,所以登记表里出现两个不同盘符下的 `LLM`
134
+ 且其中一个已有原生分组时,无法判断哪一个才是它。此时两行都列出(带上级目录区分),并且不在这种行里
135
+ 写「暂无会话」——不确定的事就不声明。
136
+ * 专有名词一律不翻:Cline、服务商与模型名、工具标识、路径。
137
+
138
+ ## 安全说明
139
+
140
+ `ckit start` 会在 Cline 运行期间于 `127.0.0.1` 开一个 DevTools 端口,本机以你身份运行的任意进程都能
141
+ 通过它操作 Cline 界面。端口每次启动随机、只绑定回环地址、不写成系统级环境变量。远端词典会做校验
142
+ (结构、规模、正则必须锚定),不合规直接拒绝。详见 [SECURITY.md](SECURITY.md)。
143
+
144
+ ## 卸载
145
+
146
+ ```bash
147
+ ckit uninstall # 还原原始快捷方式并结束注入器
148
+ del /q "%APPDATA%\cline-kit" # 可选:删除配置、缓存与日志
149
+ npm uninstall -g cline-kit
150
+ ```
151
+
152
+ ## 与同类项目的关系
153
+
154
+ [`JACK5920/cline-desktop-zh`](https://github.com/JACK5920/cline-desktop-zh) 和
155
+ [`ExSchwi/cline-desktop-zh-cn`](https://github.com/ExSchwi/cline-desktop-zh-cn) 把**语言**这一半做得不错,
156
+ 只想要中文界面的话用它们就够了;[`cline-chinese`](https://github.com/HybridTalentComputing/cline-chinese)
157
+ 是 **VS Code 插件**的分叉,属于另一个界面。本项目与它们的交集只在语言包上——存在理由是侧边栏/项目行为,
158
+ 加上工程化部分(可逆安装、路径自动探测、随机端口、插件开关、`ckit audit`)。思路致谢记录在 [NOTICE](NOTICE)。
159
+
160
+ 更好的长期结果是官方支持:一个语言设置,以及一个列出全部已登记项目的侧边栏。我们已在
161
+ [#12518](https://github.com/cline/cline/issues/12518) 与 [#13811](https://github.com/cline/cline/pull/13811)
162
+ 发言,脉络见 [`docs/upstream-i18n.md`](docs/upstream-i18n.md)。
163
+
164
+ ## 许可
165
+
166
+ MIT,见 [LICENSE](LICENSE)。[NOTICE](NOTICE) 记录来源边界:非官方项目、不打包任何上游代码或图标资源、
167
+ 语言包的英文键取自 Apache-2.0 的 [`cline/cline`](https://github.com/cline/cline) 仓库中
168
+ `apps/examples/desktop-app`(即应用自身界面文案),译文为原创。与 Cline 无隶属关系,也未获其背书。
package/SECURITY.md ADDED
@@ -0,0 +1,53 @@
1
+ # Security Policy
2
+
3
+ ## What this tool does to your machine
4
+
5
+ `ckit start` launches `cline-app.exe` with one extra environment variable, set **only for that
6
+ process tree**:
7
+
8
+ ```
9
+ WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=<random port>
10
+ ```
11
+
12
+ That gives the Cline window a Chrome DevTools Protocol endpoint. Consequences worth stating plainly:
13
+
14
+ 1. **A local DevTools port is a local control channel.** While Cline is running, any process running as
15
+ your user can attach to `127.0.0.1:<port>` and read or drive the Cline UI — including anything the
16
+ window can see. This is not a vulnerability introduced by this tool (any `--remote-debugging-port`
17
+ user has the same exposure), but it *is* a wider local attack surface than Cline normally has.
18
+ 2. **The port is random per session** and bound to loopback only. It is not exposed to the network.
19
+ 3. **The port number and Cline path are stored** in `%APPDATA%\cline-kit\config.json` in plain text.
20
+ 4. **Injected code is local by default.** The overlay is `src/engine.js` plus a JSON dictionary read from
21
+ disk. Nothing is fetched or executed unless you enable dictionary updates.
22
+ 5. **Remote dictionaries are validated, not trusted.** `src/dict.js` rejects a file that is not an
23
+ object with the expected shape, has more than 20 000 entries, has any key/value longer than 400
24
+ characters, or contains a rule whose regex is longer than 200 characters, is not anchored with
25
+ `^…$`, or fails to compile. A rejected update is dropped and the local dictionary keeps working.
26
+ Note the residual risk: rule patterns do reach `new RegExp()` in the page, so a malicious dictionary
27
+ could at worst cause CPU waste via a pathological regex — it cannot execute code.
28
+ 6. **The installer edits your shortcuts.** `ckit install` rewrites the target of any Start Menu or
29
+ Desktop `.lnk` that points at your `cline-app.exe`, after saving the original target and arguments in
30
+ the config file so `ckit uninstall` can restore them.
31
+
32
+ ## Turning network updates off
33
+
34
+ ```bash
35
+ ckit config --auto-update=off
36
+ ```
37
+
38
+ With this set the tool never contacts GitHub; the dictionary only changes when you update the tool
39
+ itself.
40
+
41
+ ## Not doing
42
+
43
+ * No modification, patching, repacking or re-signing of `cline-app.exe`.
44
+ * No system-wide environment variables.
45
+ * No kernel/service components, no startup driver, no admin rights required.
46
+ * No telemetry — the tool makes exactly one optional outbound HTTPS request, to the raw.githubusercontent.com
47
+ URL in your config.
48
+
49
+ ## Reporting a problem
50
+
51
+ Open an issue. If your concern involves the DevTools port specifically, say so — the mitigation is to run
52
+ `ckit stop` and use Cline in English, or to keep the tool installed but only launch Cline through it
53
+ when you need Chinese.
package/ckit.cmd ADDED
@@ -0,0 +1,12 @@
1
+ @echo off
2
+ rem cline-kit launcher for people who downloaded the release zip instead of installing from npm.
3
+ rem Runs the CLI straight out of this folder, so nothing is written to the global npm tree.
4
+ setlocal
5
+ set "HERE=%~dp0"
6
+ where node >nul 2>nul
7
+ if errorlevel 1 (
8
+ echo cline-kit needs Node.js 20.10 or newer on PATH. https://nodejs.org
9
+ exit /b 1
10
+ )
11
+ node "%HERE%src\cli.js" %*
12
+ exit /b %ERRORLEVEL%