Skip to content

LexGridnev/MiMo-Code

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiMoCode (Android & Termux Fork)

MiMoCode

An open-source AI coding agent with cross-session memory, optimized for Android & Termux.

中文 | English

Website | Blog


This is a specialized fork of MiMoCode (an open-source terminal-native AI coding assistant built on OpenCode) tailored specifically for running natively on Android (aarch64) inside Termux.

Why this fork?

Upstream release binaries are glibc-linked and cannot run natively on Android's Bionic libc. This fork addresses this by compiling, configuring, and optimizing MiMoCode to run flawlessly from source under Bun directly on your mobile device. It includes compatibility patches for node-pty, bun install, and Solid JSX pragmas on Android/Termux.


Quick Start

Termux / Android (aarch64) Installation (Primary)

Simply run the following one-line command inside Termux:

# One-line install for Termux (Android)
curl -fsSL https://raw.githubusercontent.com/LexGridnev/MiMo-Code/HEAD/termux/setup.sh | bash

The installer script automatically:

  1. Updates system packages and installs build tools (git, python, clang, make, binutils, libandroid-spawn, ca-certificates).
  2. Installs Bun (via Termux packages or the official installer).
  3. Clones this repository and installs dependencies with the copyfile backend.
  4. Rebuilds node-pty from source to ensure native terminal compatibility with Android's Bionic libc.
  5. Installs a global mimo wrapper in your PATH ($PREFIX/bin/mimo).

Once installed, simply run mimo to start the assistant. You can update the installation later by running:

mimo upgrade

The first launch guides you through configuration automatically. Supported options:

  • MiMo Auto (free for a limited time) — anonymous channel, zero configuration
  • Xiaomi MiMo Platform — OAuth login
  • Import from Claude Code — migrate existing authentication in one step
  • Custom Provider — add any OpenAI-compatible API in the TUI

Standard Installation (Other Platforms)

If you are not on Android/Termux, you can install the upstream version:

# One-line install
curl -fsSL https://mimo.xiaomi.com/install | bash

# Or install via npm
npm install -g @mimo-ai/cli

Core Features

Multiple Agents

Agent Description
build Default. Full tool permissions for development
plan Read-only analysis mode for code exploration and solution design
compose Orchestration mode for specs-driven development and skill-driven workflows

Press Tab to switch between primary agents. Subagents are created by the system as needed.

Persistent Memory

Cross-session memory powered by SQLite FTS5 full-text search:

  • Project memory (MEMORY.md) — persistent project knowledge, rules, and architecture decisions
  • Session checkpoint (checkpoint.md) — structured state snapshots maintained automatically by the checkpoint-writer subagent
  • Scratch notes (notes.md) — temporary note area for agents
  • Task progress (tasks/<id>/progress.md) — per-task logs

Memory is injected automatically when a session resumes, so the agent does not need to relearn project context.

Intelligent Context Management

  • Automatic checkpoints — decides when to save session state based on the model context window
  • Context reconstruction — when context approaches the limit, rebuilds it from the latest checkpoint, project memory, task progress, and retained recent messages so the agent can continue the current task
  • Budgeted injection — uses a token budget to control how much checkpoint, memory, and notes content enters context, with importance ranking

Task Tracking

A tree-shaped task system (T1, T1.1, T1.2, …) that integrates automatically with the checkpoint system, so task progress is preserved when sessions resume.

Subagent System

The primary agent can create subagents on demand. Subagents share the current session context and can work in parallel, with lifecycle tracking, cancellation, and background execution.

Goal / Stop Condition

The /goal command sets a stopping condition for a session. When the agent tries to stop, an independent judge model evaluates the conversation to decide whether the condition is truly satisfied — preventing premature "optimistic stops" during autonomous work.

Compose Mode

Compose mode provides a structured workflow for specs-driven development. It includes built-in skills for planning, execution, code review, TDD, debugging, verification, and merging — orchestrating the full lifecycle from spec to shipped code.

Voice Input

Real-time streaming voice input powered by TenVAD and MiMo ASR. Activate with /voice, then speak — audio is segmented by pauses and transcribed incrementally into the input. Available for MiMo logged-in users.

Dream & Distill

  • /dream — scans recent session traces, extracts persistent knowledge into project memory, and removes outdated entries
  • /distill — discovers repeated manual workflows in recent work and packages high-confidence candidates into reusable skills, subagents, or commands

Configuration

MiMoCode is configured via .mimocode/mimocode.json in the project directory (or ~/.config/mimocode/mimocode.json globally). Key options include:

  • Provider and model selection
  • Agent permissions and custom agents
  • Checkpoint and memory behavior
  • MCP server connections
  • Keybindings and theme

Max Mode (parallel best-of-N reasoning with judge selection) can be enabled via experimental.maxMode in the config.


Development

bun install              # Install dependencies
bun run dev              # Run in development mode
bun turbo typecheck      # Type check

Relationship to OpenCode

MiMoCode is built as a fork of OpenCode. It keeps all core OpenCode capabilities (multiple providers, TUI, LSP, MCP, plugins) and adds persistent memory, intelligent context management, subagent orchestration, goal-driven autonomous loops, compose workflows, and self-improvement via dream/distill.


Community

Scan the QR code to join the community group chat:

Community group chat QR code 1    Community group chat QR code 2


License

Source code is licensed under the MIT License.

Use of MiMoCode is also subject to the Use Restrictions. Use of Xiaomi MiMo-hosted services is subject to the MiMo Terms of Service. Use of the MiMo name, logo, and trademarks is subject to the MiMo Trademark Policy.

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 95.3%
  • CSS 3.8%
  • JavaScript 0.4%
  • Shell 0.3%
  • HTML 0.1%
  • Nix 0.1%