Runtype CLI reference
The runtype CLI manages the resources in your Runtype account from a terminal. This page lists how to install and authenticate the CLI, the options that every command accepts, and the commands in each command group. For the full list of options for any command, run it with --help:
Install
The CLI is the @runtypelabs/cli npm package and requires Node.js 22.12.0 or later. Install it globally with the following command:
To run a single command without installing the package, replace runtype with npx @runtypelabs/cli@latest:
To sign in, install Runtype agent skills, and connect a coding agent in one step, run runtype onboard. For more information, see Connect Runtype to coding agents.
Update
A global installation checks npm for a new stable release once per hour. When it finds one, it downloads and verifies the release in the background and uses it on the next invocation. Automatic updates are off in CI (when the CI environment variable is set), for npx runs, and for project-local installations.
The runtype update command checks for and installs updates on demand:
The following environment variables control automatic updates:
RUNTYPE_DISABLE_AUTO_UPDATE=true: keeps the version that your package manager installed, including a pinned version.RUNTYPE_DISABLE_UPDATE_CHECK=true: keeps the active version and stops the hourly check.
Authenticate
Every command that calls the Runtype API needs a credential. The CLI uses the first one that it finds, in the following order:
- The
RUNTYPE_API_KEYenvironment variable. - A login that
runtype loginstored. The CLI keeps one login for each organization and picks one as described in Use several organizations. - Browser sign-in, when the terminal is interactive.
runtype login stores the API key in the operating system keychain: Keychain on macOS, Credential Manager on Windows, or the Secret Service on Linux. When no keychain is available, such as in a container, the CLI stores the key in an encrypted file in ~/.runtype. To choose the store, set RUNTYPE_CREDENTIAL_STORE to keychain or file.
The following commands manage stored logins:
Replace <api-key> with an API key from Settings > API in the dashboard. For more information, see Managing API keys.
To pass the stored key to another tool, capture the output of runtype auth export-key:
Browser sign-in needs an interactive terminal. Without one, the CLI prints the next command to run instead of opening a browser. A coding agent can also register an account without a browser with runtype auth register. For that flow, see Authentication.
Use several organizations
You can stay logged in to several organizations at the same time. Each runtype login adds a login for the organization that you authorize on the sign-in page. Logging in to an organization again replaces its earlier login.
The CLI picks the login for a command from the first of the following that is set:
- The
--org <org-id>option. - The
RUNTYPE_ORGenvironment variable. - The nearest
.runtype/project.jsonfile in the current directory or a parent directory. - The default login. The most recent
runtype loginoutside a linked project sets it, andruntype auth switchchanges it.
To make every command in a project use one organization, run runtype link in the project root:
The command writes .runtype/project.json. The file contains the organization ID and, for a non-production Runtype API such as staging, the API URL. A link can only pin a Runtype API host; to use any other host, pass --api-url or set RUNTYPE_API_URL. It contains no secrets, so commit it to share the setting with your team. Each person still logs in with their own account.
If a project is linked to an organization that you have no login for, the CLI stops and asks you to log in. It never uses a login for another organization. runtype login in that directory opens the sign-in page with the linked organization selected.
Global options
The following options apply to every command:
Commands that list resources return one page at a time. To get the next page, pass the cursor from the previous result with --cursor <cursor>.
Run flows and agents
The runtype dispatch command runs a flow or an agent and streams the response to the terminal. Pass exactly one of --flow and --agent. The following command runs a flow with two input variables and a message:
Replace <flow-id> with the ID of the flow to run.
The following options control the input and output of dispatch, flows run, and agents execute:
Use the long form --variable. The short form -v is read as the global --verbose option, and the command fails with too many arguments.
runtype dispatch also accepts the following options:
View logs
The runtype tail command streams live execution logs until you press Control+C. It reconnects when the stream ends. The following command streams errors for one flow:
runtype tail accepts --flow, --agent, --surface, and --execution to filter by ID. It also accepts --level (debug, info, warn, or error) and --category (execution, agent, tool, model, system, or error). With --json, it prints one JSON object per line.
The runtype logs commands query stored logs. Both default to the last 24 hours:
runtype logs list: returns matching log entries, newest first.--limitsets the page size, from the default of 500 up to 1,000.--order ascreturns the oldest first.runtype logs stats: returns totals, counts by level and category, and a histogram.
Both commands accept the following filters:
The following command lists failed flow runs from one day:
For more information, see Working with logs.
Flows
The runtype flows commands manage flows:
The runtype flow-versions commands (list, get, published, and publish) manage the saved versions of a flow.
Agents
The runtype agents commands manage agents:
The runtype agent-versions commands (list, get, published, and publish) manage the saved versions of an agent.
For ensure, aliases, and promotion, see Manage agents as code. For Marathon, see Marathon long-running tasks.
Records
The runtype records commands manage records:
The following command creates a record with metadata:
For more information, see Creating and managing Records.
Secrets
The runtype secrets commands manage secrets. Secret values are write-only, so no command prints them:
A secret key starts with a letter and contains only letters, digits, and underscores. runtype secrets create also accepts --product-tenant-id or --end-user-id to scope the secret to one product tenant or end user.
The following command creates a secret from an environment variable, so the value doesn’t appear in your shell history:
For more information, see Managing secrets.
Schedules
The runtype schedules commands manage schedules:
The following command runs a flow at 9:00 every day in the America/New_York time zone:
For more information, see What are Schedules?.
Surfaces
The runtype surfaces commands view surfaces:
Evals
The runtype eval commands submit and read evals:
The records file for runtype eval submit is a JSON array of record IDs, or an object with a recordIds array. For the options of runtype eval run, see Manage evals as code.
Products
The runtype products commands manage products:
For more information about importing, see Importing products.
Ensure flags
The ensure commands for flows, tools, products, surfaces, Runtype Agent Skills, and products ensure-fpo accept these flags:
The flow and Runtype Agent Skill commands also accept --release <mode> (none or publish), --label <text>, and --notes <text>. runtype tools ensure <file> and runtype tools pull <name> work like the flow commands.
runtype client-tokens ensure <file> creates or updates a client token, matched by name, from a JSON definition file. It accepts --dry-run, --expect-no-changes, and --json, and never deletes or regenerates a token.
Other command groups
Run runtype --help to list every command group. The groups that this page doesn’t cover include tools, models, batch, conversations, collections, api-keys, client-tokens, skills, mcp, deploy, and config.
Next steps
- Connect Runtype to coding agents: set up the CLI and MCP connection for a coding agent.
- Manage agents as code: converge agents from source control and promote releases from CI.
- Manage evals as code: run eval suites as a CI gate with
runtype eval run. - Working with logs: filter and read the logs that
runtype logsreturns.