mcid-cli

mcid-cli

Run the whole MCID MVP from the terminal: admin access, projects, servers, members, sync, audits and inbound webhooks.

mcid-cli is the command-line client for MCID. It signs in as a system admin with Discord, remembers one encrypted session per profile, and covers the admin surface: projects and API keys, servers and channels, members, roles and admin access, sync, audits and settings, and the inbound webhook lifecycle including signed test submissions.

From install to your first project

npm install -g mcid-cli
mcid-cli login --profile prod --base-url https://mcid.microclub.info
mcid-cli project create --name "Portal" --redirect-uri http://localhost:3000/callback --server "Micro Club" --env-out .env --profile prod
mcid-cli dev sso --project portal --profile prod
mcid-cli project key rotate portal --profile prod

dev sso is the step to do before you write any integration code: it signs in through your project the way your app will, so a wrong redirect URI or missing server access shows up right away. Rotate the key only when you need a new one.

Five commands to get oriented

mcid-cli login --profile prod --base-url https://mcid.example.com
mcid-cli doctor --profile prod
mcid-cli project list --profile prod
mcid-cli server list --profile prod
mcid-cli status --profile prod

doctor checks the config, the keychain, the API and the stored session, so run it first when a command behaves unexpectedly.

Profiles

login always requires an explicit --profile, because it creates state. Every other command reads and writes through the active profile unless you pass --profile, so one deployment can be the default without leaking writes into another:

mcid-cli whoami --profile prod     # who is signed in
mcid-cli profile list              # what exists
mcid-cli project list              # active profile
mcid-cli project list --profile staging

How commands behave

  • Destructive commands confirm first. Type the resource name to proceed, or pass --yes. An aborted confirmation exits with code 2, so scripts never treat a cancel as success.
  • Output formats are uniform. List commands accept --json, -o csv and -q (ids only) where marked. Errors print one line to stderr and the process exits with the code the command documents (2 rejected, 3 auth, 4 not found, 5 unexpected, 6 a --wait timed out, 64 usage).
  • --debug is global. It prints request timings, retry hints and error stacks to stderr, so stdout stays pipeable.

Where to go next

Note

Exit code 0 always means the command completed, including commands whose answer is negative (a permission that came back denied). Non-zero means the command itself did not complete.

Source: apps/cli/src/index.ts, apps/cli/src/config.ts.

On this page