Install OrbCode CLI
OrbCode CLI runs on any system with Node.js >= 20. Install it globally from npm, then sign in with your MatterAI account.Prerequisites
Node.js >= 20 — check with
node --versionA MatterAI account — sign up at app.matterai.so
if you don’t have one
Install from npm
Install from source (development)
npm link creates a symlink to the repo, so after pulling changes you only need to rebuild — no relink required:
Authentication
Browser-based device flow with polling (no copy/paste needed).Start the login flow
Run
orbcode login (or /login inside the TUI). The CLI calls POST /orbcode/auth/start on the MatterAI backend, which issues a one-time device code (10-minute lifetime).Authorize in the browser
The CLI opens
https://app.matterai.so/orbital?loginType=orbcode&devicecode=<code> in your browser. If you’re already signed in, the Authorize OrbCode CLI dialog appears immediately; otherwise you’re redirected to sign in first.Click Authorize
Clicking Authorize binds your session token to the device code. The CLI polls the backend every 3 seconds and picks up the token exactly once.
Alternative authentication
You can skip the browser flow entirely:- API key in settings.json — set
apiKeyin~/.orbcode/settings.json(or a project’s.orbcode/settings.json). - Env token — set
MATTERAI_TOKENto skip login entirely (takes precedence over everything).
Tokens are MatterAI JWTs. A token whose payload has
env: "development"
automatically routes API calls to http://localhost:3000, matching the
extension’s behavior.Troubleshooting
| Problem | Fix |
|---|---|
orbcode: command not found | Run npm link in the repo; ensure npm prefix -g’s bin dir is on your PATH. |
--version shows an old version | Rebuild with npm run build; the linked command runs dist/. |
| Stale link after the rename | npm unlink -g orbitalcode && npm link. |
| Login times out | The device code lives 10 minutes; press Enter to retry, or paste a token manually. |
| 401 on chat | Token expired: /logout then /login. |
| Keyboard input does nothing | OrbCode needs a real TTY (raw mode); it won’t accept piped stdin. Use -p for non-interactive runs. |