@liumir/lmcode 0.6.0 → 0.8.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/README.md +133 -87
- package/dist/{app-cmsAp4uI.mjs → app-BFWlhAlt.mjs} +830 -133
- package/dist/main.mjs +1 -1
- package/package.json +22 -22
package/README.md
CHANGED
|
@@ -1,146 +1,192 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img width="807" height="152" alt="LMcode" src="https://github.com/user-attachments/assets/b589a9a5-ad1e-420a-aee0-f86c7ee06873" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>LMcode — 你的本地 AI Agent 助手</strong>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@liumir/lmcode"><img src="https://img.shields.io/npm/v/@liumir/lmcode?style=flat-square&logo=npm&logoColor=white" alt="npm version"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@liumir/lmcode"><img src="https://img.shields.io/npm/dm/@liumir/lmcode?style=flat-square&logo=npm&logoColor=white" alt="npm downloads"></a>
|
|
12
|
+
<a href="https://github.com/Lyin01/LMcode-cli/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Lyin01/LMcode-cli?style=flat-square" alt="license"></a>
|
|
13
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22.19.0-green?style=flat-square&logo=node.js&logoColor=white" alt="node version"></a>
|
|
14
|
+
<a href="https://github.com/Lyin01/LMcode-cli"><img src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey?style=flat-square" alt="platform"></a>
|
|
15
|
+
</p>
|
|
5
16
|
|
|
6
17
|
---
|
|
7
18
|
|
|
8
|
-
|
|
19
|
+
LMcode 是一款专注于中文场景的 AI Agent 助手。说人话,它做事——写代码、改文件、查资料、做研报、清理电脑、搜全网信息,你只管说需求,剩下的交给它。完全本地运行,数据不出门。
|
|
9
20
|
|
|
10
|
-
|
|
21
|
+
---
|
|
11
22
|
|
|
12
|
-
|
|
23
|
+
## 快速上手
|
|
13
24
|
|
|
14
|
-
|
|
25
|
+
### 安装
|
|
15
26
|
|
|
16
|
-
|
|
27
|
+
前置条件:**Node.js >= 22.19.0** 和 **Git**。
|
|
17
28
|
|
|
18
29
|
```bash
|
|
30
|
+
# npm 安装(全平台通用,推荐)
|
|
19
31
|
npm install -g @liumir/lmcode
|
|
20
32
|
```
|
|
21
|
-
|
|
33
|
+
|
|
34
|
+
macOS / Linux 也支持一键安装:
|
|
22
35
|
|
|
23
36
|
```bash
|
|
24
37
|
curl -fsSL https://raw.githubusercontent.com/Lyin01/LMcode-cli/main/install.sh | bash
|
|
25
38
|
```
|
|
26
39
|
|
|
27
|
-
|
|
40
|
+
Windows PowerShell:
|
|
28
41
|
|
|
29
42
|
```powershell
|
|
30
43
|
irm https://raw.githubusercontent.com/Lyin01/LMcode-cli/main/install.ps1 | iex
|
|
31
44
|
```
|
|
32
45
|
|
|
33
|
-
安装完成后,`lm` 命令自动加入 PATH
|
|
46
|
+
安装完成后,`lm` 命令自动加入 PATH。
|
|
34
47
|
|
|
35
|
-
|
|
48
|
+
### 首次启动
|
|
36
49
|
|
|
37
50
|
```bash
|
|
38
|
-
|
|
51
|
+
lm
|
|
39
52
|
```
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
首次启动时,如果检测到没有配置模型,会自动进入交互式配置向导(`/config`)。按提示输入 API 地址、密钥、模型型号即可完成配置。
|
|
44
|
-
|
|
45
|
-
**支持多个模型**(配置好后可用 `/model` 随时切换):
|
|
54
|
+
首次启动会自动进入配置向导,选择模型商(DeepSeek、OpenAI、Anthropic、通义千问、硅基流动等)并输入 API Key 即可开始。支持随时添加多模型,用 `/model` 命令切换。
|
|
46
55
|
|
|
47
|
-
|
|
56
|
+
### 一次性使用
|
|
48
57
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
当它要修改文件或执行命令时,会弹出审批面板:
|
|
54
|
-
|
|
55
|
-
按数字键选择,回车确认。所有提示都是中文。
|
|
58
|
+
```bash
|
|
59
|
+
lm "用 Python 写一个 Markdown 转 HTML 的脚本"
|
|
60
|
+
lm -p "解释这段代码" --output-format stream-json
|
|
61
|
+
```
|
|
56
62
|
|
|
57
63
|
---
|
|
58
64
|
|
|
59
|
-
##
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
## 核心特性
|
|
66
|
+
|
|
67
|
+
| 特性 | 说明 |
|
|
68
|
+
|------|------|
|
|
69
|
+
| 🎯 **Goal 自主循环** | 设定目标后自动多轮迭代执行,内置裁判 Agent 独立裁决目标是否达成。支持轮次/Token/时间预算控制 |
|
|
70
|
+
| 🐺 **Wolfpack 群狼模式** | 无限并发多 Agent 协同,自动拆解任务并行执行。内置 coder / explore / plan / verify / writer 五类子 Agent |
|
|
71
|
+
| 🧠 **永久记忆** | 跨会话记忆系统,Tag 语义 + 向量双重检索,越用越懂你的项目上下文。支持 dream 自动整理 |
|
|
72
|
+
| 💭 **思考模式** | 完整的 Thinking 交互体验——独立渲染区域、流式打字、6 档思考强度、展开/折叠控制,支持 Anthropic Adaptive Thinking |
|
|
73
|
+
| 🔌 **MCP 扩展** | 内置浏览器自动化、桌面控制 MCP,支持自行添加任意 MCP Server |
|
|
74
|
+
| 🎨 **技能中心** | 可下载/安装技能(Skill),扩展 Agent 能力 |
|
|
75
|
+
| 📱 **cc-connect** | 打通微信、飞书、企微、钉钉、QQ、Telegram 等平台,远程聊天控制 LMcode |
|
|
76
|
+
| 🔒 **权限引擎** | 精细控制读/写/执行权限,敏感文件默认保护。支持 yolo / auto / manual 三种模式 |
|
|
77
|
+
|
|
78
|
+
### 内置工具一览
|
|
79
|
+
|
|
80
|
+
| 工具 | 说明 |
|
|
81
|
+
|------|------|
|
|
82
|
+
| `Read` | 读取文件内容,支持分页 |
|
|
83
|
+
| `Write` | 写入文件,自动创建父目录 |
|
|
84
|
+
| `Edit` | 精确字符串替换编辑 |
|
|
85
|
+
| `MultiEdit` | 同一文件批量原子替换,任一失败整批回滚 |
|
|
86
|
+
| `Glob` | 文件搜索,支持花括号展开 `*.{ts,tsx}` |
|
|
87
|
+
| `Grep` | 内容搜索,支持正则 |
|
|
88
|
+
| `Bash` | 执行命令,支持后台任务 |
|
|
89
|
+
| `WebSearch` / `FetchURL` | 联网搜索与页面抓取 |
|
|
90
|
+
| `Agent` | 启动子 Agent 处理子任务,支持并行和后台 |
|
|
91
|
+
| `WolfPack` | 批量并行启动多个子 Agent |
|
|
75
92
|
|
|
76
93
|
---
|
|
77
94
|
|
|
78
|
-
##
|
|
95
|
+
## 命令参考
|
|
79
96
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
97
|
+
```bash
|
|
98
|
+
lm [options] [command] [prompt...]
|
|
99
|
+
|
|
100
|
+
命令:
|
|
101
|
+
export 导出 Markdown 格式的会话记录
|
|
102
|
+
stream-json 以 JSON 流模式运行(适合程序化调用)
|
|
103
|
+
cc-connect 配置远程聊天通道
|
|
104
|
+
|
|
105
|
+
选项:
|
|
106
|
+
-V, --version 输出版本号
|
|
107
|
+
-S, --session [id] 恢复会话。带 ID 直接恢复,不带 ID 交互选择
|
|
108
|
+
-C, --continue 继续当前目录的上一个会话
|
|
109
|
+
-y, --yolo 自动批准所有操作
|
|
110
|
+
--auto 自动权限模式
|
|
111
|
+
-m, --model <name> 指定模型别名
|
|
112
|
+
-p, --prompt [text] 非交互模式,提示文本也可放在末尾位置参数
|
|
113
|
+
--output-format <format> 输出格式:text | stream-json
|
|
114
|
+
--skills-dir <dir> 加载指定目录的技能
|
|
115
|
+
--plan 以计划模式启动
|
|
116
|
+
-h, --help 显示帮助
|
|
86
117
|
```
|
|
87
|
-
###第二步:打开 LMcode,输入/cc-connect 按照提示选择你要接入的平台(配置完毕后不要再次配置,否则会覆盖原有配置)
|
|
88
|
-
|
|
89
|
-
###第三步:按照步骤完成配置与链接后,输入命令启动后台守护进程(关闭 LMcode 也可在后台聊天)
|
|
90
118
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- *远程聊天会话默认走cc标识注入会话管理系统,可通过斜杠命令进入进行管理和删除,也可以直接在电脑端直接继承会话继续让 LMcode 完成工作
|
|
119
|
+
---
|
|
94
120
|
|
|
95
|
-
|
|
121
|
+
## 斜杠命令
|
|
122
|
+
|
|
123
|
+
在交互模式下,输入 `/` 可执行以下命令:
|
|
124
|
+
|
|
125
|
+
| 命令 | 说明 |
|
|
126
|
+
|------|------|
|
|
127
|
+
| `/goal` | 开启自主目标循环 |
|
|
128
|
+
| `/model` | 切换模型 / 管理多模型 |
|
|
129
|
+
| `/config` | 修改配置 |
|
|
130
|
+
| `/memory` | 打开记忆备忘录 |
|
|
131
|
+
| `/dream` | 整理和归档记忆 |
|
|
132
|
+
| `/sessions` | 浏览和恢复历史会话 |
|
|
133
|
+
| `/skills` | 管理技能 |
|
|
134
|
+
| `/update` | 检查并安装更新 |
|
|
135
|
+
| `/mode` | 切换权限模式(yolo / auto / manual) |
|
|
136
|
+
| `/thinking` | 控制思考模式开关 |
|
|
137
|
+
| `/cc-connect` | 配置远程聊天通道 |
|
|
138
|
+
| `/new` | 创建新会话 |
|
|
139
|
+
| `/export` | 导出当前会话 |
|
|
96
140
|
|
|
97
|
-
- /new 创建新会话
|
|
98
|
-
- /bind setup 开启文件传送功能,支持PDF、图片等
|
|
99
|
-
- /mode 查看可用模式
|
|
100
|
-
- /mode yolo 自动批准所有工具
|
|
101
|
-
- /mode default 每次工具调用前询问
|
|
102
141
|
---
|
|
103
142
|
|
|
104
|
-
##
|
|
143
|
+
## 更新日志
|
|
105
144
|
|
|
106
|
-
|
|
145
|
+
### 🚀 v0.7.0
|
|
107
146
|
|
|
108
|
-
|
|
147
|
+
**新功能**
|
|
148
|
+
- **MultiEdit 批量编辑工具** — 一次调用对同一文件做多处原子替换,任一失败整批回滚
|
|
149
|
+
- **Glob 花括号展开** — `*.{ts,tsx}`、`{src,test}/**/*.ts` 一次匹配多模式,支持嵌套与转义
|
|
109
150
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
| 默认权限 | `manual`(逐次审批) | `yolo`(自动批准) |
|
|
114
|
-
| 配置目录 | `~/.scream-code/` | `~/.lmcode/` |
|
|
115
|
-
| 品牌 | Scream Code | LMcode |
|
|
151
|
+
**修复 / 体验优化**
|
|
152
|
+
- **Write 自动创建父目录** — 写入不存在的目录自动 mkdir,消除二次往返
|
|
153
|
+
- **`-p` 参数顺序不再敏感** — `lm -p --output-format stream-json "..."` 任意顺序正确解析;裸文本 `lm "..."` 也可作为一次性提示
|
|
116
154
|
|
|
117
|
-
|
|
155
|
+
### 🚀 v0.6.0
|
|
118
156
|
|
|
119
|
-
|
|
157
|
+
**修复**
|
|
158
|
+
- **135 个 Windows 测试失败全部修复** — 覆盖路径归一化、SQLite EBUSY 清理、Hook 子进程、yolo 权限迁移等 10 类问题
|
|
159
|
+
- **Hook 子进程弹窗** — `spawn()` 添加 `windowsHide: true`,根治每次跑 hook 弹 conhost 窗口
|
|
160
|
+
- **品牌重命名遗留引用** — 218 处 scream → lmcode 全面覆盖
|
|
120
161
|
|
|
121
|
-
|
|
122
|
-
|
|
162
|
+
**性能优化**
|
|
163
|
+
- **linkedom / nunjucks 懒加载** — 避免静态打包 2MB+ 依赖,降低启动时间
|
|
164
|
+
- **系统提示词精简** — AGENTS.md 改为路径列表按需读取,移除冗余通用指令
|
|
165
|
+
- **embedding 存储优化** — JSON 字符串改为二进制 Float32Array Buffer
|
|
166
|
+
- **FTS 空结果回退优化** — 先前缀通配符再全表扫描
|
|
123
167
|
|
|
124
|
-
|
|
168
|
+
**清理**
|
|
169
|
+
- 安装脚本 `scream` → `lm` 命令修正
|
|
170
|
+
- 移除 migration 残留代码
|
|
171
|
+
- 添加 `.nvmrc`,配置简单 git hooks
|
|
125
172
|
|
|
126
|
-
|
|
173
|
+
### 🚀 v0.5.15
|
|
174
|
+
|
|
175
|
+
- Ctrl+A 全选输入框内容
|
|
176
|
+
- ROLE_ADDITIONAL 移至 system 提示词末尾
|
|
177
|
+
- Windows 测试基础设施全面修复
|
|
127
178
|
|
|
128
179
|
---
|
|
129
180
|
|
|
130
|
-
##
|
|
181
|
+
## 项目说明
|
|
131
182
|
|
|
132
|
-
|
|
183
|
+
LMcode 是基于个人使用习惯和对 Agent 系统的理解,从零搭建的一套工具型 Agent 框架。经历 Rust 原型膨胀的教训后,彻底转向 TypeScript,核心聚焦三件事:**并行调度 + 状态机 + 记忆系统的收敛设计**。整体架构借鉴了 Agent harness 的思路,吸收了多个开源项目的设计取舍。
|
|
133
184
|
|
|
134
|
-
|
|
185
|
+
项目的演进方向是成为一个稳定、高效、轻量的 Agent 底座——不追求功能堆叠,而是让每个机制都能在实际使用中站住脚。
|
|
135
186
|
|
|
136
|
-
|
|
137
|
-
<picture>
|
|
138
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=Lyin01/LMcode-cli&type=date&theme=dark&legend=top-left" />
|
|
139
|
-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=Lyin01/LMcode-cli&type=date&legend=top-left" />
|
|
140
|
-
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=Lyin01/LMcode-cli&type=date&legend=top-left" />
|
|
141
|
-
</picture>
|
|
142
|
-
</a>
|
|
187
|
+
> LMcode 基于 [Scream Code](https://github.com/LIUTod/scream-code) 二次开发,感谢原作者 [LIUTod](https://github.com/LIUTod) 的开源工作。
|
|
143
188
|
|
|
189
|
+
---
|
|
144
190
|
|
|
145
191
|
## License
|
|
146
192
|
|