@/Users/daniil/.codex/RTK.md
--- project-doc ---
mimo-code-setup is the public open-source onboarding repository for a future
GonkaGate CLI that configures local MiMoCode to use GonkaGate as a custom
provider without requiring users to hand-edit MiMoCode config, export secrets
through shell profiles, or understand MiMoCode provider internals.
Planned public flow:
npx @gonkagate/mimo-code-setupCurrent honest state:
- the product PRD exists at
docs/specs/mimo-code-setup-prd/spec.md - package metadata, TypeScript build, CI workflows, release scaffolding, mirrored skills, and contract tests are present
- the latest compatibility audit found no hard blocker in official MiMoCode
@mimo-ai/clireleases for the plannedprovider.gonkagateshape, but runtime implementation must honor MiMoCode-specific config precedence and full-slug model keys src/cli.tsis a thin entrypoint over split CLI seams and now calls the installer runtimesrc/install/contains the runtime contracts, dependency adapters, orchestration, managed writes, rollback, redaction, and verification helpers- the runtime collects the GonkaGate key before the model picker, calls
GET https://api.gonkagate.com/v1/models, and writes every returned model intoprovider.gonkagate.models moonshotai/kimi-k2.6has MiMoCode validation proof for the current minimum-supported MiMoCode contract, but the public picker is now backed by the live GonkaGate model catalog rather than a hardcoded validated allowlist
If implementation status, package name, security flow, config locations, transport contract, or minimum supported MiMoCode version changes, this file must be updated immediately so it stays truthful.
The intended happy path is:
- user runs
npx @gonkagate/mimo-code-setup - installer validates local
mimo - installer collects a GonkaGate
gp-...key through a masked prompt,GONKAGATE_API_KEY, or--api-key-stdin - installer calls
GET /v1/modelswith that key and offers all returned GonkaGate models - installer asks for
userorprojectscope - installer writes the minimum safe MiMoCode config layers
- installer verifies durable MiMoCode config and current-session effective config
- user returns to plain
mimo
For project scope, user-level config owns the provider definition and secret
binding, while repository-local MiMoCode config contains only activation
settings.
These decisions are part of the repo contract. Changing them is a product change.
- npm package:
@gonkagate/mimo-code-setup - intended public npm entrypoint:
npx @gonkagate/mimo-code-setup - stable provider id:
gonkagate - canonical base URL:
https://api.gonkagate.com/v1 - runtime model catalog source:
GET https://api.gonkagate.com/v1/models - current transport target:
chat_completions - current provider package:
@ai-sdk/openai-compatible - future
/v1/responsessupport should be added by migration, not product rename - target CLI:
mimo - target upstream package:
@mimo-ai/cli - minimum supported MiMoCode version:
0.1.0; newer versions must not be blocked solely because they are newer - documented global config example:
~/.config/mimocode/mimocode.json - actual global config target must be resolved from MiMoCode paths and existing
mimocode.jsonc,mimocode.json, orconfig.jsonfiles; createmimocode.jsoncwhen no global config exists - project config target:
.mimocode/mimocode.json MIMOCODE_CONFIGis an override layer loaded after global config and before project/local config, not a replacement for the global config targetMIMOCODE_CONFIG_CONTENTis a runtime-only higher-precedence override layer, not a durable install target- managed user-level provider key:
provider.gonkagate - canonical installer-owned secret binding:
provider.gonkagate.options.apiKey = {file:~/.gonkagate/mimo-code/api-key} - canonical installer-owned cache-key setting:
provider.gonkagate.options.setCacheKey = false - project config must not own the secret binding
- public setup must fetch the model catalog after safe API-key intake instead of exposing a hardcoded model allowlist
- installer success must be based on effective MiMoCode config, not only file writes
- raw
mimo --pure debug configoutput must not be printed because{file:...}substitutions may expose secrets mimo --pure debug configmay trigger upstream schema normalization, so it is verification proof but not a guaranteed no-write command- direct
auth.jsonwrites are out of scope for v1 - shell profile mutation is out of scope
.envgeneration is out of scope- arbitrary custom base URLs are out of scope for v1
- arbitrary custom model ids are out of scope for v1
- never print the GonkaGate
gp-...key - never accept secrets through plain
--api-key - never store the secret in repository-local files
- keep the secret under
~/.gonkagate/mimo-code/... - keep the canonical GonkaGate secret binding only in user config
- preserve unrelated MiMoCode config when editing user config
- create backups before replacing managed user files
- project config must stay commit-safe by default
- higher-precedence custom or managed config must be checked before reporting setup success
docs/specs/mimo-code-setup-prd/spec.mdis the product source of truthsrc/cli.tsis the public runtime entrypoint and callssrc/install/throughsrc/cli/parse/execute/render seamssrc/install/contains successful setup orchestration for safe secret intake, live GonkaGate model-catalog fetch, dynamic provider catalog writes, and effective-config verificationsrc/constants/pins package, provider, transport, config, and model-validation metadata contractsbin/gonkagate-mimo-code.jsis a thin wrapper overdist/cli.js.github/workflows/contains CI, release-please, and npm publish workflows.agents/skills/and.claude/skills/contain mirrored local skill packs- tests under
test/protect the scaffold contract
This repo currently does:
- define the product contract for the MiMoCode setup tool
- provide npm packaging, CI, release-please, and publish scaffolding
- provide a public CLI entrypoint that can configure MiMoCode when the local
mimominimum-version check, secret input, live model-catalog fetch, and effective-config verification pass - provide docs and tests that protect the current runtime contract
- provide mirrored local skills for repo-aware agent work
- expose every model returned by GonkaGate
GET /v1/modelsas a setup choice
This repo currently does not do:
- write direct MiMoCode
auth.json - mutate shell profiles
- generate
.envfiles - support arbitrary custom base URLs or arbitrary custom model ids in v1
.
├── AGENTS.md
├── README.md
├── CHANGELOG.md
├── package.json
├── docs/
├── scripts/
├── src/
│ ├── cli.ts
│ ├── cli/
│ ├── constants/
│ ├── install/
│ └── entrypoint.ts
├── test/
├── .agents/skills/
└── .claude/skills/
Primary public repository summary. Keep implementation status, package name,
intended npx entrypoint, config targets, and security posture truthful.
The product source of truth for the setup tool.
Repository-level architecture contract for setup flow, scope behavior, and future migration path.
Security and secret-handling contract. Any change to auth flow, secret storage, or non-interactive setup must be reflected there.
Current public entrypoint and split parse/execute/render seams.
Runtime implementation for installer contracts, dependency injection,
platform/path helpers, managed writes, rollback, verification, and redacted
results. The default public flow fetches the GonkaGate model catalog from
/v1/models after safe API-key intake.
Trust-boundary parser and fetch adapter for GET /v1/models. Keep it strict
about response shape and redaction-safe about failures.
Package, provider, transport, path, and model-validation constants.
Mirrored skill pack adapted from the shared GonkaGate setup baseline. Mirror updates across both trees when shared skill content changes.
When behavior changes:
- update
AGENTS.md - update
README.md - update relevant files in
docs/ - update
CHANGELOG.mdwhen the change is meaningful to users or contributors - update tests under
test/if the repository contract changed - keep mirrored
.agentsand.claudeskill assets aligned - keep scaffold docs and future runtime docs explicitly labeled so they cannot contradict each other silently
Live catalog exposure must stay distinct from MiMoCode validation claims:
- do not claim every
/v1/modelsentry has full MiMoCode workflow validation unless matching proof exists - add runtime behavior tests before changing catalog fetch, model selection, or provider catalog write behavior
- update the validation proof ledger when a model gains or loses MiMoCode-specific validation status
Release Please must stay driven by releasable Conventional Commits:
- release-please runs on pushes to
mainand opens/updates a release PR only when commits since the latestv*.*.*tag contain a releasable Conventional Commit such asfeat:,fix:,perf:, or a breaking-change marker - when merging a user-visible behavior change that should produce a release PR, make the final merge/squash commit subject a releasable Conventional Commit
- plain subjects such as
Refactor installer runtime...are valid git commits but are release-please no-ops; do not expect a release PR from them - after merging to
main, verify theRelease Pleaseworkflow run for that push before assuming the release PR was created - if the workflow succeeds but no release PR appears, inspect
rtk git log <latest-v-tag>..origin/main --format='%h %s'for missing releasable Conventional Commit subjects - if a releasable change already landed on
mainwith a non-releasable subject, repair it with a minimal empty Conventional Commit onmain, for examplertk git commit --allow-empty -m "feat: fetch GonkaGate model catalog from /v1/models" - let release-please own version bumps,
CHANGELOG.md,.release-please-manifest.json, and configured extra files instead of editing release artifacts manually during normal release flow
Current local validation baseline:
npm run ciThat command should stay green before treating scaffold, contract, or doc changes as ready.
@RTK.md