### Setting SenseNova API Key and Starting mimo2codex Source: https://mimodoc.chengj.online/docs/sensenova This example shows how to set the SENSENOVA_API_KEY environment variable and start the mimo2codex application. ```bash export SENSENOVA_API_KEY=sk-xxxxx # get one at https://platform.sensenova.cn/console/keys mimo2codex Copy ``` -------------------------------- ### Initial Admin Setup Source: https://mimodoc.chengj.online/docs/auth-deployment Access `http://:8788/admin/` in your browser after starting the service. The first user to access this page will be prompted to create the initial administrator account by providing a username, display name, and password. ```bash open http://localhost:8788 # mac / Linux start http://localhost:8788 # Windows ``` -------------------------------- ### Docker Compose Quickstart Source: https://mimodoc.chengj.online/docs/docker Deploy mimo2codex using docker-compose by preparing a .env file with API keys, starting the services, and accessing the admin UI. ```bash # 1. Prepare .env (already gitignored) cp .env.example .env # Edit .env, set at least one provider key: # MIMO_API_KEY=sk-xxxxxxxxxxxx # or DEEPSEEK_API_KEY=sk-xxxxxxxxxxxx # 2. Start docker compose up -d # 3. Open admin UI open http://localhost:8788 # mac/Linux start http://localhost:8788 # Windows Copy ``` -------------------------------- ### 60-Second Start with Environment Variables Source: https://mimodoc.chengj.online/docs/generic-providers Use this method for a single provider setup. Set the base URL, API key, and default model via environment variables before starting mimo2codex. ```bash export GENERIC_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1 export GENERIC_API_KEY=sk-your-qwen-key export GENERIC_DEFAULT_MODEL=qwen3-max mimo2codex --model generic ``` -------------------------------- ### Starting mimo2codex with a Configured Provider Source: https://mimodoc.chengj.online/docs/generic-providers After setting up the providers.json file and exporting necessary API keys, start mimo2codex by specifying the desired model using its ID or shortcut. ```bash export QWEN_API_KEY=sk-... export KIMI_API_KEY=sk-... mimo2codex --model qwen # default provider = qwen ``` -------------------------------- ### Install mimo2codex CLI Source: https://mimodoc.chengj.online/ Install the mimo2codex CLI globally using npm. This provides a single binary with zero runtime configuration required. ```bash npm install -g mimo2codex ``` -------------------------------- ### Start Docker Deployment Source: https://mimodoc.chengj.online/docs/auth-deployment Use this command to start the Docker deployment in detached mode. Open the service in your browser using the provided URL. ```bash docker compose up -d open http://localhost:8788 # mac / Linux start http://localhost:8788 # Windows ``` -------------------------------- ### Recommended providers.json setup for MiniMax Source: https://mimodoc.chengj.online/docs/minimax Configure MiniMax as a provider in `~/.mimo2codex/providers.json`. This setup enables specific features for MiniMax compatibility. Ensure your API key is set as an environment variable. ```json { "providers": [ { "id": "minimax", "displayName": "MiniMax M2.7", "baseUrl": "https://api.minimaxi.com/v1", "envKey": "MINIMAX_API_KEY", "defaultModel": "MiniMax-M2.7", "models": [ { "id": "MiniMax-M2.7", "contextWindow": 245760 } ], "features": { "minimaxCompat": true, "forceParallelToolCalls": true } } ] } ``` -------------------------------- ### Routing Fallback Example Source: https://mimodoc.chengj.online/docs/generic-providers Demonstrates how a client request for 'qwen3-max' falls through to the default 'mimo' provider when the configured provider ('qwen') lacks an API key. ```bash # Client sends qwen3-max # → byClientModel matches the qwen catalog # → qwen has no key → fall through # → default provider mimo → model rewritten to mimo-v2.5-pro ``` -------------------------------- ### Install Pet into Codex Source: https://mimodoc.chengj.online/docs/mimoskill Installs a generated pet image or bundle into the Codex application. Requires the pet file and a target name. ```bash bash mimoskill/scripts/install_pet.sh pet.png shiba ``` -------------------------------- ### Generate and Install Pet (No OpenAI Key) Source: https://mimodoc.chengj.online/docs/mimoskill Generates a pet image and installs it into Codex without requiring an OpenAI key. For higher quality, an API key can be set. ```bash python3 mimoskill/scripts/generate_pet.py --description "chibi shiba coder" --out pet.png bash mimoskill/scripts/install_pet.sh pet.png shiba # Fully quit + relaunch Codex, pick the new pet from the picker ``` -------------------------------- ### Start Docker Compose Services Source: https://mimodoc.chengj.online/docs/docker Starts all services defined in the docker-compose.yml file in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Setting up MiniMax via environment variables Source: https://mimodoc.chengj.online/docs/minimax A simplified setup for using MiniMax as the sole upstream provider via environment variables. Note that this method does not support the `features.minimaxCompat` switch, requiring the `providers.json` method for strict-mode sanitizers. ```bash export GENERIC_BASE_URL=https://api.minimaxi.com/v1 export GENERIC_API_KEY= export GENERIC_DEFAULT_MODEL=MiniMax-M2.7 export GENERIC_FORCE_DEFAULT_MODEL=1 # key bit: unknown client models (e.g. "gpt-5.5") rewrite to MiniMax-M2.7 mimo2codex ``` -------------------------------- ### Apply Codex Configuration Script (Linux/macOS) Source: https://mimodoc.chengj.online/docs/auth-deployment Run this script to back up existing configuration files and apply the downloaded Codex configuration to your local setup. ```bash bash apply-*.sh ``` -------------------------------- ### SenseNova Error Example Source: https://mimodoc.chengj.online/docs/sensenova This is an example of an error response received when wiring up SenseNova as a plain generic provider, indicating an invalid request. ```json upstream returned 400: {"error":{"message":"Errors in message queue response", "type":"invalid_request_error","code":"3"}} Copy ``` -------------------------------- ### Windows Git Bash/WSL/Cygwin: Load Environment Variables Source: https://mimodoc.chengj.online/docs/env-setup For environments like Git Bash, WSL, or Cygwin on Windows, the process is the same as on macOS and Linux. Copy the example .env file and then source the shell script to load the variables. ```bash cp .env.example .env && source scripts/load-env.sh ``` -------------------------------- ### INFO model fallback applied log example Source: https://mimodoc.chengj.online/docs/proxy-faq Example log message indicating that an unknown client model ID was automatically mapped to a provider's default model. This is informational and the request proceeds normally. ```json [2026-05-20T02:07:51.792Z] INFO model fallback applied — client sent unknown model id, request continues with provider default { provider: 'mimo', from: 'gpt-5.4', to: 'mimo-v2.5-pro', reason: "unknown client model — falling back to mimo provider's defaultModel" } ``` -------------------------------- ### macOS/Linux: Load Environment Variables from .env Source: https://mimodoc.chengj.online/docs/env-setup After copying the example .env file and editing it with your keys, use this command to load the environment variables into your current shell session. This makes the keys available to other tools launched from the same shell. ```bash cp .env.example .env source scripts/load-env.sh echo $MIMO_API_KEY mimo2codex ``` -------------------------------- ### Zero-Setup OCR with MiMo Scripts Source: https://mimodoc.chengj.online/docs/mimoskill Performs OCR on an image using the MiMo script. It automatically selects the best available OCR engine without requiring any prior setup or API keys. ```bash python3 mimoskill/scripts/ocr.py path/to/image.png ``` -------------------------------- ### Windows PowerShell: Load Environment Variables from .env Source: https://mimodoc.chengj.online/docs/env-setup On Windows, use this command to copy the example .env file and then dot-source the PowerShell script to load the environment variables into your current session. Verify by echoing the variable. ```powershell Copy-Item .env.example .env . .\scripts\load-env.ps1 echo $env:MIMO_API_KEY mimo2codex ``` -------------------------------- ### Docker Compose Deployment Source: https://mimodoc.chengj.online/docs/auth-deployment The Docker image has server mode enabled by default. To start the service, use `docker compose up -d`. If you need to disable auth (not recommended), modify the `MIMO2CODEX_AUTH` environment variable in your `docker-compose.yml`. ```bash docker compose up -d # Just open the browser — no docker logs needed: open http://localhost:8788 # mac / Linux start http://localhost:8788 # Windows ``` ```yaml # docker-compose.yml services: mimo2codex: environment: - MIMO2CODEX_AUTH=off ``` -------------------------------- ### Stronger Docker Compose Restart Source: https://mimodoc.chengj.online/docs/docker Performs a full stop and then start of services, ensuring environment variables are cleanly re-injected. ```bash docker compose down && docker compose up -d ``` -------------------------------- ### Codex Runtime Override Logic Source: https://mimodoc.chengj.online/docs/codex-enable Explains the priority order for selecting a provider, starting with runtime overrides and falling back to defaults. Runtime overrides are checked first if a provider exists and has an API key. ```text Pass 0: runtime override (if provider exists AND has a runtime / api key) → hit Pass 1: user-declared generic providers (non-empty models[] in providers.json + has key) Pass 2: built-in providers (mimo / deepseek + has key) Fallback: defaultProviderId's defaultModel ``` -------------------------------- ### Load Specific .env File with Bash Source: https://mimodoc.chengj.online/docs/env-setup To load environment variables from a specific file other than the default .env, use the script with the file path as an argument. This example uses Bash. ```shell source scripts/load-env.sh .env.dev ``` -------------------------------- ### Admin API: Get Codex Targets Source: https://mimodoc.chengj.online/docs/codex-enable Fetches a flat list of all available provider and model targets, indicating whether each has an API key configured and if it's the current override. ```http GET /admin/api/codex-targets ``` -------------------------------- ### Initialize .env File with mimo2codex Source: https://mimodoc.chengj.online/docs/env-setup Run this command to create the necessary `.env` and `.env.example` files in the `~/.mimo2codex/` directory. You will then need to edit the `.env` file to add your actual API keys. ```bash mimo2codex init ``` -------------------------------- ### Print Configuration for Qwen Model Source: https://mimodoc.chengj.online/docs/generic-providers Use this command to view the configuration snippets for the Qwen model, including auth.json and config.toml. ```bash mimo2codex print-config --model qwen ``` -------------------------------- ### Plain Docker Run - Minimal Source: https://mimodoc.chengj.online/docs/docker Run mimo2codex with a minimal docker command, including the API key directly in the environment variable and mapping the port. No data persistence is configured. ```bash # Minimal (key inline, no persistence) docker run -d --name mimo2codex \ -p 8788:8788 \ -e MIMO_API_KEY=sk-xxxxxxxxxxxx \ ghcr.io/7as0nch/mimo2codex:latest Copy ``` -------------------------------- ### Get Active Runtime Override Source: https://mimodoc.chengj.online/docs/codex-enable Retrieves the currently active runtime override settings, if any are configured. ```APIDOC ## GET /admin/api/active-override ### Description Retrieves the current runtime override settings. This indicates if a specific provider and model are being used at runtime, overriding the default configuration. ### Method GET ### Endpoint /admin/api/active-override ### Response #### Success Response (200) - **providerId** (string | null) - The ID of the provider currently set for runtime override, or null if no override is active. - **modelId** (string | null) - The ID of the model currently set for runtime override, or null if no override is active. ``` -------------------------------- ### Plain Docker Run - With Persistence Source: https://mimodoc.chengj.online/docs/docker Run mimo2codex with data persistence using a .env file for configuration, specifying a data directory inside the container, and mounting a host volume. ```bash # With persistence + .env file docker run -d --name mimo2codex \ -p 8788:8788 \ --env-file ./.env \ -e MIMO2CODEX_DATA_DIR=/data \ -v ~/.mimo2codex:/data \ ghcr.io/7as0nch/mimo2codex:latest Copy ``` -------------------------------- ### Print Environment Key Configuration for Qwen Model Source: https://mimodoc.chengj.online/docs/generic-providers This command displays the configuration for the Qwen model when using the environment key variant, specific to the Codex CLI. ```bash mimo2codex print-config --model qwen --env-key ``` -------------------------------- ### Admin API: Get Runtime Override Status Source: https://mimodoc.chengj.online/docs/codex-enable Use this endpoint to retrieve the current runtime override settings. This is useful for verifying if an override is active. ```http GET /admin/api/active-override ``` -------------------------------- ### Admin API: Get Codex State Source: https://mimodoc.chengj.online/docs/codex-enable Retrieves a snapshot of the current Codex state, including owner, file existence, backup list, and runtime override status. ```http GET /admin/api/codex-state ``` -------------------------------- ### Offline OCR with Tesseract Source: https://mimodoc.chengj.online/docs/mimoskill Configures OCR to use the Tesseract engine for offline processing, suitable for environments without network access or behind firewalls. Requires Tesseract installation. ```bash python3 mimoskill/scripts/ocr.py --engine tesseract --lang Chinese scan.png ``` -------------------------------- ### Admin API: Apply Configuration Source: https://mimodoc.chengj.online/docs/codex-enable Applies a new configuration by writing files and creating an auto-backup. This operation replaces the entire config.toml file. ```http POST /admin/api/codex-apply body {providerId, modelId} ``` -------------------------------- ### Load Specific .env File with PowerShell Source: https://mimodoc.chengj.online/docs/env-setup To load environment variables from a specific file other than the default .env, use the script with the file path as an argument. This example uses PowerShell. ```powershell . .\scripts\load-env.ps1 .\.env.prod ``` -------------------------------- ### Print CC-Switch Custom Provider Configuration for Qwen Model Source: https://mimodoc.chengj.online/docs/generic-providers Generates custom provider snippets for the Qwen model using the cc-switch flow. ```bash mimo2codex print-cc-switch --model qwen ``` -------------------------------- ### Docker Compose Environment Loading Order Source: https://mimodoc.chengj.online/docs/docker Illustrates the loading order of environment variables in Docker Compose, showing how host .env files are injected and how container-level .env files can override them. ```text host .env │ │ docker compose loads env_file → injects KEY=VALUE into container process.env ▼ container process starts │ │ mimo2codex/cli.ts then reads /.env (default /data/.env) ▼ final process.env: /data/.env exists → overrides compose-injected values for matching keys /data/.env absent → compose-injected values stand Copy ``` -------------------------------- ### Alibaba Qwen Provider Configuration Source: https://mimodoc.chengj.online/docs/generic-providers Configuration for Alibaba Qwen using DashScope's OpenAI-compatible mode. Includes model details and context window sizes. ```json { "id": "qwen", "displayName": "Qwen (DashScope)", "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", "envKey": "QWEN_API_KEY", "defaultModel": "qwen3-max", "models": [ { "id": "qwen3-max", "contextWindow": 262144 }, { "id": "qwen3-coder-plus", "contextWindow": 1048576, "supportsReasoning": true } ], "features": { "forceParallelToolCalls": true } } ``` -------------------------------- ### Mounting Custom Data Directory in Docker Source: https://mimodoc.chengj.online/docs/docker Configure Docker Compose to mount a custom directory on the host to the container's data directory, allowing for data persistence and sharing across different installations. ```yaml volumes: - ~/.mimo2codex:/data Copy ``` -------------------------------- ### Launch with IPv4 First DNS Resolution (Node.js) Source: https://mimodoc.chengj.online/docs/proxy-faq Sets the NODE_OPTIONS environment variable to prioritize IPv4 addresses during DNS resolution. Useful for mitigating DNS poisoning or IPv6 issues. ```bash NODE_OPTIONS=--dns-result-order=ipv4first ``` -------------------------------- ### MiniMax Provider Configuration with Compatibility Source: https://mimodoc.chengj.online/docs/generic-providers Configuration for MiniMax, including features for strict OpenAI compatibility and parallel tool calls. Use the 'minimaxCompat' preset. ```json { "id": "minimax", "displayName": "MiniMax M2.7", "baseUrl": "https://api.minimaxi.com/v1", "envKey": "MINIMAX_API_KEY", "defaultModel": "MiniMax-M2.7", "models": [ { "id": "MiniMax-M2.7", "contextWindow": 245760 } ], "features": { "minimaxCompat": true, "forceParallelToolCalls": true } } ``` -------------------------------- ### Setting Environment Variables for Authentication Source: https://mimodoc.chengj.online/docs/auth-deployment Demonstrates how to enable authentication for the current shell session. This is a common step when the environment variables are not being picked up correctly. ```powershell $env:MIMO2CODEX_AUTH = "on" ``` -------------------------------- ### Configuration File for Multiple Providers Source: https://mimodoc.chengj.online/docs/generic-providers Define multiple upstream providers in a JSON file for flexible configuration. This is the recommended approach for managing several instances. ```json { "providers": [ { "id": "qwen", "shortcut": "qwen", "displayName": "Qwen (DashScope)", "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1", "envKey": "QWEN_API_KEY", "defaultModel": "qwen3-max", "wireApi": "chat", "models": [ { "id": "qwen3-max", "contextWindow": 262144 }, { "id": "qwen3-coder-plus", "contextWindow": 1048576 } ], "features": { "forceParallelToolCalls": true } }, { "id": "kimi", "shortcut": "kimi", "displayName": "Kimi K2", "baseUrl": "https://api.moonshot.cn/v1", "envKey": "KIMI_API_KEY", "defaultModel": "kimi-k2-0905-preview" }, { "id": "ollama", "shortcut": "ol", "displayName": "Ollama (local)", "baseUrl": "http://127.0.0.1:11434/v1", "envKey": "OLLAMA_API_KEY", "defaultModel": "qwen2.5-coder:7b" }, { "id": "openai-native", "displayName": "OpenAI (native Responses)", "baseUrl": "https://api.openai.com/v1", "envKey": "OPENAI_API_KEY", "defaultModel": "gpt-5", "wireApi": "responses" } ] } ``` -------------------------------- ### Build Local Docker Image Source: https://mimodoc.chengj.online/docs/docker Builds a Docker image locally from the current directory, tagged as mimo2codex:local. This is typically faster than multi-arch CI builds. ```bash docker build -t mimo2codex:local . ``` -------------------------------- ### Enable Server Mode via Shell Environment Variable Source: https://mimodoc.chengj.online/docs/auth-deployment Set the `MIMO2CODEX_AUTH` environment variable to `on` in your current shell session before running `npm run dev`. This setting is temporary for the session. ```bash # PowerShell $env:MIMO2CODEX_AUTH = "on" npm run dev # bash / zsh export MIMO2CODEX_AUTH=on npm run dev ``` -------------------------------- ### Docker Compose Environment Injection Methods Source: https://mimodoc.chengj.online/docs/docker Compares different methods for injecting environment variables into Docker Compose services, highlighting the recommended approach for local development and CI/CD. ```text Method| How| When| Safety ---|---|---|--- `env_file: - .env` (compose default)| Point compose at `.env` file| Local deploy ✅| `.env` is gitignored `environment: - KEY=value` (hardcoded)| Literal in compose file| ❌ Don't| Key lands in git history `environment: - KEY=${KEY}` (from shell)| Read from invoking shell| CI / CD| OK `-e KEY=value` (docker run inline)| Command line| Debug| OK, but leaks to shell history ``` -------------------------------- ### Enable Server Mode via CLI Flag Source: https://mimodoc.chengj.online/docs/auth-deployment Use the CLI flag `--auth on` when running `npm run dev` to enable server mode for local development. This is the most direct method. ```bash # Windows PowerShell npm run dev -- --auth on # macOS / Linux npm run dev -- --auth on ``` -------------------------------- ### High-Quality Image Generation with OpenAI Source: https://mimodoc.chengj.online/docs/mimoskill Generates an image using OpenAI's official image generation model for the best quality. Requires the PET_OPENAI_API_KEY to be set. ```bash export PET_OPENAI_API_KEY=sk-real-openai-key python3 mimoskill/scripts/generate_image.py --prompt "..." --out art.png ``` -------------------------------- ### Free Image Generation with Pollinations Source: https://mimodoc.chengj.online/docs/mimoskill Generates an image using the specified prompt. It defaults to using the Pollinations provider for free generation if no OpenAI key is set. ```bash python3 mimoskill/scripts/generate_image.py --prompt "japanese garden, watercolor, dawn" --out garden.png ``` -------------------------------- ### Image Generation with Common Styles Source: https://mimodoc.chengj.online/docs/mimoskill Generates an image with a specified style preset, such as 'anime'. Requires the prompt and output file path. ```bash python3 mimoskill/scripts/generate_image.py --style anime --prompt "shrine at dusk" --out shrine.png ``` -------------------------------- ### Build Docker Image for Specific Platform Source: https://mimodoc.chengj.online/docs/docker Use this command to build a Docker image for a specific platform, such as armv7. Ensure you have the correct base image and consider compatibility notes for certain combinations like alpine + node on armv7. ```bash docker build --platform linux/arm/v7 -t mimo2codex:armv7 . ``` -------------------------------- ### Run mimo_chat.py with pollinations fallback Source: https://mimodoc.chengj.online/docs/mimoskill This script can be run without any API key by relying on the free pollinations fallback. It supports text and vision chat. ```bash python3 mimoskill/scripts/mimo_chat.py "tell me a joke" ``` ```bash python3 mimoskill/scripts/mimo_chat.py --image https://x/y.png "describe this" ``` -------------------------------- ### Build Docker Image Locally Source: https://mimodoc.chengj.online/docs/docker Build the mimo2codex Docker image locally using docker build for your current architecture. Alternatively, configure docker-compose to build from the local Dockerfile. ```bash # Build for your current arch docker build -t mimo2codex:local . # Or via compose: in docker-compose.yml swap # image: ghcr.io/7as0nch/mimo2codex:latest ← comment out # build: . ← enable docker compose build docker compose up -d Copy ``` -------------------------------- ### Advanced MiMo Chat Configuration Source: https://mimodoc.chengj.online/docs/mimoskill Launches a MiMo chat session with specific model and token configurations, supporting streaming output. ```bash python3 mimoskill/scripts/mimo_chat.py --model mimo-v2.5-pro --max-tokens 8000 --stream "long answer please" ``` -------------------------------- ### Launch mimo2codex with a custom port Source: https://mimodoc.chengj.online/docs/proxy-faq Launch the mimo2codex application on a different port if the default is taken. ```bash mimo2codex --port 8889 ``` -------------------------------- ### Generate Animated Pet Bundle Source: https://mimodoc.chengj.online/docs/mimoskill Generates an animated multi-state pet bundle. Specify the description and the output directory for the bundle. ```python python3 mimoskill/scripts/generate_pet.py --description "chibi cat" --bundle ./shiba/ ``` -------------------------------- ### Basic MiMo Chat with Web Search Source: https://mimodoc.chengj.online/docs/mimoskill Initiates a chat with the MiMo model, automatically including web search capabilities. Ensure your MIMO_API_KEY is set. ```bash export MIMO_API_KEY=sk-xxxxxxxxxxxxxxxx python3 mimoskill/scripts/mimo_chat.py "今天上海天气" ``` -------------------------------- ### Codex Configuration File (auth.json) Source: https://mimodoc.chengj.online/docs/auth-deployment Configure your Codex client by setting the OPENAI_API_KEY in the auth.json file. Replace the placeholder with your minted m2c key. ```json { "OPENAI_API_KEY": "m2c_" } ``` -------------------------------- ### Enabling Authentication via CLI Flag Source: https://mimodoc.chengj.online/docs/auth-deployment Use the CLI flag to enable authentication, which bypasses potential issues with environment variable loading. This is a reliable method for development environments. ```bash npm run dev -- --auth on ``` -------------------------------- ### View mimo2codex Log File (Linux) Source: https://mimodoc.chengj.online/docs/proxy-faq Display the last 50 lines of the mimo2codex log file if it's redirected to a file. Redirects errors to /dev/null. ```bash tail -n 50 ~/.mimo2codex/mimo2codex.log 2>/dev/null ``` -------------------------------- ### View Docker Compose Logs Since a Specific Time Source: https://mimodoc.chengj.online/docs/docker Displays logs from the mimo2codex service generated within the last 10 minutes. ```bash docker compose logs --since 10m mimo2codex ``` -------------------------------- ### Launch mimo2codex with custom CA certificates on Windows Source: https://mimodoc.chengj.online/docs/proxy-faq Launch mimo2codex on Windows, specifying custom CA certificates to trust for TLS connections, often required for corporate proxies. ```powershell $env:NODE_EXTRA_CA_CERTS = "C:\path\to\corp-ca.pem" mimo2codex ``` -------------------------------- ### Follow Docker Compose Logs Source: https://mimodoc.chengj.online/docs/docker Streams logs from the mimo2codex service in real-time. Useful for monitoring application output. ```bash docker compose logs -f mimo2codex ``` -------------------------------- ### Release Commands Source: https://mimodoc.chengj.online/docs/tag-log Commands for managing project releases via npm scripts. Use these for patch, minor, major, and beta releases. ```bash npm run release:patch # x.y.Z+1 npm run release:minor # x.Y+1.0 npm run release:major # X+1.0.0 npm run release:beta # pre-release ``` -------------------------------- ### Setting Environment Variables for Authentication (Bash) Source: https://mimodoc.chengj.online/docs/auth-deployment Alternative method to enable authentication for the current shell session using bash. This is useful for Linux/macOS environments. ```bash export MIMO2CODEX_AUTH=on ``` -------------------------------- ### Follow Recent Docker Compose Logs Source: https://mimodoc.chengj.online/docs/docker Streams the last 200 lines of logs from the mimo2codex service. Helpful for quickly reviewing recent activity. ```bash docker compose logs -f --tail=200 mimo2codex ``` -------------------------------- ### Enable Server Mode Persistently Source: https://mimodoc.chengj.online/docs/auth-deployment To enable server mode persistently, add `MIMO2CODEX_AUTH=on` to the `~/.mimo2codex/.env` file. Ensure the file exists by running `node dist/cli.js init` or `mimo2codex init` first. ```env # If the file doesn't exist yet, run init once node dist/cli.js init # or `mimo2codex init` if you installed globally # Edit ~/.mimo2codex/.env, add: MIMO2CODEX_AUTH=on ``` -------------------------------- ### Generate Master Key (Bash/Zsh) Source: https://mimodoc.chengj.online/docs/auth-deployment Use this command to generate a secure base64 encoded master key for production environments. ```bash # bash / zsh openssl rand -base64 32 ``` -------------------------------- ### Codex Enable Web UI Entry Point Source: https://mimodoc.chengj.online/docs/codex-enable Access the Codex Enable feature through the web UI sidebar. This is the primary entry point for managing Codex model configurations. ```text http://127.0.0.1:8788/admin/ → sidebar "Codex 启用" ``` -------------------------------- ### Configure proxy for overseas users on macOS Source: https://mimodoc.chengj.online/docs/proxy-faq Set HTTPS and HTTP proxy environment variables for overseas users, using Clash's default port. Includes NO_PROXY configuration. ```bash export HTTPS_PROXY=http://127.0.0.1:7890 export HTTP_PROXY=http://127.0.0.1:7890 export NO_PROXY=localhost,127.0.0.1,::1 mimo2codex ``` -------------------------------- ### Setting Kimi API Key Environment Variable Source: https://mimodoc.chengj.online/docs/kimi This command sets the MOONSHOT_API_KEY environment variable, which is required to authenticate with the Kimi API. Obtain your API key from the Kimi platform console. ```bash export MOONSHOT_API_KEY=sk-xxxxx # get one at https://platform.kimi.com/console/api-keys ``` -------------------------------- ### Launch mimo2codex with custom CA certificates on Mac Source: https://mimodoc.chengj.online/docs/proxy-faq Launch mimo2codex on macOS, specifying custom CA certificates to trust for TLS connections, often required for corporate proxies. ```bash NODE_EXTRA_CA_CERTS=/path/to/corp-ca.pem mimo2codex ``` -------------------------------- ### Configure HTTPS Proxy Temporarily (macOS) Source: https://mimodoc.chengj.online/docs/proxy-faq Sets environment variables for HTTPS_PROXY, HTTP_PROXY, and NO_PROXY in the current shell session. This is useful for testing proxy configurations before making them persistent. ```bash export HTTPS_PROXY=http://127.0.0.1:7890 export HTTP_PROXY=http://127.0.0.1:7890 export NO_PROXY=localhost,127.0.0.1,::1 mimo2codex Copy ``` -------------------------------- ### Check Proxy Listener (macOS) Source: https://mimodoc.chengj.online/docs/proxy-faq Verifies if a process is listening on a specific TCP port using lsof. Useful for debugging proxy connection refusals. ```bash lsof -iTCP -P | grep ``` -------------------------------- ### Configure proxy for China mainland users on Windows Source: https://mimodoc.chengj.online/docs/proxy-faq Remove proxy environment variables to connect directly when not using a proxy, suitable for China mainland users hitting MiMo or DeepSeek on Windows. ```powershell Remove-Item env:HTTPS_PROXY -ErrorAction SilentlyContinue Remove-Item env:HTTP_PROXY -ErrorAction SilentlyContinue mimo2codex ``` -------------------------------- ### Codex Targets Source: https://mimodoc.chengj.online/docs/codex-enable Fetches a flat list of all available provider and model combinations, indicating which have API keys and which are currently set as the runtime override. ```APIDOC ## GET /admin/api/codex-targets ### Description Provides a flat list of all pickable provider and model combinations. It indicates for each combination whether an API key is configured (`hasKey`) and if it is currently set as the active runtime override (`isCurrentOverride`). ### Method GET ### Endpoint /admin/api/codex-targets ### Response #### Success Response (200) - **targets** (array) - A list of available targets, each with: - **providerId** (string) - The ID of the provider. - **modelId** (string) - The ID of the model. - **hasKey** (boolean) - True if the provider has an API key configured. - **isCurrentOverride** (boolean) - True if this is the currently active runtime override. ``` -------------------------------- ### Moonshot Kimi Provider Configuration Source: https://mimodoc.chengj.online/docs/generic-providers Configuration for Moonshot Kimi, including its API base URL, environment key, and model context window. ```json { "id": "kimi", "displayName": "Kimi K2", "baseUrl": "https://api.moonshot.cn/v1", "envKey": "KIMI_API_KEY", "defaultModel": "kimi-k2-0905-preview", "models": [ { "id": "kimi-k2-0905-preview", "contextWindow": 256000 } ] } ``` -------------------------------- ### Check Running Container Version via Image Labels Source: https://mimodoc.chengj.online/docs/docker Inspects the Docker image labels to retrieve the version information stored in 'org.opencontainers.image.version'. ```bash docker image inspect ghcr.io/7as0nch/mimo2codex:latest \ --format '{{index .Config.Labels "org.opencontainers.image.version"}}' ``` -------------------------------- ### Configure proxy for China mainland users Source: https://mimodoc.chengj.online/docs/proxy-faq Unset proxy environment variables to connect directly when not using a proxy, suitable for China mainland users hitting MiMo or DeepSeek. ```bash unset HTTPS_PROXY HTTP_PROXY mimo2codex ``` -------------------------------- ### Local Ollama / LM Studio Provider Configuration Source: https://mimodoc.chengj.online/docs/generic-providers Configuration for local Ollama or LM Studio instances using the open-catalog. Note that Ollama does not validate API keys. ```json { "id": "ollama", "shortcut": "ol", "displayName": "Ollama (local)", "baseUrl": "http://127.0.0.1:11434/v1", "envKey": "OLLAMA_API_KEY", "defaultModel": "qwen2.5-coder:7b" } ``` -------------------------------- ### Apply Codex Configuration Script (Windows) Source: https://mimodoc.chengj.online/docs/auth-deployment Execute this PowerShell script to back up and apply the downloaded Codex configuration to your Windows machine. Ensure the execution policy is bypassed. ```powershell powershell -ExecutionPolicy Bypass -File apply-*.ps1 ```