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 proddev 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 proddoctor 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 stagingHow 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 csvand-q(ids only) where marked. Errors print one line to stderr and the process exits with the code the command documents (2rejected,3auth,4not found,5unexpected,6a--waittimed out,64usage). --debugis global. It prints request timings, retry hints and error stacks to stderr, so stdout stays pipeable.
Where to go next
- The command reference with examples per group: mcid-cli commands
- Projects: create an app, its keys, redirect URIs and server access
- Servers and sync: register servers and follow a sync
- Members and roles: find members and preview permission changes
- Admin access: explain and change admin levels
- Ops: status, audit, statistics and settings
- Dev: test sign-in and permission checks as a project
- Inbound webhook sending from the CLI: mcid-cli webhooks
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.