mimo2codex-proxy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

mimo2codex Proxy Skill

mimo2codex Proxy Skill

Skill by ara.so — Codex Skills collection.
ara.so开发的Skill——Codex Skills系列工具。

Overview

概述

mimo2codex is a local proxy server that translates between OpenAI Codex's Responses API (
wire_api = "responses"
) and upstream LLM providers using Chat Completions API. It enables the latest Codex CLI and desktop app to work with:
  • Xiaomi MiMo (V2.5 Pro, V2 Flash, V2 Omni)
  • DeepSeek (V4 Pro, V4 Flash, Reasoner)
  • Generic OpenAI-compatible providers (Qwen, GLM, Kimi, Ollama, vLLM, LM Studio)
Key features:
  • Per-request model routing (send
    mimo-v2.5-pro
    → MiMo,
    deepseek-v4-pro
    → DeepSeek)
  • Automatic MiMo
    reasoning_content
    round-trip handling (v0.2.3+)
  • Built-in admin webui at
    http://127.0.0.1:8788/admin/
  • Tool calling, web search, vision (model-dependent)
  • sqlite persistence for logs and token stats
mimo2codex 是一款本地代理服务器,可在OpenAI Codex的Responses API(
wire_api = "responses"
)与使用Chat Completions API的上游大语言模型(LLM)提供商之间进行转换。它能让最新版Codex CLI和桌面应用与以下模型兼容:
  • 小米MiMo(V2.5 Pro、V2 Flash、V2 Omni)
  • DeepSeek(V4 Pro、V4 Flash、Reasoner)
  • 通用OpenAI兼容提供商(Qwen、GLM、Kimi、Ollama、vLLM、LM Studio)
核心特性
  • 按请求路由模型(发送
    mimo-v2.5-pro
    → 转发至MiMo,
    deepseek-v4-pro
    → 转发至DeepSeek)
  • 自动处理MiMo的
    reasoning_content
    往返逻辑(v0.2.3及以上版本)
  • 内置管理WebUI,访问地址为
    http://127.0.0.1:8788/admin/
  • 工具调用、网页搜索、视觉能力(取决于模型支持情况)
  • 使用sqlite持久化存储日志与token统计数据

Installation

安装

npm (recommended)

npm(推荐方式)

bash
npm install -g mimo2codex
bash
npm install -g mimo2codex

curl one-liner

curl一键安装

bash
undefined
bash
undefined

macOS/Linux

macOS/Linux

Windows PowerShell

Windows PowerShell

Git clone (for development)

Git克隆(用于开发)

bash
git clone https://github.com/7as0nch/mimo2codex
cd mimo2codex
npm install
npm run build
npm link  # registers `mimo2codex` globally
Requirements: Node.js ≥ 18
bash
git clone https://github.com/7as0nch/mimo2codex
cd mimo2codex
npm install
npm run build
npm link  # 全局注册`mimo2codex`命令
要求:Node.js ≥ 18

Quick Start

快速开始

1. Get API Keys

1. 获取API密钥

2. Configure Environment Variables

2. 配置环境变量

Built-in loader (v0.2.8+, recommended):
bash
undefined
内置加载器(v0.2.8及以上版本,推荐)
bash
undefined

Initialize .env file in ~/.mimo2codex/

在~/.mimo2codex/目录下初始化.env文件

mimo2codex init
mimo2codex init

Edit ~/.mimo2codex/.env and add your keys:

编辑~/.mimo2codex/.env并添加你的密钥:

MIMO_API_KEY=sk-your-mimo-key

MIMO_API_KEY=sk-your-mimo-key

DS_API_KEY=sk-your-deepseek-key

DS_API_KEY=sk-your-deepseek-key

Start (auto-loads .env)

启动代理(自动加载.env文件)

mimo2codex

**Manual environment variables:**

```bash
mimo2codex

**手动配置环境变量**:

```bash

MiMo only

仅使用MiMo

export MIMO_API_KEY=sk-your-mimo-key mimo2codex
export MIMO_API_KEY=sk-your-mimo-key mimo2codex

DeepSeek only

仅使用DeepSeek

export DS_API_KEY=sk-your-deepseek-key mimo2codex --model ds
export DS_API_KEY=sk-your-deepseek-key mimo2codex --model ds

Both providers (per-request routing)

同时启用两个提供商(按请求路由)

export MIMO_API_KEY=sk-your-mimo-key export DS_API_KEY=sk-your-deepseek-key mimo2codex
undefined
export MIMO_API_KEY=sk-your-mimo-key export DS_API_KEY=sk-your-deepseek-key mimo2codex
undefined

3. Configure Codex

3. 配置Codex

The startup banner prints the required snippets. Copy them to:
macOS/Linux:
  • ~/.codex/auth.json
  • ~/.codex/config.toml
Windows:
  • %USERPROFILE%\.codex\auth.json
  • %USERPROFILE%\.codex\config.toml
Example
auth.json
:
json
{
  "base_url": "http://127.0.0.1:8788",
  "api_key": "fake_api_key"
}
Example
config.toml
:
toml
wire_api = "responses"
model = "mimo-v2.5-pro"
启动时的横幅会显示所需的配置代码片段。将其复制到对应路径:
macOS/Linux
  • ~/.codex/auth.json
  • ~/.codex/config.toml
Windows
  • %USERPROFILE%\.codex\auth.json
  • %USERPROFILE%\.codex\config.toml
示例
auth.json
json
{
  "base_url": "http://127.0.0.1:8788",
  "api_key": "fake_api_key"
}
示例
config.toml
toml
wire_api = "responses"
model = "mimo-v2.5-pro"

4. Start Codex

4. 启动Codex

bash
codex
bash
codex

CLI Commands

CLI命令

Core Commands

核心命令

bash
undefined
bash
undefined

Start proxy (MiMo default)

启动代理(默认使用MiMo)

mimo2codex
mimo2codex

Start with DeepSeek as default

启动代理并设置DeepSeek为默认提供商

mimo2codex --model ds
mimo2codex --model ds

Custom port

使用自定义端口

mimo2codex --port 9000
mimo2codex --port 9000

Custom data directory

使用自定义数据目录

mimo2codex --data-dir /path/to/data
mimo2codex --data-dir /path/to/data

Disable reasoning display (still round-trips for MiMo)

禁用推理内容显示(仍会为MiMo保留往返逻辑)

mimo2codex --no-reasoning
mimo2codex --no-reasoning

Disable .env auto-loading

禁用.env自动加载

mimo2codex --no-load-env
undefined
mimo2codex --no-load-env
undefined

Utility Commands

实用命令

bash
undefined
bash
undefined

Initialize .env file

初始化.env文件

mimo2codex init
mimo2codex init

Print cc-switch snippets

打印cc-switch配置片段

mimo2codex print-cc-switch
mimo2codex print-cc-switch

Show version

显示版本

mimo2codex --version
mimo2codex --version

Show help

显示帮助信息

mimo2codex --help
undefined
mimo2codex --help
undefined

Configuration

配置说明

Environment Variables

环境变量

VariableProviderRequired
MIMO_API_KEY
MiMoFor MiMo models
DS_API_KEY
or
DEEPSEEK_API_KEY
DeepSeekFor DeepSeek models
QWEN_API_KEY
QwenFor Qwen models
GLM_API_KEY
GLMFor GLM models
KIMI_API_KEY
KimiFor Kimi models
OPENAI_API_KEY
OpenAIFor OpenAI models
CODEX_HOME
-Custom Codex config directory
变量名提供商是否必填
MIMO_API_KEY
MiMo使用MiMo模型时必填
DS_API_KEY
DEEPSEEK_API_KEY
DeepSeek使用DeepSeek模型时必填
QWEN_API_KEY
Qwen使用Qwen模型时必填
GLM_API_KEY
GLM使用GLM模型时必填
KIMI_API_KEY
Kimi使用Kimi模型时必填
OPENAI_API_KEY
OpenAI使用OpenAI模型时必填
CODEX_HOME
-自定义Codex配置目录

CLI Flags

CLI参数

FlagDefaultDescription
--port
8788
Proxy server port
--host
127.0.0.1
Proxy server host
--model
mimo
Default provider (
mimo
or
ds
)
--data-dir
~/.mimo2codex
Data/logs directory
--no-reasoning
false
Hide reasoning from terminal
--no-load-env
false
Disable .env auto-loading
--log-level
info
Log level (debug/info/warn/error)
参数默认值描述
--port
8788
代理服务器端口
--host
127.0.0.1
代理服务器主机地址
--model
mimo
默认提供商(
mimo
ds
--data-dir
~/.mimo2codex
数据/日志存储目录
--no-reasoning
false
在终端隐藏推理内容
--no-load-env
false
禁用.env文件自动加载
--log-level
info
日志级别(debug/info/warn/error)

Model Routing

模型路由

Built-in Model IDs

内置模型ID

MiMo:
  • mimo-v2.5-pro
    (default)
  • mimo-v2-flash
  • mimo-v2.5
    (vision)
  • mimo-v2-omni
    (vision)
DeepSeek:
  • deepseek-v4-pro
    (default)
  • deepseek-v4-flash
  • deepseek-chat
  • deepseek-reasoner
MiMo
  • mimo-v2.5-pro
    (默认)
  • mimo-v2-flash
  • mimo-v2.5
    (支持视觉)
  • mimo-v2-omni
    (支持视觉)
DeepSeek
  • deepseek-v4-pro
    (默认)
  • deepseek-v4-flash
  • deepseek-chat
  • deepseek-reasoner

Routing Logic

路由逻辑

  1. Explicit match: If client sends
    mimo-v2.5-pro
    , routes to MiMo (if key configured)
  2. Fallback: If client sends unknown model (e.g.
    gpt-4o
    ), routes to
    --model
    provider's default
  3. Provider disabled: If client sends
    qwen3-max
    but no
    QWEN_API_KEY
    , falls back to
    --model
    provider
Example routing with both keys configured:
bash
export MIMO_API_KEY=sk-mimo-key
export DS_API_KEY=sk-deepseek-key
mimo2codex  # default fallback: mimo
  1. 精准匹配:如果客户端发送
    mimo-v2.5-pro
    ,则路由到MiMo(需已配置密钥)
  2. ** fallback逻辑**:如果客户端发送未知模型(例如
    gpt-4o
    ),则路由到
    --model
    指定的默认提供商的默认模型
  3. 提供商未启用:如果客户端发送
    qwen3-max
    但未配置
    QWEN_API_KEY
    ,则 fallback到
    --model
    指定的提供商
示例:配置双提供商密钥后的路由
bash
export MIMO_API_KEY=sk-mimo-key
export DS_API_KEY=sk-deepseek-key
mimo2codex  # 默认fallback:mimo

In Codex config.toml:

在Codex的config.toml中:

model = "deepseek-v4-pro" → Routes to DeepSeek

model = "deepseek-v4-pro" → 路由到DeepSeek

model = "mimo-v2.5-pro" → Routes to MiMo

model = "mimo-v2.5-pro" → 路由到MiMo

model = "gpt-4o" → Falls back to mimo-v2.5-pro

model = "gpt-4o" → Fallback到mimo-v2.5-pro

undefined
undefined

Admin Web UI

管理WebUI

Access at
http://127.0.0.1:8788/admin/
(port matches
--port
)
访问地址:
http://127.0.0.1:8788/admin/
(端口与
--port
参数一致)

Features

功能特性

  • Dashboard: Token usage charts, cache hit rates, request stats
  • Models: View all available models, test with ⚡Probe button
  • Providers: View/edit provider configs from
    providers.json
  • Logs: Browse chat logs with filtering
  • Settings: Configure Codex paths, manage aliases
  • Codex Enable: One-click write of
    auth.json
    and
    config.toml
    (replaces cc-switch)
  • 仪表盘:token使用量图表、缓存命中率、请求统计
  • 模型管理:查看所有可用模型,点击⚡Probe按钮测试连接
  • 提供商管理:查看/编辑
    providers.json
    中的提供商配置
  • 日志管理:浏览聊天日志并支持过滤
  • 设置:配置Codex路径、管理模型别名
  • Codex启用:一键写入
    auth.json
    config.toml
    配置(替代cc-switch)

Codex Enable (v0.2.6+)

Codex启用(v0.2.6及以上版本)

  1. Open
    http://127.0.0.1:8788/admin/
  2. Click "Codex Enable" tab
  3. Select model and click "Apply"
  4. Automatically backs up existing configs (first OpenAI backup preserved permanently)
Runtime override mode: Switch models without restarting Codex (experimental)
  1. 打开
    http://127.0.0.1:8788/admin/
  2. 点击“Codex Enable”标签页
  3. 选择模型并点击“Apply”
  4. 自动备份现有配置(首次OpenAI配置会永久保留)
运行时覆盖模式:无需重启Codex即可切换模型(实验性功能)

Adding Custom Providers

添加自定义提供商

Edit
~/.mimo2codex/providers.json
(created after first run):
json
{
  "providers": [
    {
      "name": "qwen",
      "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
      "apiKeyEnvVar": "QWEN_API_KEY",
      "defaultModel": "qwen3-max",
      "models": ["qwen3-max", "qwen-turbo"],
      "aliases": {
        "qwen3": "qwen3-max"
      },
      "supportsWebSearch": true
    }
  ]
}
Provider schema:
FieldTypeDescription
name
stringUnique provider identifier
baseUrl
stringOpenAI-compatible base URL
apiKeyEnvVar
stringEnvironment variable name
defaultModel
stringModel ID for fallback
models
string[]Supported model IDs
aliases
objectModel alias mappings
supportsWebSearch
booleanEnable web search tool
编辑
~/.mimo2codex/providers.json
(首次运行后自动创建):
json
{
  "providers": [
    {
      "name": "qwen",
      "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
      "apiKeyEnvVar": "QWEN_API_KEY",
      "defaultModel": "qwen3-max",
      "models": ["qwen3-max", "qwen-turbo"],
      "aliases": {
        "qwen3": "qwen3-max"
      },
      "supportsWebSearch": true
    }
  ]
}
提供商配置 schema
字段类型描述
name
string唯一提供商标识符
baseUrl
stringOpenAI兼容的基础URL
apiKeyEnvVar
string环境变量名称
defaultModel
stringfallback使用的模型ID
models
string[]支持的模型ID列表
aliases
object模型别名映射
supportsWebSearch
boolean是否启用网页搜索工具

Example: Ollama

示例:Ollama

json
{
  "name": "ollama",
  "baseUrl": "http://localhost:11434/v1",
  "apiKeyEnvVar": "OLLAMA_API_KEY",
  "defaultModel": "llama3.2",
  "models": ["llama3.2", "qwen2.5-coder"],
  "aliases": {
    "llama": "llama3.2"
  },
  "supportsWebSearch": false
}
bash
export OLLAMA_API_KEY=ollama  # Any non-empty value
mimo2codex
In Codex
config.toml
:
toml
model = "llama3.2"
json
{
  "name": "ollama",
  "baseUrl": "http://localhost:11434/v1",
  "apiKeyEnvVar": "OLLAMA_API_KEY",
  "defaultModel": "llama3.2",
  "models": ["llama3.2", "qwen2.5-coder"],
  "aliases": {
    "llama": "llama3.2"
  },
  "supportsWebSearch": false
}
bash
export OLLAMA_API_KEY=ollama  # 任意非空值即可
mimo2codex
在Codex的
config.toml
中配置:
toml
model = "llama3.2"

Tool Calling

工具调用

Supported Tools

支持的工具

  • Function tools: Custom JSON schemas
  • local_shell: Execute shell commands
  • MCP tools: Via
    namespace
    parameter
  • web_search: MiMo native (auto-enabled for MiMo, skipped for DeepSeek)
  • 函数工具:自定义JSON schema
  • local_shell:执行Shell命令
  • MCP工具:通过
    namespace
    参数调用
  • web_search:MiMo原生支持(自动为MiMo启用,DeepSeek会忽略此工具调用)

Web Search

网页搜索

MiMo: Translates Codex's
web_search
tool to MiMo's native builtin. Requires plugin activation in MiMo console.
DeepSeek: Web search not supported — tool calls are stripped.
MiMo:将Codex的
web_search
工具转换为MiMo的原生内置工具,需在MiMo控制台激活对应插件。
DeepSeek:不支持网页搜索——工具调用会被自动移除。

Example Tool Call

工具调用示例

typescript
// Codex sends:
{
  "model": "mimo-v2.5-pro",
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "parameters": {
          "type": "object",
          "properties": {
            "location": { "type": "string" }
          }
        }
      }
    }
  ]
}

// mimo2codex translates to MiMo Chat Completions:
{
  "model": "mimo-v2.5-pro",
  "tools": [
    {
      "type": "function",
      "function": { ... }
    }
  ]
}
typescript
// Codex发送的请求:
{
  "model": "mimo-v2.5-pro",
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "parameters": {
          "type": "object",
          "properties": {
            "location": { "type": "string" }
          }
        }
      }
    }
  ]
}

// mimo2codex转换为MiMo Chat Completions请求:
{
  "model": "mimo-v2.5-pro",
  "tools": [
    {
      "type": "function",
      "function": { ... }
    }
  ]
}

Vision Support

视觉能力支持

Supported models:
  • mimo-v2.5
    (MiMo)
  • mimo-v2-omni
    (MiMo)
Non-vision models (
mimo-v2.5-pro
,
mimo-v2-flash
, DeepSeek models): Images are auto-stripped with placeholder text.
支持的模型
  • mimo-v2.5
    (MiMo)
  • mimo-v2-omni
    (MiMo)
非视觉模型
mimo-v2.5-pro
mimo-v2-flash
、DeepSeek系列模型):图片会被自动移除并替换为占位文本。

Example Vision Request

视觉请求示例

In Codex
config.toml
:
toml
model = "mimo-v2.5"
bash
codex
> Describe this image: /path/to/image.jpg
mimo2codex forwards the image URL/base64 to MiMo's vision model.
在Codex的
config.toml
中配置:
toml
model = "mimo-v2.5"
bash
codex
> Describe this image: /path/to/image.jpg
mimo2codex会将图片URL/base64转发至MiMo的视觉模型。

MiMo reasoning_content Round-Trip

MiMo reasoning_content 往返处理

Problem: MiMo requires every assistant message with
tool_calls
to echo back its
reasoning_content
on the next turn. Without this, MiMo returns 400 errors or hallucinates.
Solution: mimo2codex ≥ 0.2.3 automatically stores and re-inserts
reasoning_content
on subsequent turns.
问题:MiMo要求所有包含
tool_calls
的助手消息,在后续对话轮次中必须回显之前的
reasoning_content
。如果缺少该内容,MiMo会返回400错误或产生幻觉。
解决方案:mimo2codex ≥ 0.2.3版本会自动存储并在后续对话轮次中重新插入
reasoning_content

Example

示例

typescript
// Turn 1: MiMo returns
{
  "role": "assistant",
  "content": "",
  "tool_calls": [...],
  "reasoning_content": "I need to search the web"
}

// Turn 2: mimo2codex auto-injects reasoning_content
{
  "role": "assistant",
  "content": "",
  "tool_calls": [...],
  "reasoning_content": "I need to search the web"  // ← auto-added
}
Flag:
--no-reasoning
hides reasoning from terminal but preserves round-trip.
typescript
// 第一轮:MiMo返回的内容
{
  "role": "assistant",
  "content": "",
  "tool_calls": [...],
  "reasoning_content": "I need to search the web"
}

// 第二轮:mimo2codex自动注入reasoning_content
{
  "role": "assistant",
  "content": "",
  "tool_calls": [...],
  "reasoning_content": "I need to search the web"  // ← 自动添加
}
参数
--no-reasoning
会在终端隐藏推理内容,但仍会保留往返逻辑。

Common Patterns

常见配置模式

Multi-Provider Setup

多提供商配置

bash
undefined
bash
undefined

.env file (~/.mimo2codex/.env)

.env文件(路径:~/.mimo2codex/.env)

MIMO_API_KEY=sk-mimo-key DS_API_KEY=sk-deepseek-key QWEN_API_KEY=sk-qwen-key
MIMO_API_KEY=sk-mimo-key DS_API_KEY=sk-deepseek-key QWEN_API_KEY=sk-qwen-key

Start proxy

启动代理

mimo2codex
mimo2codex

Codex config.toml - switch models dynamically:

Codex的config.toml - 动态切换模型:

model = "mimo-v2.5-pro"

model = "mimo-v2.5-pro"

model = "deepseek-v4-pro"

model = "deepseek-v4-pro"

model = "qwen3-max"

model = "qwen3-max"

undefined
undefined

Testing Model Connections

测试模型连接

Use the admin UI's ⚡Probe button:
  1. Open
    http://127.0.0.1:8788/admin/
  2. Go to "Codex Enable" or "Models" tab
  3. Click ⚡Probe next to any model
  4. Validates key, baseUrl, and model ID end-to-end
使用管理UI的**⚡Probe**按钮:
  1. 打开
    http://127.0.0.1:8788/admin/
  2. 进入“Codex Enable”或“Models”标签页
  3. 点击任意模型旁的⚡Probe按钮
  4. 端到端验证密钥、baseUrl和模型ID是否有效

Token Usage Tracking

Token使用量追踪

bash
undefined
bash
undefined

Start proxy

启动代理

mimo2codex
mimo2codex

- Dashboard: Charts with cache hit overlay

- 仪表盘:带缓存命中率叠加的图表

- Green bars: Cache hits

- 绿色柱状图:缓存命中

- Gray ghosts: Prompt token totals

- 灰色虚影:提示token总量

- Window-wide hit rate summary

- 全局命中率汇总

undefined
undefined

Custom Codex Directory

自定义Codex目录

bash
undefined
bash
undefined

Via environment variable

通过环境变量配置

export CODEX_HOME=/custom/path mimo2codex
export CODEX_HOME=/custom/path mimo2codex

Via admin UI settings

通过管理UI设置

Navigate to Settings → Codex Path

进入Settings → Codex Path

undefined
undefined

Troubleshooting

故障排除

400 Errors with MiMo (Tool Calls)

MiMo工具调用返回400错误

Symptom: MiMo returns 400 or agent rambles instead of calling tools.
Cause: Missing
reasoning_content
round-trip.
Fix: Upgrade to mimo2codex ≥ 0.2.3
bash
npm update -g mimo2codex
症状:MiMo返回400错误,或代理无意义地输出内容而非调用工具。
原因:缺少
reasoning_content
往返处理。
解决方法:升级mimo2codex至≥0.2.3版本
bash
npm update -g mimo2codex

Provider Not Routing

提供商路由失败

Check:
  1. API key is set:
    echo $MIMO_API_KEY
  2. Provider is enabled in startup banner
  3. Model ID matches provider's catalog (case-sensitive)
bash
undefined
检查项
  1. API密钥已设置:
    echo $MIMO_API_KEY
  2. 启动横幅中显示提供商已启用
  3. 模型ID与提供商目录完全匹配(区分大小写)
bash
undefined

Debug with log level

启用调试日志排查

mimo2codex --log-level debug
undefined
mimo2codex --log-level debug
undefined

Port Already in Use

端口已被占用

bash
undefined
bash
undefined

Change port

修改端口

mimo2codex --port 9000
mimo2codex --port 9000

Update auth.json:

更新auth.json:

"base_url": "http://127.0.0.1:9000"

"base_url": "http://127.0.0.1:9000"

undefined
undefined

Web Search Not Working

网页搜索无法使用

MiMo: Activate the web search plugin in MiMo Console → Plugins.
DeepSeek: Not supported (tool calls are stripped).
MiMo:在MiMo控制台 → 插件中激活网页搜索插件。
DeepSeek:不支持网页搜索(工具调用会被移除)。

Image Generation (/hatch)

图片生成(/hatch命令)

Codex's
/hatch
command calls OpenAI's
image_gen
client-side — mimo2codex cannot intercept this. Workaround: Use
mimoskill/
(see project README).
Codex的
/hatch
命令会在客户端调用OpenAI的
image_gen
接口——mimo2codex无法拦截该请求。解决方案:使用
mimoskill/
(详见项目README)。

.env Not Loading

.env文件未加载

bash
undefined
bash
undefined

Verify file location

验证文件位置

ls ~/.mimo2codex/.env
ls ~/.mimo2codex/.env

Check file syntax (no spaces around =)

检查文件语法(=号周围不能有空格)

cat ~/.mimo2codex/.env
cat ~/.mimo2codex/.env

Disable auto-loading if needed

必要时禁用自动加载

mimo2codex --no-load-env
undefined
mimo2codex --no-load-env
undefined

Windows PowerShell Execution Policy

Windows PowerShell执行策略问题

If
irm | iex
fails:
powershell
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
如果
irm | iex
执行失败:
powershell
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

Integration with cc-switch

与cc-switch集成

Generate cc-switch snippets:
bash
mimo2codex print-cc-switch
Output example:
toml
[mimo-v2.5-pro]
model = "mimo-v2.5-pro"
wire_api = "responses"
base_url = "http://127.0.0.1:8788"
api_key = "fake_api_key"
Copy to cc-switch config and use
cc mimo-v2.5-pro
to switch.
生成cc-switch配置片段:
bash
mimo2codex print-cc-switch
示例输出:
toml
[mimo-v2.5-pro]
model = "mimo-v2.5-pro"
wire_api = "responses"
base_url = "http://127.0.0.1:8788"
api_key = "fake_api_key"
将其复制到cc-switch配置文件中,使用
cc mimo-v2.5-pro
命令切换模型。

Data Persistence

数据持久化

Default location:
~/.mimo2codex/data.db
(sqlite)
Stored data:
  • Chat logs (request/response pairs)
  • Token usage stats
  • Cache hit metrics
  • Model mappings
Custom location:
bash
mimo2codex --data-dir /custom/path
默认存储位置
~/.mimo2codex/data.db
(sqlite数据库)
存储的数据
  • 聊天日志(请求/响应对)
  • Token使用量统计
  • 缓存命中指标
  • 模型映射关系
自定义存储位置
bash
mimo2codex --data-dir /custom/path

TypeScript API (for embedding)

TypeScript API(用于嵌入集成)

typescript
import { startServer } from 'mimo2codex';

const server = await startServer({
  port: 8788,
  host: '127.0.0.1',
  dataDir: '~/.mimo2codex',
  logLevel: 'info',
  noReasoning: false,
  loadEnv: true
});

// Server running at http://127.0.0.1:8788
typescript
import { startServer } from 'mimo2codex';

const server = await startServer({
  port: 8788,
  host: '127.0.0.1',
  dataDir: '~/.mimo2codex',
  logLevel: 'info',
  noReasoning: false,
  loadEnv: true
});

// 服务器运行在http://127.0.0.1:8788

Project Links

项目链接