diff --git a/docs/cli-design.md b/docs/cli-design.md index 420a09f..a281ab7 100644 --- a/docs/cli-design.md +++ b/docs/cli-design.md @@ -52,10 +52,12 @@ mmx ## Authentication Credential resolution order: -1. `--api-key` flag -2. `$MINIMAX_API_KEY` env var -3. `~/.mmx/credentials.json` (OAuth) -4. `api_key` in `~/.mmx/config.yaml` +1. `--api-key` flag (highest priority) +2. `~/.mmx/credentials.json` (OAuth token — only created by `mmx auth login` without `--api-key`) +3. `fileApiKey` in `~/.mmx/config.json` (persisted API key from a previous `mmx auth login --api-key`) + +If none are found, the CLI returns `No credentials found`. The `~/.mmx/credentials.json` file +is **not required** when using API key auth — it is only created during OAuth login. ## Configuration diff --git a/skill/SKILL.md b/skill/SKILL.md index 7f64e6a..b48c06d 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -13,10 +13,13 @@ Use `mmx` to generate text, images, video, speech, music, and perform web search # Install npm install -g mmx-cli -# Auth (persisted to ~/.mmx/credentials.json) +# Auth — API key (persisted to ~/.mmx/config.json) mmx auth login --api-key sk-xxxxx -# Or pass per-call +# Auth — OAuth (persisted to ~/.mmx/credentials.json) +mmx auth login + +# Or pass per-call (no file needed) mmx text chat --api-key sk-xxxxx --message "Hello" ```