@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.
- package/CHANGELOG.md +327 -313
- package/README.md +218 -171
- package/README.zh-CN.md +341 -0
- 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
|
-
|
|
5
|
+
**An AI-powered terminal programming assistant, supercharged.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@legna-lnc/legnacode)
|
|
8
|
+
[](#platform-support)
|
|
9
|
+
[](./LICENSE)
|
|
10
|
+
[](https://github.com/anthropics/claude-code)
|
|
11
|
+
|
|
12
|
+
🌐 [中文文档](./README.zh-CN.md) · 📊 [vs Claude Code](./COMPARISON.md) · 📋 [Changelog](./CHANGELOG.md)
|
|
6
13
|
|
|
7
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
63
|
+
---
|
|
52
64
|
|
|
53
|
-
|
|
65
|
+
## Acknowledgments
|
|
54
66
|
|
|
55
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
|
136
|
+
| OS | macOS / Linux |
|
|
90
137
|
|
|
91
138
|
---
|
|
92
139
|
|
|
93
|
-
##
|
|
140
|
+
## Installation
|
|
94
141
|
|
|
95
|
-
###
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
#
|
|
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/ #
|
|
152
|
-
│ ├── server/ # HTTP
|
|
153
|
-
│ ├── components/ # React/Ink
|
|
154
|
-
│ ├── tools/ #
|
|
155
|
-
│ ├── services/ # API
|
|
156
|
-
│ ├── native-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
|
|
160
|
-
├── stubs/ #
|
|
161
|
-
├── scripts/ #
|
|
162
|
-
├── bunfig.toml # Bun
|
|
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
|
|
217
|
+
LegnaCode uses Bun's bundler for building, with two modes:
|
|
171
218
|
|
|
172
|
-
- `bun run build` —
|
|
173
|
-
- `bun run compile` —
|
|
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`
|
|
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
|
-
#
|
|
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
|
-
|
|
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
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
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
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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/` —
|
|
211
|
-
- `<project>/.legna/skills/` —
|
|
212
|
-
- `<project>/.legna/rules/` —
|
|
213
|
-
- `<project>/.legna/settings.json` —
|
|
214
|
-
- `LEGNA.md` —
|
|
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
|
-
>
|
|
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
|
-
#
|
|
273
|
+
# Migrate global data only: ~/.claude/ → ~/.legna/
|
|
227
274
|
legna migrate --global
|
|
228
275
|
|
|
229
|
-
#
|
|
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` |
|
|
242
|
-
| `CLAUDE_CODE_USE_VERTEX` |
|
|
243
|
-
| `CLAUDE_CODE_SYNTAX_HIGHLIGHT` |
|
|
244
|
-
| `MINIMAX_API_KEY` | MiniMax API
|
|
245
|
-
| `MINIMAX_REGION` | MiniMax
|
|
246
|
-
| `MINIMAX_BASE_URL` |
|
|
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
|
-
|
|
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" #
|
|
306
|
+
export MINIMAX_REGION="global" # or "cn"
|
|
260
307
|
|
|
261
|
-
#
|
|
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
|
|
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` |
|
|
274
|
-
| `MiniMaxSpeechSynthesize` |
|
|
275
|
-
| `MiniMaxMusicGenerate` |
|
|
276
|
-
| `MiniMaxVisionDescribe` |
|
|
277
|
-
| `MiniMaxWebSearch` |
|
|
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
|
-
|
|
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.
|
|
290
|
-
2. MiniMaxImageGenerate →
|
|
291
|
-
3. MiniMaxVideoGenerate →
|
|
292
|
-
4. MiniMaxSpeechSynthesize →
|
|
293
|
-
5.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
316
|
-
- [Anthropic](https://www.anthropic.com)
|
|
317
|
-
- [Model Context Protocol](https://modelcontextprotocol.io)
|
|
364
|
+
</div>
|