@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.
- package/CHANGELOG.md +332 -310
- package/README.md +219 -169
- package/README.zh-CN.md +341 -0
- 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
|
-
|
|
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)
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
63
|
+
---
|
|
49
64
|
|
|
50
|
-
|
|
65
|
+
## Acknowledgments
|
|
51
66
|
|
|
52
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
|
136
|
+
| OS | macOS / Linux |
|
|
87
137
|
|
|
88
138
|
---
|
|
89
139
|
|
|
90
|
-
##
|
|
140
|
+
## Installation
|
|
91
141
|
|
|
92
|
-
###
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
#
|
|
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/ #
|
|
149
|
-
│ ├── server/ # HTTP
|
|
150
|
-
│ ├── components/ # React/Ink
|
|
151
|
-
│ ├── tools/ #
|
|
152
|
-
│ ├── services/ # API
|
|
153
|
-
│ ├── native-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
|
|
157
|
-
├── stubs/ #
|
|
158
|
-
├── scripts/ #
|
|
159
|
-
├── 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)
|
|
160
210
|
└── package.json
|
|
161
211
|
```
|
|
162
212
|
|
|
163
213
|
---
|
|
164
214
|
|
|
165
|
-
##
|
|
215
|
+
## Build
|
|
166
216
|
|
|
167
|
-
LegnaCode
|
|
217
|
+
LegnaCode uses Bun's bundler for building, with two modes:
|
|
168
218
|
|
|
169
|
-
- `bun run build` —
|
|
170
|
-
- `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
|
|
171
221
|
|
|
172
222
|
### Admin WebUI
|
|
173
223
|
|
|
174
|
-
`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.
|
|
175
225
|
|
|
176
226
|
```bash
|
|
177
|
-
#
|
|
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
|
-
|
|
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
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
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
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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/` —
|
|
208
|
-
- `<project>/.legna/skills/` —
|
|
209
|
-
- `<project>/.legna/rules/` —
|
|
210
|
-
- `<project>/.legna/settings.json` —
|
|
211
|
-
- `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
|
|
212
262
|
|
|
213
|
-
>
|
|
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
|
-
#
|
|
273
|
+
# Migrate global data only: ~/.claude/ → ~/.legna/
|
|
224
274
|
legna migrate --global
|
|
225
275
|
|
|
226
|
-
#
|
|
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` |
|
|
239
|
-
| `CLAUDE_CODE_USE_VERTEX` |
|
|
240
|
-
| `CLAUDE_CODE_SYNTAX_HIGHLIGHT` |
|
|
241
|
-
| `MINIMAX_API_KEY` | MiniMax API
|
|
242
|
-
| `MINIMAX_REGION` | MiniMax
|
|
243
|
-
| `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) |
|
|
244
294
|
|
|
245
295
|
---
|
|
246
296
|
|
|
247
|
-
## MiniMax
|
|
297
|
+
## MiniMax Multimodal Integration
|
|
248
298
|
|
|
249
|
-
|
|
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" #
|
|
306
|
+
export MINIMAX_REGION="global" # or "cn"
|
|
257
307
|
|
|
258
|
-
#
|
|
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
|
|
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` |
|
|
271
|
-
| `MiniMaxSpeechSynthesize` |
|
|
272
|
-
| `MiniMaxMusicGenerate` |
|
|
273
|
-
| `MiniMaxVisionDescribe` |
|
|
274
|
-
| `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" |
|
|
275
325
|
|
|
276
|
-
|
|
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.
|
|
287
|
-
2. MiniMaxImageGenerate →
|
|
288
|
-
3. MiniMaxVideoGenerate →
|
|
289
|
-
4. MiniMaxSpeechSynthesize →
|
|
290
|
-
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
|
|
291
341
|
```
|
|
292
342
|
|
|
293
|
-
### Schema
|
|
343
|
+
### Schema Export
|
|
294
344
|
|
|
295
|
-
MiniMax
|
|
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
|
-
|
|
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
|
-
|
|
313
|
-
- [Anthropic](https://www.anthropic.com)
|
|
314
|
-
- [Model Context Protocol](https://modelcontextprotocol.io)
|
|
364
|
+
</div>
|