Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>

<h1 align="center">MiniMax Code</h1>
<p align="center">A terminal coding agent with MiniMax, your own models, and tools beyond code.</p>
<p align="center">Turn a prompt into something that works. Build, test, and keep iterating from your terminal—with MiniMax or your own model.</p>
<p align="center">
<a href="#quick-start">Get started</a> ·
<a href="docs/README.md">Documentation</a> ·
Expand All @@ -21,11 +21,13 @@
<a href="LICENSE-STATUS.md"><img src="docs/assets/license.svg" alt="First-party default license: MIT"></a>
</p>

Understand a project, make changes, and run tests from your terminal. Use your MiniMax account or bring your own model, with search, plugins, and multimodal tools in the same workflow.
Give a blinking pocket pet a focus timer. Then ask: “Make pause a long press, and celebrate when the timer ends.” Watch a request become something you can actually use.

[![Real MiniMax Code TUI output: fixing clamp, inspecting the diff, and running tests](docs/assets/tui-demo.png)](docs/demo.md)
[![Pocket Pet: from a blinking face to a working focus companion](docs/assets/pocket-pet-demo.png)](docs/demo.md)

<p align="center"><a href="docs/demo.md">Watch the 20-second demo →</a> · Real terminal output, with pauses shortened</p>
<p align="center"><a href="docs/demo.md">Watch the build story and browser demo →</a> · <a href="examples/pocket-pet">Build it yourself →</a></p>

**No hardware required.** The example runs locally in your browser, with no frontend dependencies. Asking the CLI to edit code requires a MiniMax account with available credits or your own compatible model API; model calls may incur charges. The finished example runs without a model account.

## Quick start

Expand Down Expand Up @@ -102,7 +104,26 @@ Providers added this way are stored under `custom_provider` in the active profil

</details>

### 3. Run your first task
### 3. Build the pocket pet

Clone this repository and copy the starter into a separate directory:

```bash
git clone https://github.com/MiniMax-AI/minimax-code.git
cd minimax-code
node examples/pocket-pet/setup.mjs ../my-pocket-pet
cd ../my-pocket-pet
node serve.mjs
```

Open `http://127.0.0.1:4173`. In a second terminal, open `mcode` in `my-pocket-pet` and paste [the first prompt](examples/pocket-pet/README.md#first-request), then [the follow-up](examples/pocket-pet/README.md#change-the-requirement). Refresh the browser after each change.

Prefer to try the result first? From the repository root, run `node examples/pocket-pet/serve.mjs finished` and open the same URL. Add `?demo=1` for the visibly labeled 10-second mode.

[Full walkthrough and requirements](examples/pocket-pet) · [Small code-repair example](examples/clamp) · [Models, search, and tools](docs/examples.md)


### Work in your own project

Open the project you want to work on:

Expand Down Expand Up @@ -211,13 +232,6 @@ A profile uses `~/.minimax-<profile>`; `MINIMAX_DATA_DIR` or `MAVIS_DATA_DIR` ca

Account features, updates, feedback, and diagnostics are also included. Managed tools require network access and the relevant authorization. See [capabilities and service boundaries](docs/tui-capabilities.md) for details.

## Try it

Start the TUI in a copy of the example project and enter:

> Read clamp.mjs and clamp.test.mjs. Run node --test to reproduce the failure, fix clamp without changing the tests, then run the tests again.

The [small, reproducible project](examples/clamp) is the same task used in the demo above. [More examples](docs/examples.md) cover switching models, calling real search, and using your own image inputs.

## Build from source

Expand Down
38 changes: 26 additions & 12 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>

<h1 align="center">MiniMax Code</h1>
<p align="center">A terminal coding agent with MiniMax, your own models, and tools beyond code.</p>
<p align="center">把一句话,做成能运行的东西。用 MiniMax 或自己的模型,在终端里构建、验证、继续改进。</p>
<p align="center">
<a href="#快速开始">Get started</a> ·
<a href="docs/README.md">Documentation</a> ·
Expand All @@ -21,11 +21,13 @@
<a href="LICENSE-STATUS.md"><img src="docs/assets/license.svg" alt="First-party default license: MIT"></a>
</p>

在终端里读懂项目、修改代码并运行测试。使用 MiniMax 账号或自己的模型,把搜索、插件和多模态工具接入同一个工作流。
给一个会眨眼的小宠物加上番茄钟,再追问一句:“长按才能暂停,结束时跳舞。”看代码变成可以亲手操作的结果。

[![MiniMax Code 真实 TUI:修复 clamp、查看代码 diff 并运行测试](docs/assets/tui-demo.png)](docs/demo.md)
[![Pocket Pet:从会眨眼到会陪你专注](docs/assets/pocket-pet-demo.png)](docs/demo.md)

<p align="center"><a href="docs/demo.md">观看 20 秒真实演示 →</a> · 真实终端输出回放,已压缩等待时间</p>
<p align="center"><a href="docs/demo.md">看真实修改与浏览器演示 →</a> · <a href="examples/pocket-pet">自己做一次 →</a></p>

**无需硬件。** 示例在本地浏览器运行,不需要前端依赖。让 CLI 修改代码需要 MiniMax 账号及可用额度,或你自己的兼容模型 API;模型调用可能产生费用。完成版可直接运行,无需模型账号。

## 快速开始

Expand Down Expand Up @@ -102,7 +104,26 @@ mcode

</details>

### 3. 完成第一个任务
### 3. 做一个自己的桌面宠物

克隆仓库,把起始工程复制到独立目录:

```bash
git clone https://github.com/MiniMax-AI/minimax-code.git
cd minimax-code
node examples/pocket-pet/setup.mjs ../my-pocket-pet
cd ../my-pocket-pet
node serve.mjs
```

打开 `http://127.0.0.1:4173`。另开一个终端,在 `my-pocket-pet` 目录运行 `mcode`,依次粘贴[第一条提示词](examples/pocket-pet/README.md#first-request)和[追加需求](examples/pocket-pet/README.md#change-the-requirement),每次修改后刷新浏览器。

想先体验成品?在仓库根目录运行 `node examples/pocket-pet/serve.mjs finished`,打开同一地址。加上 `?demo=1` 可体验有明确标识的 10 秒演示模式。

[完整教程与使用条件](examples/pocket-pet) · [小型代码修复示例](examples/clamp) · [模型、搜索与工具](docs/examples.md)


### 在自己的项目中使用

进入要处理的项目目录:

Expand Down Expand Up @@ -211,13 +232,6 @@ profile 使用 `~/.minimax-<profile>`;`MINIMAX_DATA_DIR` 或 `MAVIS_DATA_DIR`

账号、更新、反馈与诊断能力也在。托管工具需要网络和相应授权,详细边界见 [能力与服务边界](docs/tui-capabilities.md)。

## 试一试

在示例目录启动 TUI,输入:

> Read clamp.mjs and clamp.test.mjs. Run node --test to reproduce the failure, fix clamp without changing the tests, then run the tests again.

这个 [可复现的小项目](examples/clamp) 就是上方演示使用的任务。[更多示例](docs/examples.md) 包括切换模型、执行真实搜索,以及使用自己的图片输入。

## 从源码构建

Expand Down
Binary file added docs/assets/hook-system-message-tui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pocket-pet-demo.mp4
Binary file not shown.
Binary file added docs/assets/pocket-pet-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 28 additions & 1 deletion docs/demo.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
# A real coding task
# Turn a prompt into something that works

[![Pocket Pet browser demo](assets/pocket-pet-demo.png)](assets/pocket-pet-demo.mp4)

[Watch or download the 36-second video](assets/pocket-pet-demo.mp4) · [Build it yourself](../examples/pocket-pet) · [View the finished source](../examples/pocket-pet/finished)

## A new feature, then a new requirement

The starter is a small, predesigned browser pet that blinks and says hello. The first request asks MiniMax Code to add a Pomodoro timer. The follow-up changes pause to an 800 ms hold and adds a completion celebration. The finished example runs locally without hardware or frontend dependencies.

The video pairs actual browser recordings with clearly labeled prompt excerpts, generated source, and excerpts of real headless output. The interface shown in the final demonstration includes subsequent maintainer design work. It is an edited demonstration, not a recording of the interactive TUI. See the [full prompts](../examples/pocket-pet) and try the same changes in your own copy.

## Recording and verification

- Recorded on September 28–29, 2026 (Asia/Shanghai), using the installed MiniMax Code **0.5.8**, with the existing **BYOK** configuration. This is a CLI workflow demonstration, not a MiniMax-model evaluation.
- The two real agent turns took approximately **102 seconds** and **154 seconds**. Model waiting time is omitted from the 36-second edit; it is not a speed benchmark. Browser footage plays at its captured speed.
- The first run added the timer and passed 6 tests. The follow-up added hold-to-pause and the celebration and passed all 13 tests. Both runs explicitly said browser behavior was unverified; the maintainer then checked it in Chrome.
- Browser checks cover start, short-click behavior, pointer hold/pause/resume, keyboard hold/repeat/release/resume, the default 25-minute setting, canceled holds, completion, reduced-motion behavior, and a 390 px viewport without horizontal overflow.
- `?demo=1` visibly labels a **10-second demonstration**. No 25-minute wait or physical hardware operation is implied. State is in memory and a page reload resets it.
- The visual starter was authored before the agent runs. The reference implementation retains the generated timer and hold logic. Subsequent maintainer work redesigned the HTML/CSS, added session-progress and short-tap feedback, made the mode links visible, avoided repeated live-region text writes, and canceled pending holds when the button loses focus. This visual polish was not produced by the two recorded CLI turns. The video does not claim generation from an empty project.
- Only synthetic project content appears. Private run logs, account state, provider aliases, local paths and session identifiers are excluded. Captions and layout are editorial; the cursor highlight follows actual pointer events. Browser footage is cropped for readability and its interaction segment plays continuously at 1×. No tool results were invented.
- Video assembly uses HyperFrames with locally staged browser footage. The video is silent so it works in muted README and social contexts. The revised cut uses a warm page and a cobalt device, with larger interaction shots and visible action labels.

To edit the starter, install and configure MCode with a MiniMax account with available credits or your own compatible model API. Calls may incur charges. Running the finished example requires only Node.js and a browser.

---

## Earlier demo: a small code repair

![Real MiniMax Code terminal replay: request, failing tests, a code fix, and passing tests](assets/tui-demo.gif)

Expand Down
5 changes: 5 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Examples

Try the [Pocket Pet walkthrough](../examples/pocket-pet) for a visual example with two real requests: add a focus timer, then change pause to a long press. It includes a starter, finished implementation, and tests. No hardware is required.


Build the project using the [installation guide](installation.md). Run the `pnpm mcode` commands below from the source root. For interactive tasks, open the target project directory and launch the built CLI by absolute path.

## 1. Edit code and run tests
Expand Down Expand Up @@ -170,6 +173,8 @@ See [capability coverage](tui-capabilities.md) for custom MCP, managed connector

## 4. Manage plugins

Synchronous Hooks can show [TUI-only messages](hooks.md) with `systemMessage`, including notices after a normal Stop.

Open `/plugins` inside the TUI, or run `mcode plugin` from a shell to open that panel. For a source build, use `pnpm mcode plugin` from the source root instead; the commands below use the installed `mcode` executable.

The panel combines the **official** catalog and **local** plugin directories. Use `Tab` / `Shift+Tab` to switch between All Plugins, Installed, Official, and Local; type to search and use the arrow keys to select a row.
Expand Down
90 changes: 90 additions & 0 deletions docs/hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Hook messages in the TUI

A synchronous command Hook can return a top-level `systemMessage` to show a
notice to the user without adding that text to model context:

```json
{"systemMessage":"Checks complete. The report is ready."}
```

Write one JSON object to stdout and exit with code 0. For example, a Node.js
script can use `console.log(JSON.stringify({ systemMessage: "Checks complete." }))`.
This is the script's output, not the Hook registration document.

For a MiniMax-format Plugin, reference the Hook file in the manifest's `hooks`
array, for example `"hooks": ["hooks/notify.json"]`. A registration document for
an existing Plugin with a `scripts/notice.cjs` file looks like this:

```json
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "node \"${PLUGIN_ROOT}/scripts/notice.cjs\"",
"timeout": 5
}]
}]
}
}
```

The command requires Node.js on the Hook process's PATH. See [local Plugin
management](examples.md#4-manage-plugins) for the active installation directory.

## Display and model context

On normal completion, a Stop notice appears after the response as `Hook · Stop`.
The warning color is presentation, not a failed-turn status. Multiline text is
supported; terminal control sequences in the message or title are stripped.

![A Stop Hook notice shown after the assistant reply in the TUI](assets/hook-system-message-tui.png)

The notice is persisted in Session display history and restored when reopening
that Session. Replaying the same message does not duplicate it. Separate Hook
invocations can repeat the same text and each gets its own notice. Notices stay
in their owning Session; child-session notices are not broadcast to the parent.

`systemMessage` alone does not request another model call. Its text is excluded
from canonical model history, compaction input, final-answer copying and default
Markdown export. This does not mean it is excluded from local display storage.
If you also return `additionalContext`, `decision` or other control fields, those
fields keep their existing event-specific behavior. `suppressOutput` does not
control this notice.

Only categorized Plugin user messages are shown. Diagnostics, terminal-control
notices and older events without a category remain hidden. This change concerns
interactive TUI presentation; headless and ACP output policies are unchanged.

## Event limits

The same display behavior applies where Runtime already emits notices:
SessionStart/UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse,
SubagentStart/SubagentStop and automatic PostCompact. A cancelled or failed turn
does not fire the normal Stop Hook.

PreCompact and manual PostCompact do not currently emit these notices.
SessionEnd delivery is best-effort and is not guaranteed to appear before exit.
The Claude-compatible adapter discards `systemMessage` for PreCompact,
PostCompact and SessionEnd; the Codex adapter discards it for SessionEnd. These
format-specific limits are unchanged. Only synchronous command Hooks are covered.

## Manual check from a source build

Build with `pnpm build` in the repository. To select a test workspace, change the
shell's working directory before launching the built CLI by its absolute path.
The interactive TUI does not accept the headless `exec --cwd` option.

With a dedicated `MINIMAX_DATA_DIR` and an enabled test Plugin:

1. Ask for a short answer without tools. Confirm one Stop notice after completion.
2. Repeat the prompt. Confirm a second notice even when its text is identical.
3. Switch away and reopen the Session, then restart the CLI. Confirm the notices
are retained without duplication.
4. Use `/copy` and `/export`. Confirm the notice text is absent.
5. Narrow the terminal and check multiline text remains readable.

Do not paste the notice marker into the prompt or ask the model to read the Hook
script when checking context isolation. For live request acceptance, inspect the
next model request and an actually executed compaction request. Model answers or
`/context` usage statistics alone cannot prove the marker was absent.
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This guide builds the 0.4.12 source preview. Workspace/local build manifests rem

For a source build, you need Git, Node.js 22.19+ (22.x), 24.2+ (24.x), 25, or 26, and pnpm 9.12.0. Regular CI uses Node.js 24 across Linux and macOS. The weekly and manual compatibility matrix covers Node.js 22.19.0, 24.2.0, 25, and 26 on both platforms. Windows CI and source-candidate validation are temporarily paused while their checks are made reliable. Initial installation and build require access to public npm.

On Windows, check out this repository on a local NTFS volume before running `pnpm install`. The repository uses pnpm workspace links for vendored packages, and those links require NTFS junctions. FAT32/exFAT volumes, network shares, and other non-local Windows volumes cannot create the required junctions. The preflight command below verifies the volume and stops with a clear message before pnpm creates workspace links; run it immediately before `pnpm install`. A local NTFS volume can still contain a cloud-synced folder, which the preflight cannot identify reliably; keep the checkout outside OneDrive, Google Drive, Dropbox, and similar synced folders.
On Windows, check out this repository on a local NTFS volume before running `pnpm install`. The repository uses pnpm workspace links for vendored packages, and those links require NTFS junctions. FAT32/exFAT volumes, network shares, and other non-local Windows volumes cannot create the required junctions. The preflight command below verifies the volume and stops with a clear message before pnpm creates workspace links; run it immediately before `pnpm install`. It queries structured volume properties through Windows PowerShell and CIM, without requiring an elevated shell or parsing localized `fsutil` output. If PowerShell or CIM is unavailable or blocked, verification fails with the query error. A local NTFS volume can still contain a cloud-synced folder, which the preflight cannot identify reliably; keep the checkout outside OneDrive, Google Drive, Dropbox, and similar synced folders.

Node 24.0 and 24.1 are unsupported: their bundled libuv can return inconsistent Windows file identity metadata, causing safe configuration reads to fail. [Node 24.2.0](https://nodejs.org/en/blog/release/v24.2.0) includes libuv 1.51.0 with the [upstream fix](https://github.com/libuv/libuv/commit/82cdfb75f). Use a current patch release of a supported Node line.

Expand Down
Loading
Loading