@legna-lnc/legnacode 1.4.3 → 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 +332 -310
  2. package/README.md +219 -169
  3. package/README.zh-CN.md +341 -0
  4. package/package.json +7 -7
package/README.md CHANGED
@@ -1,298 +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)
13
+
14
+ <img width="1256" height="416" alt="LegnaCode banner" src="https://github.com/user-attachments/assets/5e4717e6-3404-4901-9f5c-1c6462fb1c1a" />
15
+
16
+ </div>
6
17
 
7
18
  ---
8
19
 
9
- ## 更新日志
10
-
11
- 详见 [CHANGELOG.md](./CHANGELOG.md)
12
-
13
- | 版本 | 日期 | 摘要 |
14
- |------|------|------|
15
- | [1.4.3](./CHANGELOG.md#143---2026-04-11) | 2026-04-11 | mempalace 记忆架构融合(DrawerStore + TF-IDF 向量搜索 + 4 层记忆栈 + 时序知识图谱),token 节省 ~88% |
16
- | [1.4.2](./CHANGELOG.md#142---2026-04-11) | 2026-04-11 | 进度反馈增强(消除 8 个静默代码路径),verbose 默认开启,Token/Timer 即时显示,中断原因可见 |
17
- | [1.4.0](./CHANGELOG.md#140---2026-04-11) | 2026-04-11 | MiniMax 深度原生兼容(6 个多模态工具),RPC 子进程工具执行,Memory Provider 插件系统,智能模型路由,自主技能检测,上下文压缩增强,跨会话记忆搜索 |
18
- | [1.3.7](./CHANGELOG.md#137---2026-04-09) | 2026-04-09 | Resume 会话检测修复,Interrupted 诊断日志,后台任务状态可见性增强 |
19
- | [1.3.6](./CHANGELOG.md#136---2026-04-09) | 2026-04-09 | 修复 Windows 路径分隔符导致 Edit 工具 "File has been unexpectedly modified" 误报 |
20
- | [1.3.5](./CHANGELOG.md#135---2026-04-07) | 2026-04-07 | 修复 SessionStart hook 报错,Windows alt-screen 渲染深度修复(消除 fullReset 闪烁) |
21
- | [1.3.4](./CHANGELOG.md#134---2026-04-07) | 2026-04-07 | OML Superpowers 工程纪律(/verify /tdd /debug /brainstorm 等 11 个 skill),SessionStart 技能引导 |
22
- | [1.3.3](./CHANGELOG.md#133---2026-04-07) | 2026-04-07 | OML 智能编排层内置(magic keywords + 19 agent skills),Windows Terminal fullscreen 修复 |
23
- | [1.3.2](./CHANGELOG.md#132---2026-04-07) | 2026-04-07 | 禁用 History Snip,修复 Windows Terminal 流式文本渲染 |
24
- | [1.3.1](./CHANGELOG.md#131---2026-04-06) | 2026-04-06 | 修复 1M 模型被过早 snip 的问题,snip 阈值感知 context window 大小 |
25
- | [1.3.0](./CHANGELOG.md#130---2026-04-04) | 2026-04-04 | 项目本地化存储:会话/skills/memory/rules 下沉到 `<project>/.legna/`,全局迁移 `~/.claude/` → `~/.legna/`,`legna migrate` 命令 |
26
- | [1.2.1](./CHANGELOG.md#121---2026-04-04) | 2026-04-04 | 模型适配器层:MiMo、GLM、DeepSeek、Kimi、MiniMax 五大提供商深度兼容 |
27
- | [1.2.0](./CHANGELOG.md#120---2026-04-03) | 2026-04-03 | 会话按项目分组、resume 带 cd、迁移支持会话记录、Windows 原生编译 |
28
- | [1.1.9](./CHANGELOG.md#119---2026-04-03) | 2026-04-03 | postinstall 自动安装平台包,修复 Windows/镜像源 optionalDependencies 失效 |
29
- | [1.1.8](./CHANGELOG.md#118---2026-04-03) | 2026-04-03 | bin wrapper 自动安装缺失平台包,修复 Windows npm 全局安装问题 |
30
- | [1.1.7](./CHANGELOG.md#117---2026-04-03) | 2026-04-03 | 彻底修复 Windows external module 报错,清空 external 列表 |
31
- | [1.1.6](./CHANGELOG.md#116---2026-04-03) | 2026-04-03 | 修复 Windows external module 报错、全平台发版流程自动化、版本号统一 |
32
- | [1.1.5](./CHANGELOG.md#115---2026-04-03) | 2026-04-03 | WebUI 管理面板 (`legna admin`)、双目录管理、配置迁移、npm 全平台发布 |
33
- | [1.0.9](./CHANGELOG.md#109---2026-04-03) | 2026-04-03 | i18n 多语言补全、内置精美状态栏、配置自动迁移 |
34
- | [1.0.8](./CHANGELOG.md#108---2026-04-02) | 2026-04-02 | MONITOR_TOOL、WORKFLOW_SCRIPTS、HISTORY_SNIP,3 个重量级子系统,累计 47 flags |
35
- | [1.0.7](./CHANGELOG.md#107---2026-04-02) | 2026-04-02 | TERMINAL_PANEL、WEB_BROWSER_TOOL、TEMPLATES、BG_SESSIONS,累计 44 flags |
36
- | [1.0.6](./CHANGELOG.md#106---2026-04-02) | 2026-04-02 | CACHED_MICROCOMPACT、AGENT_TRIGGERS、TREE_SITTER_BASH 等 7 个功能,累计 40 flags |
37
- | [1.0.5](./CHANGELOG.md#105---2026-04-02) | 2026-04-02 | AGENT_TRIGGERS、MCP_SKILLS、REACTIVE_COMPACT、REVIEW_ARTIFACT 等 6 个功能,累计 39 flags |
38
- | [1.0.4](./CHANGELOG.md#104---2026-04-02) | 2026-04-02 | ULTRAPLAN、VERIFICATION_AGENT、AUTO_THEME 等 10 个功能,累计 33 flags |
39
- | [1.0.3](./CHANGELOG.md#103---2026-04-02) | 2026-04-02 | COMMIT_ATTRIBUTION、BASH_CLASSIFIER、EXTRACT_MEMORIES 等 16 个功能 |
40
- | [1.0.2](./CHANGELOG.md#102---2026-04-02) | 2026-04-02 | QUICK_SEARCH、MESSAGE_ACTIONS、FORK_SUBAGENT、HISTORY_PICKER |
41
- | [1.0.1](./CHANGELOG.md#101---2026-04-02) | 2026-04-02 | BUDDY 虚拟宠物、TOKEN_BUDGET、构建系统修复 |
42
- | [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
43
29
 
44
30
  ---
45
31
 
46
- ## 致谢
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)
47
62
 
48
- 本项目基于 [Claude Code CLI](https://github.com/anthropics/claude-code) 的公开源码构建。
63
+ ---
49
64
 
50
- Claude Code 是 Anthropic 团队打造的一款出色的终端 AI 编程工具,它开创性地将大语言模型与命令行开发工作流深度融合,提供了文件编辑、代码搜索、Shell 执行、MCP 协议等丰富能力。LegnaCode 站在这个优秀项目的肩膀上,进行了定制化改造和品牌适配。
65
+ ## Acknowledgments
51
66
 
52
- 感谢 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.
53
68
 
54
69
  ---
55
70
 
56
- ## 特性
57
-
58
- - **MiniMax 深度原生兼容** — 使用 MiniMax 模型时自动注册 6 个多模态工具(图像/视频/语音/音乐/搜索/视觉),`/auth-minimax` 配置 API key
59
- - **终端原生体验** — 基于 React + Ink 构建的现代终端 UI,支持语法高亮、结构化 Diff 展示
60
- - **45+ 内置工具** — 文件读写、代码搜索(Glob/Grep)、Shell 执行、Web 抓取、Jupyter Notebook 编辑等
61
- - **RPC 子进程工具执行** — AI 生成的脚本通过 Unix Domain Socket 回调 LegnaCode 工具,多步操作压缩为一次推理
62
- - **Memory Provider 插件系统** 可插拔的记忆后端,内置文件系统 provider,支持外部 provider 扩展
63
- - **智能模型路由** 基于 prompt 复杂度自动路由到 fast/default/strong 模型层
64
- - **自主技能检测** — 检测重复工具调用模式,提示保存为可复用技能
65
- - **上下文压缩增强** — 工具输出预剪枝 + 预算压力注入,长对话更高效
66
- - **跨会话记忆搜索** — `/recall` 命令搜索历史会话,关键词匹配 + 相关性排序
67
- - **多层安全防护** — Bash/Zsh/PowerShell 命令安全检测、沙箱机制、权限分级控制
68
- - **多云 AI 后端** — 支持 Anthropic API、AWS Bedrock、GCP Vertex、Azure
69
- - **MCP 协议支持** — 通过 Model Context Protocol 连接外部工具和数据源
70
- - **多 Agent 协作** — 支持子 Agent 派生、团队协作、任务编排
71
- - **插件与技能系统** 可扩展的插件架构和可复用的技能工作流
72
- - **持久化记忆** 跨会话的上下文记忆系统
73
- - **纯 TS 语法高亮** — 内置基于 highlight.js 的纯 TypeScript 语法高亮实现,无需原生模块依赖
74
- - **WebUI 管理面板** — `legna admin` 启动浏览器管理面板,可视化编辑配置、切换配置文件、浏览会话记录、迁移数据
75
- - **`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>
76
126
 
77
127
  ---
78
128
 
79
- ## 环境要求
129
+ ## Requirements
80
130
 
81
- | 依赖 | 版本 |
82
- |------|------|
131
+ | Dependency | Version |
132
+ |------------|---------|
83
133
  | [Bun](https://bun.sh) | >= 1.2.0 |
84
- | Node.js | >= 18(可选) |
134
+ | Node.js | >= 18 (optional) |
85
135
  | Git | >= 2.0 |
86
- | 操作系统 | macOS / Linux |
136
+ | OS | macOS / Linux |
87
137
 
88
138
  ---
89
139
 
90
- ## 安装
140
+ ## Installation
91
141
 
92
- ### 方式一:npm 全局安装(推荐)
142
+ ### Option 1: npm Global Install (Recommended)
93
143
 
94
144
  ```bash
95
145
  npm install -g @legna-lnc/legnacode
96
146
  ```
97
147
 
98
- 如果使用镜像源(如 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:
99
149
 
100
150
  ```bash
101
151
  npm install -g @legna-lnc/legnacode --registry=https://registry.npmjs.org
102
152
  ```
103
153
 
104
- 安装后即可在任意目录使用 `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).
105
155
 
106
156
  ```bash
107
- # 验证安装
157
+ # Verify installation
108
158
  legna --version
109
159
 
110
- # 更新到最新版
160
+ # Update to the latest version
111
161
  npm update -g @legna-lnc/legnacode
112
162
  ```
113
163
 
114
- ### 方式二:从源码编译
164
+ ### Option 2: Build from Source
115
165
 
116
166
  ```bash
117
167
  git clone https://github.com/LegnaOS/LegnaCode-cli.git
118
168
  cd LegnaCode-cli
119
169
  bun install
120
170
  bun run compile
121
- # 编译产物为 ./legna,可移动到 PATH
171
+ # The compiled binary is ./legna — move it to your PATH
122
172
  ```
123
173
 
124
174
  ---
125
175
 
126
- ## 快速开始
176
+ ## Quick Start
127
177
 
128
178
  ```bash
129
- # 交互模式
179
+ # Interactive mode
130
180
  legna
131
181
 
132
- # 非交互模式(直接提问)
133
- legna -p "解释这段代码的作用"
182
+ # Non-interactive mode (ask directly)
183
+ legna -p "Explain what this code does"
134
184
 
135
- # 继续上次会话
185
+ # Continue the last session
136
186
  legna --continue
137
187
 
138
- # 查看版本
188
+ # Check version
139
189
  legna --version
140
190
  ```
141
191
 
142
192
  ---
143
193
 
144
- ## 项目结构
194
+ ## Project Structure
145
195
 
146
196
  ```
147
197
  ├── src/
148
- │ ├── entrypoints/ # 入口文件(cli.tsx
149
- │ ├── server/ # HTTP 服务器(admin WebUI
150
- │ ├── components/ # React/Ink 终端 UI 组件
151
- │ ├── tools/ # 内置工具(Bash、文件操作、搜索等)
152
- │ ├── services/ # API 调用、MCP 客户端、分析等
153
- │ ├── native-ts/ # TS 实现的原生模块替代(语法高亮等)
154
- │ ├── 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
155
205
  │ └── hooks/ # React hooks
156
- ├── webui/ # Admin WebUI 前端(React + Vite + Tailwind
157
- ├── stubs/ # 原生模块的 stub(编译时外部依赖占位)
158
- ├── scripts/ # 构建脚本
159
- ├── 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)
160
210
  └── package.json
161
211
  ```
162
212
 
163
213
  ---
164
214
 
165
- ## 构建说明
215
+ ## Build
166
216
 
167
- LegnaCode 使用 Bun bundler 进行构建,支持两种模式:
217
+ LegnaCode uses Bun's bundler for building, with two modes:
168
218
 
169
- - `bun run build` — 构建到 `dist/` 目录,适合开发调试
170
- - `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
171
221
 
172
222
  ### Admin WebUI
173
223
 
174
- `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.
175
225
 
176
226
  ```bash
177
- # 启动管理面板(默认端口 3456,自动打开浏览器)
227
+ # Launch admin panel (default port 3456, auto-opens browser)
178
228
  legna admin
179
229
 
180
- # 自定义端口
230
+ # Custom port
181
231
  legna admin 8080
182
232
  ```
183
233
 
184
- 面板顶部通过 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:
185
235
 
186
- | 面板 | 功能 |
187
- |------|------|
188
- | 配置编辑 | 可视化编辑 settings.jsonAPI 端点、API Key、模型映射(Opus/Sonnet/Haiku)、超时、权限模式、语言等 |
189
- | 配置文件 | 列出所有 settings*.json,显示 baseUrl/model,一键切换激活配置 |
190
- | 会话记录 | 浏览历史会话,显示项目路径、slug、时间、prompt 数量,一键复制 `legna --resume` 命令 |
191
- | 配置迁移 | 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 |
192
242
 
193
- > 从源码运行时需要先构建前端:`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.
194
244
 
195
- 构建时通过 `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.
196
246
 
197
- 原生模块(`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.
198
248
 
199
249
  ---
200
250
 
201
- ## 配置
251
+ ## Configuration
202
252
 
203
- LegnaCode 使用 `~/.legna/` 作为全局配置目录,项目级数据存储在 `<project>/.legna/`:
253
+ LegnaCode uses `~/.legna/` as the global config directory, with project-level data stored in `<project>/.legna/`:
204
254
 
205
- - `~/.legna/settings.json` — 全局用户设置
206
- - `~/.legna/.credentials.json` — 认证凭据
207
- - `<project>/.legna/sessions/` — 项目会话记录(JSONL
208
- - `<project>/.legna/skills/` — 项目技能
209
- - `<project>/.legna/rules/` — 项目规则
210
- - `<project>/.legna/settings.json` — 项目级设置
211
- - `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
212
262
 
213
- > 首次启动时自动从 `~/.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.
214
264
 
215
265
  ### legna migrate
216
266
 
217
- 手动迁移数据:
267
+ Manually migrate data:
218
268
 
219
269
  ```bash
220
- # 迁移全部(全局 + 当前项目会话)
270
+ # Migrate everything (global + current project sessions)
221
271
  legna migrate
222
272
 
223
- # 仅迁移全局数据 ~/.claude/ → ~/.legna/
273
+ # Migrate global data only: ~/.claude/ → ~/.legna/
224
274
  legna migrate --global
225
275
 
226
- # 仅迁移当前项目会话到本地 .legna/sessions/
276
+ # Migrate current project sessions to local .legna/sessions/ only
227
277
  legna migrate --sessions
228
278
 
229
- # 预览模式(不实际移动文件)
279
+ # Dry run (no files are actually moved)
230
280
  legna migrate --dry-run
231
281
  ```
232
282
 
233
- ### 环境变量
283
+ ### Environment Variables
234
284
 
235
- | 变量 | 说明 |
236
- |------|------|
237
- | `ANTHROPIC_API_KEY` | Anthropic API 密钥 |
238
- | `CLAUDE_CODE_USE_BEDROCK` | 使用 AWS Bedrock 后端 |
239
- | `CLAUDE_CODE_USE_VERTEX` | 使用 GCP Vertex 后端 |
240
- | `CLAUDE_CODE_SYNTAX_HIGHLIGHT` | 设为 `0` 禁用语法高亮 |
241
- | `MINIMAX_API_KEY` | MiniMax API 密钥(启用多模态工具) |
242
- | `MINIMAX_REGION` | MiniMax 区域:`global`(默认)或 `cn` |
243
- | `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) |
244
294
 
245
295
  ---
246
296
 
247
- ## MiniMax 多模态集成
297
+ ## MiniMax Multimodal Integration
248
298
 
249
- 当使用 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.
250
300
 
251
- ### 配置
301
+ ### Configuration
252
302
 
253
303
  ```bash
254
- # 方式一:环境变量
304
+ # Option 1: Environment variables
255
305
  export MINIMAX_API_KEY="your-api-key"
256
- export MINIMAX_REGION="global" # "cn"
306
+ export MINIMAX_REGION="global" # or "cn"
257
307
 
258
- # 方式二:交互式配置(持久化到 ~/.legna/minimax-credentials.json
308
+ # Option 2: Interactive configuration (persisted to ~/.legna/minimax-credentials.json)
259
309
  legna
260
310
  > /auth-minimax your-api-key
261
311
  ```
262
312
 
263
- 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)
264
314
 
265
- ### 多模态工具
315
+ ### Multimodal Tools
266
316
 
267
- | 工具 | 功能 | 示例 |
268
- |------|------|------|
269
- | `MiniMaxImageGenerate` | 文字生成图像 | "生成一张赛博朋克风格的城市夜景" |
270
- | `MiniMaxVideoGenerate` | 文字/图像生成视频 | "把这张图片做成一段 5 秒的动画" |
271
- | `MiniMaxSpeechSynthesize` | 文字转语音 | "把这段文字转成语音朗读" |
272
- | `MiniMaxMusicGenerate` | 文字生成音乐 | "生成一段轻快的钢琴背景音乐" |
273
- | `MiniMaxVisionDescribe` | 图像理解分析 | "描述这张图片的内容" |
274
- | `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" |
275
325
 
276
- 工具仅在使用 MiniMax 模型时自动启用,不影响其他模型的工具列表。
326
+ These tools are only enabled when using MiniMax models and do not affect the tool list for other models.
277
327
 
278
- ### 多模态工作流
328
+ ### Multimodal Workflow
279
329
 
280
- AI 可以自动编排多个工具完成复杂任务:
330
+ The AI can automatically orchestrate multiple tools to complete complex tasks:
281
331
 
282
332
  ```
283
- 用户:帮我做一个项目宣传视频
284
-
285
- AI 自动编排:
286
- 1. 分析项目 README,提取核心卖点
287
- 2. MiniMaxImageGenerate → 生成关键帧图片
288
- 3. MiniMaxVideoGenerate → 基于关键帧生成视频
289
- 4. MiniMaxSpeechSynthesize → 生成旁白配音
290
- 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
291
341
  ```
292
342
 
293
- ### Schema 导出
343
+ ### Schema Export
294
344
 
295
- MiniMax 工具的 schema 可以导出为 Anthropic 兼容格式,用于外部集成:
345
+ MiniMax tool schemas can be exported in Anthropic-compatible format for external integration:
296
346
 
297
347
  ```typescript
298
348
  import { exportMiniMaxToolSchemasJSON } from './src/tools/MiniMaxTools/schemaExport.js'
@@ -301,14 +351,14 @@ console.log(exportMiniMaxToolSchemasJSON())
301
351
 
302
352
  ---
303
353
 
304
- ## 许可证
354
+ ## License
305
355
 
306
- 本项目遵循上游 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.
307
357
 
308
358
  ---
309
359
 
310
- ## 相关链接
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)**
311
363
 
312
- - [Claude Code CLI(上游项目)](https://github.com/anthropics/claude-code)
313
- - [Anthropic](https://www.anthropic.com)
314
- - [Model Context Protocol](https://modelcontextprotocol.io)
364
+ </div>