Skip to main content

Usage

mdn setup
mdn setup --profile acme
mdn setup --local
mdn setup --profile acme --local
Paste your API key when prompted. Find it in your Median dashboard under Settings > API Keys.

What it does

  1. Validates your API key against the Median backend
  2. Saves credentials to a named profile in ~/.config/mdn/
  3. Optionally binds the current directory to that profile with .median/config.json
  4. Optionally writes agent instructions to CLAUDE.md and AGENTS.md in your project

Profiles

Median API keys are scoped to one workspace. Profiles let you keep multiple workspace keys on the same machine:
mdn setup --profile personal
mdn setup --profile acme
If you do not pass --profile, Median uses the workspace prefix lowercased, such as med.

Project-local config

Use --local when a repository should always use a specific workspace:
mdn setup --profile acme --local
This writes .median/config.json in the current directory:
{
  "profile": "acme"
}
The local config only stores the profile name. API keys stay in ~/.config/mdn/. Median looks for .median/config.json in the current directory and parent directories. Run mdn commands from inside the repository so the right workspace is selected.

Reconfiguring

Run mdn setup --profile <name> again to update that profile’s API key. Run mdn setup --profile <name> --local inside a repository to switch that repository to another workspace profile.

Stored config

Global credentials live in ~/.config/mdn/:
FieldDescription
defaultProfileProfile used when no local project config is found
profilesSaved workspace credentials by profile name
Each profile stores:
FieldDescription
apiKeyMedian API key for one workspace
convexUrlBackend URL extracted from the key
workspaceIdWorkspace identifier
workspaceNameWorkspace name
workspacePrefixTask code prefix, such as MED
Project-local config lives in .median/config.json and stores only profile.