@legna-lnc/legnacode 1.4.4 → 1.4.5

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +327 -313
  2. package/README.md +218 -171
  3. package/README.zh-CN.md +341 -0
  4. package/package.json +7 -7
package/README.md CHANGED
@@ -1,301 +1,348 @@
1
+ <div align="center">
2
+
1
3
  # LegnaCode CLI
2
- <img width="1256" height="416" alt="image" src="https://github.com/user-attachments/assets/5e4717e6-3404-4901-9f5c-1c6462fb1c1a" />
3
- <img width="1072" height="874" alt="image" src="https://github.com/user-attachments/assets/819c39e8-9db6-4d8d-b911-13600c525422" />
4
4
 
5
- LegnaCode 是一个基于 Anthropic Claude 的智能终端编程助手,让你直接在命令行中与 AI 协作完成软件工程任务——编辑文件、执行命令、搜索代码、管理 Git 工作流等。
5
+ **An AI-powered terminal programming assistant, supercharged.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@legna-lnc/legnacode?color=blue&label=npm)](https://www.npmjs.com/package/@legna-lnc/legnacode)
8
+ [![platforms](https://img.shields.io/badge/platforms-macOS%20%7C%20Linux%20%7C%20Windows-brightgreen)](#platform-support)
9
+ [![license](https://img.shields.io/badge/license-MIT-yellow)](./LICENSE)
10
+ [![Claude Code](https://img.shields.io/badge/based%20on-Claude%20Code-blueviolet)](https://github.com/anthropics/claude-code)
11
+
12
+ 🌐 [中文文档](./README.zh-CN.md) · 📊 [vs Claude Code](./COMPARISON.md) · 📋 [Changelog](./CHANGELOG.md)
6
13
 
7
- > 📊 **与 Claude Code 原版的详细对比** → [COMPARISON.md](./COMPARISON.md)
14
+ <img width="1256" height="416" alt="LegnaCode banner" src="https://github.com/user-attachments/assets/5e4717e6-3404-4901-9f5c-1c6462fb1c1a" />
15
+
16
+ </div>
8
17
 
9
18
  ---
10
19
 
11
- ## 更新日志
12
-
13
- 详见 [CHANGELOG.md](./CHANGELOG.md)
14
-
15
- | 版本 | 日期 | 摘要 |
16
- |------|------|------|
17
- | [1.4.4](./CHANGELOG.md#144---2026-04-11) | 2026-04-11 | 状态提示改为 spinner 行显示(不污染对话),新增功能对比文档 |
18
- | [1.4.3](./CHANGELOG.md#143---2026-04-11) | 2026-04-11 | mempalace 记忆架构融合(DrawerStore + TF-IDF 向量搜索 + 4 层记忆栈 + 时序知识图谱),token 节省 ~88% |
19
- | [1.4.2](./CHANGELOG.md#142---2026-04-11) | 2026-04-11 | 进度反馈增强(消除 8 个静默代码路径),verbose 默认开启,Token/Timer 即时显示,中断原因可见 |
20
- | [1.4.0](./CHANGELOG.md#140---2026-04-11) | 2026-04-11 | MiniMax 深度原生兼容(6 个多模态工具),RPC 子进程工具执行,Memory Provider 插件系统,智能模型路由,自主技能检测,上下文压缩增强,跨会话记忆搜索 |
21
- | [1.3.7](./CHANGELOG.md#137---2026-04-09) | 2026-04-09 | Resume 会话检测修复,Interrupted 诊断日志,后台任务状态可见性增强 |
22
- | [1.3.6](./CHANGELOG.md#136---2026-04-09) | 2026-04-09 | 修复 Windows 路径分隔符导致 Edit 工具 "File has been unexpectedly modified" 误报 |
23
- | [1.3.5](./CHANGELOG.md#135---2026-04-07) | 2026-04-07 | 修复 SessionStart hook 报错,Windows alt-screen 渲染深度修复(消除 fullReset 闪烁) |
24
- | [1.3.4](./CHANGELOG.md#134---2026-04-07) | 2026-04-07 | OML Superpowers 工程纪律(/verify /tdd /debug /brainstorm 等 11 个 skill),SessionStart 技能引导 |
25
- | [1.3.3](./CHANGELOG.md#133---2026-04-07) | 2026-04-07 | OML 智能编排层内置(magic keywords + 19 agent skills),Windows Terminal fullscreen 修复 |
26
- | [1.3.2](./CHANGELOG.md#132---2026-04-07) | 2026-04-07 | 禁用 History Snip,修复 Windows Terminal 流式文本渲染 |
27
- | [1.3.1](./CHANGELOG.md#131---2026-04-06) | 2026-04-06 | 修复 1M 模型被过早 snip 的问题,snip 阈值感知 context window 大小 |
28
- | [1.3.0](./CHANGELOG.md#130---2026-04-04) | 2026-04-04 | 项目本地化存储:会话/skills/memory/rules 下沉到 `<project>/.legna/`,全局迁移 `~/.claude/` → `~/.legna/`,`legna migrate` 命令 |
29
- | [1.2.1](./CHANGELOG.md#121---2026-04-04) | 2026-04-04 | 模型适配器层:MiMo、GLM、DeepSeek、Kimi、MiniMax 五大提供商深度兼容 |
30
- | [1.2.0](./CHANGELOG.md#120---2026-04-03) | 2026-04-03 | 会话按项目分组、resume 带 cd、迁移支持会话记录、Windows 原生编译 |
31
- | [1.1.9](./CHANGELOG.md#119---2026-04-03) | 2026-04-03 | postinstall 自动安装平台包,修复 Windows/镜像源 optionalDependencies 失效 |
32
- | [1.1.8](./CHANGELOG.md#118---2026-04-03) | 2026-04-03 | bin wrapper 自动安装缺失平台包,修复 Windows npm 全局安装问题 |
33
- | [1.1.7](./CHANGELOG.md#117---2026-04-03) | 2026-04-03 | 彻底修复 Windows external module 报错,清空 external 列表 |
34
- | [1.1.6](./CHANGELOG.md#116---2026-04-03) | 2026-04-03 | 修复 Windows external module 报错、全平台发版流程自动化、版本号统一 |
35
- | [1.1.5](./CHANGELOG.md#115---2026-04-03) | 2026-04-03 | WebUI 管理面板 (`legna admin`)、双目录管理、配置迁移、npm 全平台发布 |
36
- | [1.0.9](./CHANGELOG.md#109---2026-04-03) | 2026-04-03 | i18n 多语言补全、内置精美状态栏、配置自动迁移 |
37
- | [1.0.8](./CHANGELOG.md#108---2026-04-02) | 2026-04-02 | MONITOR_TOOL、WORKFLOW_SCRIPTS、HISTORY_SNIP,3 个重量级子系统,累计 47 flags |
38
- | [1.0.7](./CHANGELOG.md#107---2026-04-02) | 2026-04-02 | TERMINAL_PANEL、WEB_BROWSER_TOOL、TEMPLATES、BG_SESSIONS,累计 44 flags |
39
- | [1.0.6](./CHANGELOG.md#106---2026-04-02) | 2026-04-02 | CACHED_MICROCOMPACT、AGENT_TRIGGERS、TREE_SITTER_BASH 等 7 个功能,累计 40 flags |
40
- | [1.0.5](./CHANGELOG.md#105---2026-04-02) | 2026-04-02 | AGENT_TRIGGERS、MCP_SKILLS、REACTIVE_COMPACT、REVIEW_ARTIFACT 等 6 个功能,累计 39 flags |
41
- | [1.0.4](./CHANGELOG.md#104---2026-04-02) | 2026-04-02 | ULTRAPLAN、VERIFICATION_AGENT、AUTO_THEME 等 10 个功能,累计 33 flags |
42
- | [1.0.3](./CHANGELOG.md#103---2026-04-02) | 2026-04-02 | COMMIT_ATTRIBUTION、BASH_CLASSIFIER、EXTRACT_MEMORIES 等 16 个功能 |
43
- | [1.0.2](./CHANGELOG.md#102---2026-04-02) | 2026-04-02 | QUICK_SEARCH、MESSAGE_ACTIONS、FORK_SUBAGENT、HISTORY_PICKER |
44
- | [1.0.1](./CHANGELOG.md#101---2026-04-02) | 2026-04-02 | BUDDY 虚拟宠物、TOKEN_BUDGET、构建系统修复 |
45
- | [1.0.0](./CHANGELOG.md#100---2026-03-31) | 2026-03-31 | 初始发布 |
20
+ LegnaCode is built on top of [Claude Code CLI](https://github.com/anthropics/claude-code) with deep enhancements — fully compatible with the original, while adding multimodal tools, smarter memory, better UX, and more.
21
+
22
+ ### Highlights
23
+
24
+ 🧠 **88% less memory tokens** 4-layer memory stack with vector search replaces flat MEMORY.md injection\
25
+ 🎨 **6 multimodal tools** — Image, video, speech, music, vision, web search (MiniMax models)\
26
+ **Instant feedback** Token counter from second 1, status in spinner line, no silent operations\
27
+ 🔌 **Pluggable memory** DrawerStore (SQLite + TF-IDF), temporal knowledge graph, WAL audit\
28
+ 🤖 **Smarter agents** RPC subprocess execution, autonomous skill detection, smart model routing
46
29
 
47
30
  ---
48
31
 
49
- ## 致谢
32
+ ## Changelog
33
+
34
+ | Version | Summary |
35
+ |---------|---------|
36
+ | **1.4.5** | OpenViking content tiering (L0/L1/L2 degradation + budget-capped injection) |
37
+ | **1.4.4** | Status messages → spinner line; comparison doc |
38
+ | **1.4.3** | Mempalace memory fusion (DrawerStore + TF-IDF + 4-layer stack + knowledge graph) |
39
+ | **1.4.2** | Progress feedback (8 silent paths fixed); verbose default on |
40
+ | **1.4.0** | MiniMax multimodal (6 tools); RPC execution; Memory Provider; smart routing |
41
+
42
+ <details>
43
+ <summary>Older versions</summary>
44
+
45
+ | Version | Summary |
46
+ |---------|---------|
47
+ | 1.3.6 | Windows path separator fix for Edit tool |
48
+ | 1.3.5 | SessionStart hook fix; Windows alt-screen rendering |
49
+ | 1.3.4 | OML Superpowers (11 skills); SessionStart guidance |
50
+ | 1.3.3 | OML smart orchestration (19 agent skills) |
51
+ | 1.3.2 | Disabled History Snip; Windows streaming fix |
52
+ | 1.3.1 | 1M model snip threshold fix |
53
+ | 1.3.0 | Project-local storage; `legna migrate` |
54
+ | 1.2.1 | Model adapter layer (MiMo, GLM, DeepSeek, Kimi, MiniMax) |
55
+ | 1.2.0 | Sessions grouped by project; native Windows compilation |
56
+ | 1.1.5–1.1.9 | Windows install fixes; WebUI admin panel |
57
+ | 1.0.0–1.0.9 | Initial release; feature flags; i18n; BUDDY pet |
58
+
59
+ </details>
60
+
61
+ Full details → [CHANGELOG.md](./CHANGELOG.md)
50
62
 
51
- 本项目基于 [Claude Code CLI](https://github.com/anthropics/claude-code) 的公开源码构建。
63
+ ---
52
64
 
53
- Claude Code 是 Anthropic 团队打造的一款出色的终端 AI 编程工具,它开创性地将大语言模型与命令行开发工作流深度融合,提供了文件编辑、代码搜索、Shell 执行、MCP 协议等丰富能力。LegnaCode 站在这个优秀项目的肩膀上,进行了定制化改造和品牌适配。
65
+ ## Acknowledgments
54
66
 
55
- 感谢 Anthropic 团队将 Claude Code CLI 开源,让社区能够在此基础上探索更多可能性。
67
+ Built on [Claude Code CLI](https://github.com/anthropics/claude-code) by Anthropic — the pioneering terminal AI programming tool. LegnaCode extends it with multimodal capabilities, smarter memory, and enhanced UX while maintaining full upstream compatibility. Thanks to the Anthropic team for open-sourcing this excellent foundation.
56
68
 
57
69
  ---
58
70
 
59
- ## 特性
60
-
61
- - **MiniMax 深度原生兼容** — 使用 MiniMax 模型时自动注册 6 个多模态工具(图像/视频/语音/音乐/搜索/视觉),`/auth-minimax` 配置 API key
62
- - **终端原生体验** — 基于 React + Ink 构建的现代终端 UI,支持语法高亮、结构化 Diff 展示
63
- - **45+ 内置工具** — 文件读写、代码搜索(Glob/Grep)、Shell 执行、Web 抓取、Jupyter Notebook 编辑等
64
- - **RPC 子进程工具执行** — AI 生成的脚本通过 Unix Domain Socket 回调 LegnaCode 工具,多步操作压缩为一次推理
65
- - **Memory Provider 插件系统** 可插拔的记忆后端,内置文件系统 provider,支持外部 provider 扩展
66
- - **智能模型路由** 基于 prompt 复杂度自动路由到 fast/default/strong 模型层
67
- - **自主技能检测** — 检测重复工具调用模式,提示保存为可复用技能
68
- - **上下文压缩增强** — 工具输出预剪枝 + 预算压力注入,长对话更高效
69
- - **跨会话记忆搜索** — `/recall` 命令搜索历史会话,关键词匹配 + 相关性排序
70
- - **多层安全防护** — Bash/Zsh/PowerShell 命令安全检测、沙箱机制、权限分级控制
71
- - **多云 AI 后端** — 支持 Anthropic API、AWS Bedrock、GCP Vertex、Azure
72
- - **MCP 协议支持** — 通过 Model Context Protocol 连接外部工具和数据源
73
- - **多 Agent 协作** — 支持子 Agent 派生、团队协作、任务编排
74
- - **插件与技能系统** 可扩展的插件架构和可复用的技能工作流
75
- - **持久化记忆** 跨会话的上下文记忆系统
76
- - **纯 TS 语法高亮** — 内置基于 highlight.js 的纯 TypeScript 语法高亮实现,无需原生模块依赖
77
- - **WebUI 管理面板** — `legna admin` 启动浏览器管理面板,可视化编辑配置、切换配置文件、浏览会话记录、迁移数据
78
- - **`legna migrate` 命令** — 手动迁移 `~/.claude/` 数据到项目本地 `.legna/`,支持 `--global`/`--sessions`/`--dry-run`
71
+ ## Features
72
+
73
+ <table>
74
+ <tr><td>
75
+
76
+ **🎨 Multimodal** (MiniMax)
77
+ - Image / Video / Speech generation
78
+ - Music generation / Vision / Web search
79
+ - Auto-orchestrated pipelines
80
+ - `/auth-minimax` configuration
81
+
82
+ </td><td>
83
+
84
+ **🧠 Memory**
85
+ - 4-layer stack (~800 tokens/turn)
86
+ - TF-IDF vector search (<5ms)
87
+ - Temporal knowledge graph
88
+ - PreCompact auto-save
89
+
90
+ </td></tr>
91
+ <tr><td>
92
+
93
+ **⚡ Agent**
94
+ - RPC subprocess tool execution
95
+ - Smart model routing
96
+ - Autonomous skill detection
97
+ - Cross-session `/recall` search
98
+
99
+ </td><td>
100
+
101
+ **🛡️ Core**
102
+ - 45+ built-in tools
103
+ - Multi-cloud backends
104
+ - MCP protocol support
105
+ - Multi-agent collaboration
106
+
107
+ </td></tr>
108
+ <tr><td>
109
+
110
+ **🖥️ UX**
111
+ - Verbose on by default
112
+ - Token counter from second 1
113
+ - Status in spinner line
114
+ - Interrupt reason visible
115
+
116
+ </td><td>
117
+
118
+ **🔧 DevOps**
119
+ - WebUI admin panel
120
+ - `legna migrate` tool
121
+ - Pure TS syntax highlighting
122
+ - Cross-platform binaries
123
+
124
+ </td></tr>
125
+ </table>
79
126
 
80
127
  ---
81
128
 
82
- ## 环境要求
129
+ ## Requirements
83
130
 
84
- | 依赖 | 版本 |
85
- |------|------|
131
+ | Dependency | Version |
132
+ |------------|---------|
86
133
  | [Bun](https://bun.sh) | >= 1.2.0 |
87
- | Node.js | >= 18(可选) |
134
+ | Node.js | >= 18 (optional) |
88
135
  | Git | >= 2.0 |
89
- | 操作系统 | macOS / Linux |
136
+ | OS | macOS / Linux |
90
137
 
91
138
  ---
92
139
 
93
- ## 安装
140
+ ## Installation
94
141
 
95
- ### 方式一:npm 全局安装(推荐)
142
+ ### Option 1: npm Global Install (Recommended)
96
143
 
97
144
  ```bash
98
145
  npm install -g @legna-lnc/legnacode
99
146
  ```
100
147
 
101
- 如果使用镜像源(如 cnpm、淘宝源)安装失败或版本未同步,可指定官方源安装:
148
+ If using a mirror registry (e.g., cnpm, Taobao mirror) and the install fails or the version is out of sync, you can specify the official registry:
102
149
 
103
150
  ```bash
104
151
  npm install -g @legna-lnc/legnacode --registry=https://registry.npmjs.org
105
152
  ```
106
153
 
107
- 安装后即可在任意目录使用 `legna` 命令。会自动下载当前平台的预编译二进制(支持 macOS arm64/x64Linux x64/arm64Windows x64)。
154
+ Once installed, the `legna` command is available in any directory. It automatically downloads the precompiled binary for your platform (supports macOS arm64/x64, Linux x64/arm64, Windows x64).
108
155
 
109
156
  ```bash
110
- # 验证安装
157
+ # Verify installation
111
158
  legna --version
112
159
 
113
- # 更新到最新版
160
+ # Update to the latest version
114
161
  npm update -g @legna-lnc/legnacode
115
162
  ```
116
163
 
117
- ### 方式二:从源码编译
164
+ ### Option 2: Build from Source
118
165
 
119
166
  ```bash
120
167
  git clone https://github.com/LegnaOS/LegnaCode-cli.git
121
168
  cd LegnaCode-cli
122
169
  bun install
123
170
  bun run compile
124
- # 编译产物为 ./legna,可移动到 PATH
171
+ # The compiled binary is ./legna — move it to your PATH
125
172
  ```
126
173
 
127
174
  ---
128
175
 
129
- ## 快速开始
176
+ ## Quick Start
130
177
 
131
178
  ```bash
132
- # 交互模式
179
+ # Interactive mode
133
180
  legna
134
181
 
135
- # 非交互模式(直接提问)
136
- legna -p "解释这段代码的作用"
182
+ # Non-interactive mode (ask directly)
183
+ legna -p "Explain what this code does"
137
184
 
138
- # 继续上次会话
185
+ # Continue the last session
139
186
  legna --continue
140
187
 
141
- # 查看版本
188
+ # Check version
142
189
  legna --version
143
190
  ```
144
191
 
145
192
  ---
146
193
 
147
- ## 项目结构
194
+ ## Project Structure
148
195
 
149
196
  ```
150
197
  ├── src/
151
- │ ├── entrypoints/ # 入口文件(cli.tsx
152
- │ ├── server/ # HTTP 服务器(admin WebUI
153
- │ ├── components/ # React/Ink 终端 UI 组件
154
- │ ├── tools/ # 内置工具(Bash、文件操作、搜索等)
155
- │ ├── services/ # API 调用、MCP 客户端、分析等
156
- │ ├── native-ts/ # TS 实现的原生模块替代(语法高亮等)
157
- │ ├── utils/ # 工具函数
198
+ │ ├── entrypoints/ # Entry point (cli.tsx)
199
+ │ ├── server/ # HTTP server (admin WebUI)
200
+ │ ├── components/ # React/Ink terminal UI components
201
+ │ ├── tools/ # Built-in tools (Bash, file ops, search, etc.)
202
+ │ ├── services/ # API calls, MCP client, analytics, etc.
203
+ │ ├── native-ts/ # Pure TS replacements for native modules (syntax highlighting, etc.)
204
+ │ ├── utils/ # Utility functions
158
205
  │ └── hooks/ # React hooks
159
- ├── webui/ # Admin WebUI 前端(React + Vite + Tailwind
160
- ├── stubs/ # 原生模块的 stub(编译时外部依赖占位)
161
- ├── scripts/ # 构建脚本
162
- ├── bunfig.toml # Bun 构建配置(Feature Flags、宏定义)
206
+ ├── webui/ # Admin WebUI frontend (React + Vite + Tailwind)
207
+ ├── stubs/ # Native module stubs (compile-time external dependency placeholders)
208
+ ├── scripts/ # Build scripts
209
+ ├── bunfig.toml # Bun build config (Feature Flags, macro definitions)
163
210
  └── package.json
164
211
  ```
165
212
 
166
213
  ---
167
214
 
168
- ## 构建说明
215
+ ## Build
169
216
 
170
- LegnaCode 使用 Bun bundler 进行构建,支持两种模式:
217
+ LegnaCode uses Bun's bundler for building, with two modes:
171
218
 
172
- - `bun run build` — 构建到 `dist/` 目录,适合开发调试
173
- - `bun run compile` — 编译为独立二进制 `legna`,无需 Bun 运行时
219
+ - `bun run build` — Build to `dist/` directory, suitable for development and debugging
220
+ - `bun run compile` — Compile to a standalone `legna` binary, no Bun runtime required
174
221
 
175
222
  ### Admin WebUI
176
223
 
177
- `legna admin` 启动一个浏览器管理面板,让你通过 Web 界面管理所有配置,无需手动编辑 JSON 文件。
224
+ `legna admin` launches a browser-based admin panel that lets you manage all configuration through a web interface — no manual JSON editing needed.
178
225
 
179
226
  ```bash
180
- # 启动管理面板(默认端口 3456,自动打开浏览器)
227
+ # Launch admin panel (default port 3456, auto-opens browser)
181
228
  legna admin
182
229
 
183
- # 自定义端口
230
+ # Custom port
184
231
  legna admin 8080
185
232
  ```
186
233
 
187
- 面板顶部通过 Tab 切换管理对象:**Claude** (`~/.claude/`) **LegnaCode** (`~/.legna/`),每个 scope 下提供四个功能面板:
234
+ Tabs at the top of the panel switch between management scopes: **Claude** (`~/.claude/`) and **LegnaCode** (`~/.legna/`). Each scope provides four panels:
188
235
 
189
- | 面板 | 功能 |
190
- |------|------|
191
- | 配置编辑 | 可视化编辑 settings.jsonAPI 端点、API Key、模型映射(Opus/Sonnet/Haiku)、超时、权限模式、语言等 |
192
- | 配置文件 | 列出所有 settings*.json,显示 baseUrl/model,一键切换激活配置 |
193
- | 会话记录 | 浏览历史会话,显示项目路径、slug、时间、prompt 数量,一键复制 `legna --resume` 命令 |
194
- | 配置迁移 | Claude ↔ LegnaCode 双向迁移,支持全量或选择性字段迁移,迁移前预览 diff |
236
+ | Panel | Function |
237
+ |-------|----------|
238
+ | Config Editor | Visual editing of settings.json: API endpoint, API key, model mapping (Opus/Sonnet/Haiku), timeout, permission mode, language, etc. |
239
+ | Config Profiles | Lists all settings*.json files, shows baseUrl/model, one-click to switch active profile |
240
+ | Session History | Browse past sessions showing project path, slug, timestamp, prompt count; one-click copy `legna --resume` command |
241
+ | Config Migration | Bidirectional Claude ↔ LegnaCode migration; supports full or selective field migration with pre-migration diff preview |
195
242
 
196
- > 从源码运行时需要先构建前端:`cd webui && npm install && npm run build`,然后 `bun run src/server/admin.ts`。npm 全局安装的版本已包含预构建的 WebUI
243
+ > When running from source, build the frontend first: `cd webui && npm install && npm run build`, then `bun run src/server/admin.ts`. The npm global install version includes the pre-built WebUI.
197
244
 
198
- 构建时通过 `bunfig.toml` 中的 `[bundle.define]` 注入版本号等编译时常量,通过 `[bundle.features]` 控制 Feature Flags 实现死代码消除。
245
+ Build-time constants such as version numbers are injected via `[bundle.define]` in `bunfig.toml`. Feature Flags in `[bundle.features]` enable dead code elimination.
199
246
 
200
- 原生模块(`color-diff-napi`、`modifiers-napi` 等)标记为 `external`,运行时从 `stubs/` 加载占位实现。语法高亮已切换为 `src/native-ts/color-diff/` 下的纯 TypeScript 实现,无需任何原生编译依赖。
247
+ Native modules (`color-diff-napi`, `modifiers-napi`, etc.) are marked as `external` and load placeholder implementations from `stubs/` at runtime. Syntax highlighting has been switched to a pure TypeScript implementation under `src/native-ts/color-diff/`, requiring no native compilation dependencies.
201
248
 
202
249
  ---
203
250
 
204
- ## 配置
251
+ ## Configuration
205
252
 
206
- LegnaCode 使用 `~/.legna/` 作为全局配置目录,项目级数据存储在 `<project>/.legna/`:
253
+ LegnaCode uses `~/.legna/` as the global config directory, with project-level data stored in `<project>/.legna/`:
207
254
 
208
- - `~/.legna/settings.json` — 全局用户设置
209
- - `~/.legna/.credentials.json` — 认证凭据
210
- - `<project>/.legna/sessions/` — 项目会话记录(JSONL
211
- - `<project>/.legna/skills/` — 项目技能
212
- - `<project>/.legna/rules/` — 项目规则
213
- - `<project>/.legna/settings.json` — 项目级设置
214
- - `LEGNA.md` — 项目指令文件,AI 会自动读取并遵循
255
+ - `~/.legna/settings.json` — Global user settings
256
+ - `~/.legna/.credentials.json` — Authentication credentials
257
+ - `<project>/.legna/sessions/` — Project session records (JSONL)
258
+ - `<project>/.legna/skills/` — Project skills
259
+ - `<project>/.legna/rules/` — Project rules
260
+ - `<project>/.legna/settings.json` — Project-level settings
261
+ - `LEGNA.md` — Project instruction file, automatically read and followed by the AI
215
262
 
216
- > 首次启动时自动从 `~/.claude/` 单向迁移全局数据到 `~/.legna/`(不覆盖已有文件)。旧的 `~/.claude/projects/` 会话通过 fallback 链自动读取,无需手动迁移。设置 `LEGNA_NO_CONFIG_SYNC=1` 可禁止自动迁移。
263
+ > On first launch, global data is automatically migrated one-way from `~/.claude/` to `~/.legna/` (existing files are not overwritten). Legacy sessions under `~/.claude/projects/` are read automatically via a fallback chain — no manual migration needed. Set `LEGNA_NO_CONFIG_SYNC=1` to disable automatic migration.
217
264
 
218
265
  ### legna migrate
219
266
 
220
- 手动迁移数据:
267
+ Manually migrate data:
221
268
 
222
269
  ```bash
223
- # 迁移全部(全局 + 当前项目会话)
270
+ # Migrate everything (global + current project sessions)
224
271
  legna migrate
225
272
 
226
- # 仅迁移全局数据 ~/.claude/ → ~/.legna/
273
+ # Migrate global data only: ~/.claude/ → ~/.legna/
227
274
  legna migrate --global
228
275
 
229
- # 仅迁移当前项目会话到本地 .legna/sessions/
276
+ # Migrate current project sessions to local .legna/sessions/ only
230
277
  legna migrate --sessions
231
278
 
232
- # 预览模式(不实际移动文件)
279
+ # Dry run (no files are actually moved)
233
280
  legna migrate --dry-run
234
281
  ```
235
282
 
236
- ### 环境变量
283
+ ### Environment Variables
237
284
 
238
- | 变量 | 说明 |
239
- |------|------|
240
- | `ANTHROPIC_API_KEY` | Anthropic API 密钥 |
241
- | `CLAUDE_CODE_USE_BEDROCK` | 使用 AWS Bedrock 后端 |
242
- | `CLAUDE_CODE_USE_VERTEX` | 使用 GCP Vertex 后端 |
243
- | `CLAUDE_CODE_SYNTAX_HIGHLIGHT` | 设为 `0` 禁用语法高亮 |
244
- | `MINIMAX_API_KEY` | MiniMax API 密钥(启用多模态工具) |
245
- | `MINIMAX_REGION` | MiniMax 区域:`global`(默认)或 `cn` |
246
- | `MINIMAX_BASE_URL` | 自定义 MiniMax API 地址(覆盖区域默认值) |
285
+ | Variable | Description |
286
+ |----------|-------------|
287
+ | `ANTHROPIC_API_KEY` | Anthropic API key |
288
+ | `CLAUDE_CODE_USE_BEDROCK` | Use AWS Bedrock backend |
289
+ | `CLAUDE_CODE_USE_VERTEX` | Use GCP Vertex backend |
290
+ | `CLAUDE_CODE_SYNTAX_HIGHLIGHT` | Set to `0` to disable syntax highlighting |
291
+ | `MINIMAX_API_KEY` | MiniMax API key (enables multimodal tools) |
292
+ | `MINIMAX_REGION` | MiniMax region: `global` (default) or `cn` |
293
+ | `MINIMAX_BASE_URL` | Custom MiniMax API URL (overrides region default) |
247
294
 
248
295
  ---
249
296
 
250
- ## MiniMax 多模态集成
297
+ ## MiniMax Multimodal Integration
251
298
 
252
- 当使用 MiniMax 模型(`ANTHROPIC_BASE_URL` 指向 `api.minimax.io` `api.minimaxi.com`)且配置了 `MINIMAX_API_KEY` 时,LegnaCode 自动注册 6 个多模态原生工具,AI 可以直接调用。
299
+ When using a MiniMax model (`ANTHROPIC_BASE_URL` pointing to `api.minimax.io` or `api.minimaxi.com`) with `MINIMAX_API_KEY` configured, LegnaCode automatically registers 6 native multimodal tools that the AI can call directly.
253
300
 
254
- ### 配置
301
+ ### Configuration
255
302
 
256
303
  ```bash
257
- # 方式一:环境变量
304
+ # Option 1: Environment variables
258
305
  export MINIMAX_API_KEY="your-api-key"
259
- export MINIMAX_REGION="global" # "cn"
306
+ export MINIMAX_REGION="global" # or "cn"
260
307
 
261
- # 方式二:交互式配置(持久化到 ~/.legna/minimax-credentials.json
308
+ # Option 2: Interactive configuration (persisted to ~/.legna/minimax-credentials.json)
262
309
  legna
263
310
  > /auth-minimax your-api-key
264
311
  ```
265
312
 
266
- API key 获取:[MiniMax 国际站](https://platform.minimax.io) [MiniMax 国内站](https://platform.minimaxi.com)
313
+ Get your API key: [MiniMax Global](https://platform.minimax.io) or [MiniMax China](https://platform.minimaxi.com)
267
314
 
268
- ### 多模态工具
315
+ ### Multimodal Tools
269
316
 
270
- | 工具 | 功能 | 示例 |
271
- |------|------|------|
272
- | `MiniMaxImageGenerate` | 文字生成图像 | "生成一张赛博朋克风格的城市夜景" |
273
- | `MiniMaxVideoGenerate` | 文字/图像生成视频 | "把这张图片做成一段 5 秒的动画" |
274
- | `MiniMaxSpeechSynthesize` | 文字转语音 | "把这段文字转成语音朗读" |
275
- | `MiniMaxMusicGenerate` | 文字生成音乐 | "生成一段轻快的钢琴背景音乐" |
276
- | `MiniMaxVisionDescribe` | 图像理解分析 | "描述这张图片的内容" |
277
- | `MiniMaxWebSearch` | 网页搜索 | "搜索最新的 TypeScript 5.x 特性" |
317
+ | Tool | Function | Example |
318
+ |------|----------|---------|
319
+ | `MiniMaxImageGenerate` | Text-to-image generation | "Generate a cyberpunk cityscape at night" |
320
+ | `MiniMaxVideoGenerate` | Text/image-to-video generation | "Turn this image into a 5-second animation" |
321
+ | `MiniMaxSpeechSynthesize` | Text-to-speech | "Convert this text to spoken audio" |
322
+ | `MiniMaxMusicGenerate` | Text-to-music generation | "Generate an upbeat piano background track" |
323
+ | `MiniMaxVisionDescribe` | Image understanding and analysis | "Describe the contents of this image" |
324
+ | `MiniMaxWebSearch` | Web search | "Search for the latest TypeScript 5.x features" |
278
325
 
279
- 工具仅在使用 MiniMax 模型时自动启用,不影响其他模型的工具列表。
326
+ These tools are only enabled when using MiniMax models and do not affect the tool list for other models.
280
327
 
281
- ### 多模态工作流
328
+ ### Multimodal Workflow
282
329
 
283
- AI 可以自动编排多个工具完成复杂任务:
330
+ The AI can automatically orchestrate multiple tools to complete complex tasks:
284
331
 
285
332
  ```
286
- 用户:帮我做一个项目宣传视频
287
-
288
- AI 自动编排:
289
- 1. 分析项目 README,提取核心卖点
290
- 2. MiniMaxImageGenerate → 生成关键帧图片
291
- 3. MiniMaxVideoGenerate → 基于关键帧生成视频
292
- 4. MiniMaxSpeechSynthesize → 生成旁白配音
293
- 5. 返回所有生成资源的 URL
333
+ User: Help me create a promotional video for my project
334
+
335
+ AI auto-orchestrates:
336
+ 1. Analyze the project README, extract key selling points
337
+ 2. MiniMaxImageGenerate → Generate keyframe images
338
+ 3. MiniMaxVideoGenerate → Generate video from keyframes
339
+ 4. MiniMaxSpeechSynthesize → Generate narration voiceover
340
+ 5. Return URLs for all generated assets
294
341
  ```
295
342
 
296
- ### Schema 导出
343
+ ### Schema Export
297
344
 
298
- MiniMax 工具的 schema 可以导出为 Anthropic 兼容格式,用于外部集成:
345
+ MiniMax tool schemas can be exported in Anthropic-compatible format for external integration:
299
346
 
300
347
  ```typescript
301
348
  import { exportMiniMaxToolSchemasJSON } from './src/tools/MiniMaxTools/schemaExport.js'
@@ -304,14 +351,14 @@ console.log(exportMiniMaxToolSchemasJSON())
304
351
 
305
352
  ---
306
353
 
307
- ## 许可证
354
+ ## License
308
355
 
309
- 本项目遵循上游 Claude Code CLI 的开源许可协议。详见 [Claude Code CLI](https://github.com/anthropics/claude-code) 原始仓库。
356
+ This project follows the open-source license of the upstream Claude Code CLI. See the [Claude Code CLI](https://github.com/anthropics/claude-code) original repository for details.
310
357
 
311
358
  ---
312
359
 
313
- ## 相关链接
360
+ <div align="center">
361
+
362
+ **[Claude Code CLI](https://github.com/anthropics/claude-code)** · **[Anthropic](https://www.anthropic.com)** · **[Model Context Protocol](https://modelcontextprotocol.io)**
314
363
 
315
- - [Claude Code CLI(上游项目)](https://github.com/anthropics/claude-code)
316
- - [Anthropic](https://www.anthropic.com)
317
- - [Model Context Protocol](https://modelcontextprotocol.io)
364
+ </div>