@ghenya/clinn 0.7.0 → 0.7.2

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.
@@ -2,6 +2,6 @@
2
2
  ██ ██ ██ ████ ██ ████ ██
3
3
  ██ ██ ██ ██ ██ ██ ██ ██ ██
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██
5
- ██████ ███████ ██ ██ ████ ██ █0.7
5
+ ██████ ███████ ██ ██ ████ ██ █0.7.1
6
+
6
7
 
7
-
package/README.md CHANGED
@@ -5,30 +5,18 @@
5
5
  Clinn 是一个运行在终端里的 AI Agent,直接和你的文件系统、Shell、网络交互。不需要 IDE、不需要插件——打开终端,说人话,它帮你干活。
6
6
 
7
7
  ```
8
- ██████ ██ ██ ███ ██ ███ ██
8
+ ██████ ██ ██ ███ ██ ███ ██
9
9
  ██ ██ ██ ████ ██ ████ ██
10
10
  ██ ██ ██ ██ ██ ██ ██ ██ ██
11
11
  ██ ██ ██ ██ ██ ██ ██ ██ ██
12
- ██████ ███████ ██ ██ ████ ██ █ 0.7
12
+ ██████ ███████ ██ ██ ████ ██ █ 0.7
13
13
  ```
14
14
 
15
15
  ---
16
16
 
17
17
  ## 安装
18
18
 
19
- ### npm(推荐)
20
-
21
- ```bash
22
- npm install -g clinn
23
- ```
24
-
25
- 安装后在终端输入 `clinn` 即可启动。首次运行会自动在 `~/.clinn/` 创建配置文件,填入你的 DeepSeek API Key 即可使用。
26
-
27
- 配置路径:`~/.clinn/config.json`
28
- 历史记录:`~/.clinn/mem/`
29
- 自定义工具:`~/.clinn/Tools/custom/`
30
-
31
- ### 手动安装
19
+ ### macOS / Linux / WSL
32
20
 
33
21
  ```bash
34
22
  git clone https://github.com/PillowBots/clinn.git
@@ -161,7 +149,7 @@ Clinn/
161
149
  ├── clinn.bat # Windows 快捷启动
162
150
  ├── package.json
163
151
  └── public/ # 发布版本
164
- └── clinn-v0.7.0/
152
+ └── clinn-v0.7.1/
165
153
  ```
166
154
 
167
155
  ---
@@ -195,6 +183,16 @@ Clinn/
195
183
 
196
184
  ## 更新日志 (Changelog)
197
185
 
186
+ ### v0.7.1 — CLI 增强
187
+
188
+ - **`/api` 命令**:直接在终端配置 API Key、API 地址、模型名称,无需编辑文件
189
+ - `/api` — 查看当前 API 设置(Key 脱敏显示)
190
+ - `/api key <KEY>` — 直接设置 API Key
191
+ - `/api url <URL>` — 切换 API 地址(兼容其他兼容接口)
192
+ - `/api model <MODEL>` — 切换模型
193
+ - **npm 发布**:`npm install -g @ghenya/clinn` 全球安装,配置自动存 `~/.clinn/`
194
+ - **历史/Mem/自定义工具路径统一到 `~/.clinn/`**
195
+
198
196
  ### v0.7.0 — 交互重构 & 稳定性
199
197
 
200
198
  - **上下文监控三级预警**:90% 提示 / 95% 警告 / 不再自动压缩,用户自主 `/clear`
package/Src/index.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  const fs = require("fs");
3
2
  const path = require("path");
4
3
  const os = require("os");
@@ -366,6 +365,10 @@ function showHelp() {
366
365
  ["/trusted", "查看受信任工具"], ["/trust <name>", "永久信任工具"],
367
366
  ["/untrust <name>", "取消信任"], ["/status", "查看当前状态"],
368
367
  ["/ctx", "查看上下文使用量"],
368
+ ["/api", "查看/配置 API 设置"],
369
+ ["/api key <KEY>", "设置 API Key"],
370
+ ["/api url <URL>", "设置 API 地址"],
371
+ ["/api model <MODEL>", "设置模型名称"],
369
372
  ];
370
373
  for (const [cmd, desc] of cmds) {
371
374
  console.log(` ${C.yellow + cmd.padEnd(22) + C.reset} ${desc}`);
@@ -487,6 +490,42 @@ async function handleSlashCommand(input) {
487
490
  console.log(div());
488
491
  break;
489
492
  }
493
+ case "api": {
494
+ const subParts = rest.trim().split(/\s+/);
495
+ const sub = subParts[0]?.toLowerCase();
496
+ const val = subParts.slice(1).join(" ").trim();
497
+ if (sub === "key") {
498
+ if (!val) { console.log(`用法: /api key <你的API Key>`); break; }
499
+ if (val.length < 10) { console.log(`${C.red}Key 太短,请检查${C.reset}`); break; }
500
+ config.llm.apiKey = val;
501
+ saveConfig();
502
+ buildAgent();
503
+ console.log(`${C.green}API Key 已更新 (${val.slice(0, 8)}...)${C.reset}`);
504
+ } else if (sub === "url") {
505
+ if (!val) { console.log(`用法: /api url <API地址>\n 例: /api url https://api.deepseek.com/v1`); break; }
506
+ config.llm.baseURL = val.replace(/\/+$/, "");
507
+ saveConfig();
508
+ buildAgent();
509
+ console.log(`${C.green}API 地址已更新: ${config.llm.baseURL}${C.reset}`);
510
+ } else if (sub === "model") {
511
+ if (!val) { console.log(`用法: /api model <模型名>\n 例: /api model deepseek-chat`); break; }
512
+ config.llm.model = val;
513
+ saveConfig();
514
+ buildAgent();
515
+ console.log(`${C.green}模型已更新: ${config.llm.model}${C.reset}`);
516
+ } else {
517
+ const masked = config.llm.apiKey ? `${config.llm.apiKey.slice(0, 8)}...${config.llm.apiKey.slice(-4)}` : "(未设置)";
518
+ console.log(div());
519
+ console.log(` ${C.bold}API 设置${C.reset}`);
520
+ console.log(` Key: ${C.dim}${masked}${C.reset}`);
521
+ console.log(` URL: ${C.cyan}${config.llm.baseURL}${C.reset}`);
522
+ console.log(` Model: ${C.bold}${config.llm.model}${C.reset}`);
523
+ console.log(` 温度: ${config.llm.temperature} | MaxTokens: ${config.llm.maxTokens}`);
524
+ console.log(div());
525
+ console.log(` 设置: /api key <KEY> | /api url <URL> | /api model <MODEL>`);
526
+ }
527
+ break;
528
+ }
490
529
  case "tool_search": {
491
530
  if (!rest) { console.log(`用法: /tool_search <关键词>`); break; }
492
531
  const results = Tools.searchToolRegistry(rest);
package/bin/clinn ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require("./Src/index.js");
package/config.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "agent": {
3
3
  "name": "Clinn",
4
- "version": "0.7.0",
4
+ "version": "0.7.1",
5
5
  "description": "控制台智能体助手"
6
6
  },
7
7
  "llm": {
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@ghenya/clinn",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "终端原生 AI 编程助手 — DeepSeek 驱动,50+ 工具,对话记忆,虚拟浏览器",
5
5
  "main": "Src/index.js",
6
6
  "bin": {
7
- "clinn": "Src/index.js"
7
+ "clinn": "bin/clinn"
8
8
  },
9
9
  "files": [
10
10
  "Src/",
11
11
  "Tools/",
12
12
  "Mem/",
13
13
  "Logos/",
14
+ "bin/",
14
15
  "config.json",
15
16
  "README.md"
16
17
  ],