Skip to content

docs: config.mdx / cli.mdx still document OpenCode names (OPENCODE_* env vars, .opencode paths, opencode.ai $schema) that MiMoCode does not honor #1150

Description

@ken-jo

Description

The configuration docs under packages/web/src/content/docs/ (config.mdx and cli.mdx) were carried over from the OpenCode fork and were never migrated to the MiMoCode names. They instruct users to set environment variables, create directories, and reference a $schema URL that the current code does not honor — so a user following these docs is silently ignored.

I hit this while building a cross-platform MCP/hook adapter that has to write a config file MiMoCode will actually read: I reverse-engineered the real names from source (flag.ts / config/paths.ts / shared/global.ts) and found they disagree with the published docs. An integrator (or any user) reading the docs would reasonably set OPENCODE_CONFIG or drop files in ~/.config/opencode/ and get nothing.

Evidence — docs say OpenCode (verified on main):

packages/web/src/content/docs/config.mdx:

  • L3 / L6 / L12: prose still says "Using the OpenCode JSON config" / "configure OpenCode".
  • L16: jsonc title="opencode.jsonc" with "$schema": "https://opencode.ai/config.json".
  • L47: Global config (~/.config/opencode/opencode.json).
  • L48: Custom config (OPENCODE_CONFIG env var).
  • L50: .opencode directories.
  • L51: Inline config (OPENCODE_CONFIG_CONTENT env var).
  • L127–L131 and L140–L150: document OPENCODE_CONFIG and OPENCODE_CONFIG_DIR.

packages/web/src/content/docs/cli.mdx: still describes the opencode binary and OpenCode paths throughout (e.g. L3 "OpenCode CLI options", L122 ~/.local/share/opencode/auth.json).

The committed example also points at the foreign schema — .mimocode/mimocode.jsonc L2: "$schema": "https://opencode.ai/config.json".

Evidence — the code only honors MiMoCode names (verified on main):

  • packages/opencode/src/flag/flag.ts: defines MIMOCODE_CONFIG (L44), MIMOCODE_CONFIG_CONTENT (L45), MIMOCODE_CONFIG_DIR (L157), MIMOCODE_HOME (L160), MIMOCODE_DISABLE_PROJECT_CONFIG (L151). There is no OPENCODE_CONFIG / OPENCODE_CONFIG_CONTENT / OPENCODE_CONFIG_DIR reader / alias in config resolution.
  • packages/shared/src/global.ts: const APP = "mimocode" (L6); resolveMimocodeHome() resolves the four base dirs from $MIMOCODE_HOME or XDG ~/.config/mimocode.
  • packages/opencode/src/config/paths.ts: directories() scans .mimocode dirs (targets [".mimocode"], L31 & L37) plus the global config dir — never .opencode.

Net effect: a user who follows config.mdx and sets OPENCODE_CONFIG, creates ~/.config/opencode/opencode.json, or puts overrides in a .opencode/ directory gets all of it silently ignored, because the runtime reads MIMOCODE_* / ~/.config/mimocode/ / .mimocode/ exclusively.

Proposed fix

Migrate the OpenCode names to MiMoCode in config.mdx and cli.mdx (and ideally the locale mirrors under the same dirs):

  • OPENCODE_CONFIGMIMOCODE_CONFIG, OPENCODE_CONFIG_CONTENTMIMOCODE_CONFIG_CONTENT, OPENCODE_CONFIG_DIRMIMOCODE_CONFIG_DIR.
  • ~/.config/opencode/opencode.json~/.config/mimocode/mimocode.json; .opencode directories → .mimocode.
  • $schema and the opencode.jsonc code-fence title → the MiMoCode schema / mimocode.jsonc (this is the same wrong opencode.ai/config.json URL tracked for the live site in [Bug] Invalid $schema URL (returns 404) in MiMo Code configuration #135).
  • Update the committed .mimocode/mimocode.jsonc $schema too.

This is consistent with the in-progress rebrand work (e.g. #1147/#1148 for the package README, #144 for SECURITY.md, #135 for the site $schema), none of which touch these two config docs.

I verified every code name above against flag.ts / config/paths.ts / shared/global.ts on main. I'm happy to open the PR if a maintainer confirms the canonical MiMoCode $schema URL to point at.

Steps to reproduce

  1. Follow config.mdx and set a custom config via the documented env var: export OPENCODE_CONFIG=/tmp/my-config.json (or create ~/.config/opencode/opencode.json, or a project .opencode/ directory).
  2. Start MiMoCode.
  3. Observe the config is ignored. Setting MIMOCODE_CONFIG (or using ~/.config/mimocode/mimocode.json / .mimocode/) is what actually takes effect.

MiMoCode version

Reproduced against current main.

Operating System

Verified by source inspection; path/env resolution is OS-independent (XDG / $MIMOCODE_HOME).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions