Skip to main content
The official command-line client for Modus — chat with your scopes, manage workflows and context, and script against the Modus API from a terminal, a CI pipeline, or an agent. Package: @getmodus/cli on npm (modus binary).

Quick start

Authenticate

  • OAuth (default) opens your browser and requests exactly the access your account already has in the Modus web app — nothing more, nothing held back. The access token refreshes automatically; modus logout revokes it server-side.
  • CI/scripts: set MODUS_API_KEY — it always overrides the stored credential and is the preferred way to authenticate non-interactively.
  • Avoid modus login --token modus_xxx — a token on the command line is readable from shell history, ps, and CI logs.

Staging (and other non-prod)

Point the CLI at staging with a staging PAT and MODUS_BASE_URL. Chat uses a separate agent host; for standard api.* origins the CLI/SDK derive agent.* automatically (api.staging…agent.staging…), so you only need one URL:
Or persist via login:
Escape hatch for custom origins: set MODUS_AGENT_HOST explicitly. See Authentication for token format and best practices.

Output

  • Commands that return data print compact JSON by default — pipe it to jq, a script, or an agent.
  • Pass --pretty for a human-readable table or summary instead.
  • Exception: chat / scopes chat stream raw response text by default; pass --json on those two for structured SSE events instead.

Global flags

Most commands inherit:
  • --pretty — human-readable table/summary instead of compact JSON
Chat commands (modus chat, modus scopes chat) stream text by default; pass --json for structured events.

Next steps