Rightbrain CLI
The Rightbrain CLI is published as the rightbrain npm package and runs without a global installation through npx rightbrain@latest <command>.
Authentication and context
When token output is captured, stdout contains only the token. token --json returns the token with its dashboard URL, environment name, Organization ID, Project ID, and expiry time. The API base URL is the returned dashboard_url plus /api/v1.
Treat CLI tokens as credentials. Do not commit captured token output or place it in client-side code.
Environments
Named environments keep separate deployment URLs and login sessions. Every command accepts --env <name>. RB_CLI_ENV selects an environment when the flag is absent, and env use sets the default.
env list shows configured environments and the active selection. Its --json form returns environment names and dashboard URLs without exposing session state.
Project setup and generated types
init creates rightbrain.json, updates the configured environment file, installs @rightbrain/sdk when needed, selects or creates an API key, and generates types for selected Tasks.
generate reads the Task IDs from rightbrain.json and writes TypeScript interfaces to generatedTaskTypePath. It requires @rightbrain/sdk version 0.3.0 or later.
The configuration supports either an API key or OAuth client credentials. Credential values can use environment-variable interpolation.
Resource commands
The deprecated create-task, run-task, and list-models commands remain available temporarily. Use task create, task run, and model list.
Automation output
Commands that support --json return machine-readable output. When stdout is piped, the CLI routes prompts to stderr, suppresses spinners, and returns JSON for supported resource commands.
Related
Let compatible coding agents operate Rightbrain through live API contracts.
Select an authentication method for direct API requests.
Use generated Task types with the Rightbrain SDK.
Read the Task run request and response contract.
Browse the complete Task endpoint reference.