Skip to navigation

Connect CLI

The runtype-connect CLI (@runtypelabs/connect) connects an existing AI agent repository to Runtype and calls tools on the Runtype Connect MCP server. It requires Node.js 22.12.0 or later and targets https://mcp.runtype.com/mcp (https://api.runtype.com) by default.

Run the CLI

Run commands with npx, or install @runtypelabs/connect globally (npm install -g @runtypelabs/connect) and call runtype-connect directly:

Run the CLI
npx @runtypelabs/connect COMMAND
runtype-connect COMMAND

Replace COMMAND with a Connect command, a built-in command, or a server tool name.

In an interactive TTY (without --no-input or RUNTYPE_CONNECT_NO_INPUT), running with no command or only init flags starts init. Outside an interactive terminal, running with no command prints top-level help.

Command overview

The following table lists the Connect and built-in commands. Every tool on the Runtype Connect MCP server also runs as a kebab-case command (see Tool commands).

CommandPurpose
setupInstalls the MCP server, skill file, and optional Claude Code rules without signing in.
initSigns in, creates or connects a product and ingest key, writes .env, and configures your coding agent.
simulatePrepares an existing product’s simulation context and hands it to your coding agent for a draft plan and estimate.
claimClaims a temporary no-browser account, checks claim status, or removes a saved no-browser session.
mcpServes the Runtype Connect MCP server over stdio.
checkVerifies that recent development runs carry required trace attributes and content.
doctorChecks local env files, credentials, product, ingest key, MCP entry, skill file, and permissions.
relayForwards simulation calls from Runtype to a local agent or MCP server.
syncUpdates tracked skill files and repairs tracked MCP server entries installed by init.
uninstallRemoves tracked MCP server entries, skill files, and optionally Runtype env variables.
login, logoutSigns in to the Connect MCP server or revokes and deletes the stored credential.
auth status, whoamiShows the active server, profile, credential source, and identity without a network call.
auth tokenPrints the active bearer token to stdout.
tools, schema, callLists server tools, prints a tool’s JSON schema, or calls a tool by exact name.
skill installWrites or prints the runtype-connect SKILL.md file.
completionPrints a shell completion script for bash, zsh, or fish.
version, helpPrints the CLI version or command help.

Global flags and environment variables

Global flags apply to every command and can appear anywhere before --, except --api-url and --api must appear before doctor, check, and the commands of read-only tools such as get-status. Don’t place a global flag right after a command flag that expects a value.

The following table lists the global flags:

FlagDefaultDescription
--api-url URL, --api URLhttps://api.runtype.comTargets URL (http or https), sending MCP requests to URL/v1/connect/mcp and writing URL/v1/otel/v1/traces for traces. Accepts --api-url=URL and --api=URL.
--token TOKENNoneUses TOKEN as the bearer credential for one command.
--profile NAMEdefaultSelects a named stored sign-in profile.
--no-inputOffDisables interactive prompts and implicit stdin reads.
--color, --color=MODE, --no-colorautoControls ANSI color output (auto, always, or never). Bare --color sets always; --no-color sets never.
-v, --verboseOffRequests server log messages and prints them to stderr.

-V and --version work only as the first argument. -h and --help work as the first argument for top-level help or after any command for that command’s help.

The following table lists the environment variables that configure the CLI:

VariableDefaultDescription
RUNTYPE_API_URLhttps://api.runtype.comOverrides the Runtype API base URL when --api-url isn’t set.
RUNTYPE_CONNECT_TOKENNoneSupplies a credential when --token isn’t set.
RUNTYPE_CONNECT_PROFILEdefaultSelects the stored sign-in profile when --profile isn’t set.
RUNTYPE_CONNECT_CREDENTIAL_STOREautoWhere login stores credentials: auto (OS keychain with file fallback), keychain, file, or ephemeral (memory only). On Linux, keychain requires DBUS_SESSION_BUS_ADDRESS.
RUNTYPE_CONNECT_CONFIG_DIR$XDG_CONFIG_HOME/runtype-connect (~/.config/runtype-connect) on macOS and Linux; %APPDATA%\runtype-connect on WindowsOverrides the directory for config, sessions, file credentials, and cache (RUNTYPE_CONNECT_CONFIG_DIR/cache).
XDG_CONFIG_HOME, XDG_CACHE_HOME~/.config, ~/.cacheBase config and cache directories on macOS and Linux when RUNTYPE_CONNECT_CONFIG_DIR is unset (Windows cache default: %LOCALAPPDATA%\runtype-connect\cache).
RUNTYPE_CONNECT_NO_INPUTOffDisables interactive prompts and implicit stdin reads for any value other than empty, 0, false, no, or off.
NO_COLORUnsetNon-empty value disables color output and overrides --color.
FORCE_COLORUnsetEnables or disables color output when --color is auto and NO_COLOR is unset.
TERMUnsetTERM=dumb disables color output in --color=auto mode.
BROWSERUnsetBROWSER=none stops login from opening a browser. login also skips the browser over SSH or without a graphical display and prints the sign-in URL instead.

Inside Claude Code, Codex, Cursor, Gemini CLI, OpenCode, or VS Code, init and setup configure that coding agent and doctor checks it by default. Inside Claude Code, Codex, Cursor Agent, Gemini CLI, or OpenCode, --max-output defaults to 30000 characters. Set AI_AGENT to use the same output default in another coding agent.

The CLI resolves credentials in the following order:

  1. --token.
  2. RUNTYPE_CONNECT_TOKEN (fails with exit code 2 if --token sets a different value).
  3. This computer’s no-browser session from init --no-browser, unless you signed in with login after it.
  4. The stored sign-in from login for the target server and profile.

Connect commands

Connect commands manage repository setup, no-browser sign-up claims, local checks, local relays, and updating or removing what init installed. Run setup when you want your coding agent to handle sign-in later; run init to sign in and connect the repository now. Connect commands take precedence over server tools with the same name and accept -h, --help, --FLAG VALUE, and --FLAG=VALUE.

setup

Installs the Runtype Connect MCP server, the repository runtype-connect skill, and optional Claude Code permission rules without signing in, making network requests, or touching .env. It’s safe to run again and prints the commands that sign in and connect the repository (init and init --no-browser). Run setup with the following syntax:

setup usage
runtype-connect setup [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--agent AGENTActive coding agentCoding agent to configure (same names and aliases as init --agent).
--no-mcpAdds the MCP serverSkips adding the Runtype Connect MCP server.
--no-browserRemote HTTP MCP entryConfigures the MCP entry to run mcp over stdio with this computer’s init --no-browser session.
--allow-rulesPrompts in a terminalAdds Claude Code permission rules without asking (Claude Code only). Outside an interactive terminal or with --json, fails with exit code 2 for any API other than https://api.runtype.com.
--no-allow-rulesPrompts in a terminalSkips Claude Code permission rules.
--remove-ask-rulesKeeps matching ask rulesWith --allow-rules, also removes the ask rules that match Connect commands and tools, including any you added.
--jsonHuman-readable outputPrints { projectRoot, mcp, skill, permissions, next: { signIn, noBrowser } } as JSON.

init

Connects the repository in the current directory to Runtype. init signs you in, finds or creates a product, creates an ingest key, and writes RUNTYPE_INGEST_KEY, RUNTYPE_OTLP_URL, and RUNTYPE_ENVIRONMENT to .env (creating new env files with 0600 permissions on Unix). It updates .gitignore if needed, installs the MCP server (runtype-connect, or runtype-connect-HOST for a custom API URL) and runtype-connect skill, and prints or opens the setup prompt. The MCP entry is the remote HTTP server, and signing in to it from the coding agent is optional. The setup prompt tells the coding agent to run every Connect step in its first session as runtype-connect COMMAND --json, and not to stop for the MCP sign-in.

init records the MCP entries and skill files it installs in the CLI configuration directory so sync and uninstall can update or remove them. If saving that record fails, init still succeeds and prints a warning (also returned in warnings under --json). Running init again checks the existing key without creating a new one and never prints the ingest key secret. Run init with the following syntax:

init usage
runtype-connect init [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--name NAMEGit remote or directory nameProduct name to find or create.
--env-file PATH.env (or .env.local if git tracks .env and an untracked .env.local exists)Writes env vars to PATH inside the repository. Refuses tracked files and symlinks to tracked or unignored targets.
--framework NAMEAuto-detected (fallback: OpenTelemetry GenAI)Instrumentation setup prompt (case-insensitive): AI SDK, LangGraph, OpenAI Agents SDK, Pydantic AI, Mastra, OpenAI Agents SDK (TypeScript), eve, Flue, or OpenTelemetry GenAI.
--agent AGENTActive coding agent, else the agent you picked last time, else chosen from PATH interactivelyCoding agent to configure and open (case-insensitive): claude-code, codex, cursor, gemini-cli, opencode, or vscode (aliases: claude, gemini, copilot, cursor-agent). When init opens the agent, it remembers an agent it can open for later runs.
--no-mcpAdds the MCP serverSkips adding the Runtype Connect MCP server.
--no-skillWrites the skill fileSkips writing the runtype-connect skill file.
--skill-scope SCOPEprojectproject (repository root) or user (home directory). Writes .claude/skills/runtype-connect/SKILL.md for Claude Code or no agent, and .agents/skills/runtype-connect/SKILL.md for other agents. Keeps edited copies.
--no-browserBrowser sign-inCreates a temporary, unclaimed account with one product and ingest key without opening a browser, saves the session outside the repository, and configures stdio mcp. Claim within 72 hours with claim to keep it.
--launchPrompts in a terminalOpens your coding agent (Claude Code, Codex, Cursor Agent, Gemini CLI, or OpenCode) with the setup prompt without asking. Prints and copies the prompt if the agent can’t be opened.
--no-launchDefault off a terminalPrints the setup prompt without opening a coding agent.
--allow-rulesPrompts in a terminalAdds Claude Code permission rules without asking (Claude Code only). Outside an interactive terminal or with --json, fails with exit code 2 for any API other than https://api.runtype.com.
--no-allow-rulesPrompts in a terminalSkips Claude Code permission rules.
--remove-ask-rulesKeeps matching ask rulesWith --allow-rules, also removes the ask rules that match Connect commands and tools, including any you added.
--jsonHuman-readable outputPrints the init report as JSON (maskedKey only, plus warnings if any) and opens no coding agent.

For the full repository setup workflow, see Connect a repository.

simulate

Prepares a simulation for the exact product you select. It signs you in or reuses your session, reads saved product context, and offers to open your coding agent. It keeps the existing product and its saved targets, authentication and traces. It doesn’t run repository setup or start a simulation.

Run simulate with the following syntax:

simulate usage
runtype-connect simulate --product PRODUCT_ID [FLAGS]

Replace PRODUCT_ID with the product ID from its Simulations page. Replace FLAGS with any flags from this table:

FlagDefaultDescription
--product ID, --product-id IDRequiredSelects an existing product by its exact ID.
--brief TEXTEmptyIncludes your task brief in the preparation and agent handoff.
--agent AGENTActive coding agent, else the agent you picked last time, else chosen from PATH interactivelyChooses the coding agent, using the same names and aliases as init --agent. An agent simulate can open is remembered for later runs.
--no-launchPrompts in a terminalPrints and copies the handoff instead of opening an agent.
--jsonHuman-readable handoffPrints the preparation result and handoffPrompt as JSON without opening an agent.

The agent prepares a draft plan and estimate for you to review in the dashboard. You start the run there. simulate requires explicit starts for the product’s baseline and proposed changes. Starting a run yourself keeps that requirement in place. Runs already queued or running continue. See Run a baseline simulation.

claim

Claims the temporary organization created by init --no-browser, checks whether it is claimed, or deletes the saved no-browser session. With no flags in an interactive terminal, claim checks status and prompts through email verification. Run claim with the following syntax:

claim usage
runtype-connect claim [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--email EMAILNoneSends a 6-digit verification code to EMAIL and prompts for it interactively unless --json is set.
--otp CODENoneCompletes the claim with the 6-digit code sent by email.
--statusOffChecks whether the organization is claimed without prompting.
--forgetOffDeletes the saved no-browser session and removes RUNTYPE_INGEST_KEY (and RUNTYPE_OTLP_URL if unchanged) from the env file when it still holds this session’s key.
--jsonHuman-readable outputPrints the result as JSON without prompting.

mcp

Serves the Runtype Connect MCP server over stdio until stdin closes, relaying JSON-RPC messages with this computer’s init --no-browser session or a stored sign-in. Start the stdio relay with the following command:

mcp usage
runtype-connect mcp

mcp takes no command flags; global flags apply. For coding agent setup details, see Connect your coding agent.

check

Calls check_first_trace for the repository’s product and reports whether recent development runs carry required attributes and content. When a required check fails, check prints a fix prompt. It makes no changes and requires a sign-in or no-browser session. Run check with the following syntax:

check usage
runtype-connect check [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--product PRODUCT_IDResolved automaticallyChecks PRODUCT_ID instead of resolving from .env or the repository name.
--wait SECONDS30Waits up to SECONDS (integer 0 to 50) for a first run to arrive.
--since TIMESTAMPNoneExamines only runs received at or after TIMESTAMP (ISO 8601).
--jsonHuman-readable outputPrints the check result as JSON.

check exits 0 for healthy, 1 for needs_attention, 5 for degraded (the output says what is missing and what it costs), and 6 for processing or no_traces. For what each check inspects, see Send a first trace.

doctor

Checks the repository’s Connect setup without changing anything. doctor runs env_file, otlp_endpoint, session, product, ingest_key, mcp_server, skill, and permissions, plus content when .env sets RUNTYPE_CONTENT, reporting pass, warn, fail, or skip for each. It shows only the ingest key prefix and prints no other values from .env. Run doctor with the following syntax:

doctor usage
runtype-connect doctor [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--product PRODUCT_IDResolved automatically when signed inChecks the ingest key against PRODUCT_ID (works without signing in).
--agent AGENTActive coding agent, or all supported agentsChecks the MCP server entry and permissions for AGENT (same names and aliases as init --agent).
--jsonHuman-readable outputPrints { ok, apiUrl, mcpUrl, signedIn, prepared, checks } as JSON.

mcp_server passes when the entry points to the Runtype Connect server, whether or not the coding agent has signed in to it. For the remote server, the detail says that signing in is optional and how to do it in the coding agent. session and product check the CLI’s own sign-in and access to the product, which the coding agent’s first session uses.

permissions checks the Claude Code rules for Runtype Connect, warns when rules are missing, a deny rule blocks Connect, or .mcp.json defines another runtype-connect server, and skips for other agents. It never fails doctor.

After setup and before init (when the MCP server or skill is in place without .env), doctor fails env_file, names init as the next step, and sets prepared to true. doctor exits 0 with no failed checks, 1 on a failed check, 2 when the server can’t report the setup status, 3 when sign-in is refused, and 4 when a URL is unreachable or returns an unexpected HTTP status.

relay

Pairs this computer with your Runtype account and forwards simulation calls from Runtype to one local loopback address until you stop it with Ctrl-C. Requires a claimed organization (signed in with login or claimed with claim). When the repository has .runtype/agents.yaml (or .runtype/agents.yml), relay reads defaults from it and can start and stop your local server automatically. Start the relay with one of the following forms:

relay usage
runtype-connect relay [--entry NAME] [--manifest PATH] [FLAGS]
runtype-connect relay --agent AGENT_ID --forward-to LOOPBACK_URL [FLAGS]
runtype-connect relay --protocol mcp --forward-to LOOPBACK_URL [FLAGS]

Replace the following:

  • NAME: the entry name in .runtype/agents.yaml when the manifest defines multiple entries.
  • PATH: the path to a manifest file.
  • AGENT_ID: the agent ID (agents[].id from npx @runtypelabs/connect get-status; required for a2a and chat unless set in the manifest).
  • LOOPBACK_URL: the local address the agent or MCP server listens on.
  • FLAGS: any optional flags from the following table.

The following table lists the flags for relay:

FlagDefaultDescription
--manifest PATH.runtype/agents.yaml (or .yml) at the repository root, when presentReads agent entries from PATH.
--entry NAMEThe only entry when the manifest defines oneSelects the manifest entry. Required when the manifest defines multiple entries.
--no-startOffSkips starting the manifest’s command when the local address isn’t reachable.
--agent AGENT_IDManifest entry’s agentIdAgent ID to make callable. Required for a2a and chat unless set in the manifest.
--forward-to LOOPBACK_URLManifest entry’s forwardToLocal loopback URL to forward calls to. Required unless set in the manifest. Accepts 127.0.0.1, localhost, or ::1 without a query or fragment for a2a and chat; requires literal 127.0.0.1 or [::1] for mcp.
--protocol PROTOCOLManifest entry’s protocol, or a2aLocal protocol: a2a, chat (accepts {"userId","sessionId","message"} and returns {"sessionId","reply"}), or mcp (Streamable HTTP MCP server). Explicit flags override the manifest.
--connectOffRegisters the agent or MCP server as a simulation test target after pairing.
--product-id PRODUCT_ID, --product PRODUCT_IDResolved from .env or sole org productProduct ID used when registering a target with --connect.
--name NAMEComputer hostnameDisplay name for this computer when paired.
--jsonHuman-readable outputPrints one JSON line when ready (status: "callable" for agents; status: "listening" for MCP servers; includes targetId with --connect).

With --protocol a2a, relay forwards only POST requests to LOOPBACK_URL and GET requests to A2A card paths (/.well-known/agent-card.json and /.well-known/agent.json) on that origin. With --protocol chat, it forwards only POST requests to LOOPBACK_URL and serves a generated A2A card itself.

When a manifest entry sets command and the local server isn’t ready (a 2xx from healthPath when set, otherwise any HTTP response from forwardTo), relay starts command in cwd unless you pass --no-start. relay waits up to readyTimeoutMs (default 15 seconds) for that same check to pass and stops the process when relay exits. An already running server is left alone.

For the .runtype/agents.yaml schema and manifest errors, see Agent manifest. For the local relay workflow, see Test against your real agent.

sync

Refreshes the Runtype Connect skill files and MCP server entries that init installed on this computer, without network requests or sign-in. Run sync after upgrading the CLI to update tracked skill files to the installed version. It rewrites each tracked skill file (keeping files you edited after installation unless you pass --force), recreates deleted tracked skill files, and restores tracked MCP entries.

sync acts only on installations recorded by init; entries from setup or skill install aren’t tracked until you run init. Run sync with the following syntax:

sync usage
runtype-connect sync [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--agent AGENTEvery tracked agentSyncs only MCP entries and skill files for AGENT (same names and aliases as init --agent).
--project DIREvery tracked projectSyncs only skill files tracked for DIR. Doesn’t filter MCP entries.
--forceOffOverwrites skill files edited after installation.
--dry-runOffReports what would change without writing files.
--jsonHuman-readable outputPrints { dryRun, mcp, skills } as JSON.

MCP statuses are unchanged, updated, installed, and failed. Skill statuses are unchanged, updated, recreated, missing (--dry-run only), modified_by_user, and failed. sync exits 0 when no item fails and 1 when any item fails.

uninstall

Removes the Runtype Connect MCP server entries and skill files that init installed on this computer, leaving other MCP servers and edited skill files (unless you pass --force) untouched. Makes no network requests.

uninstall acts only on installations recorded by init. It doesn’t remove the product or ingest key in Runtype, your sign-in (logout), a no-browser session (claim --forget), Claude Code permission rules, .gitignore entries, .runtype/agents.yaml, or files created by setup or skill install. Run uninstall with the following syntax:

uninstall usage
runtype-connect uninstall [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--agent AGENTEvery tracked agentRemoves only entries for AGENT (same names and aliases as init --agent).
--project DIREvery tracked projectRemoves only skill files tracked for DIR and sets the directory --wipe cleans.
--wipeOffRemoves RUNTYPE_INGEST_KEY, RUNTYPE_OTLP_URL, and RUNTYPE_ENVIRONMENT from the env file, keeping all other lines and comments.
--env-file PATH.env in the current directory or --projectEnv file that --wipe cleans. Unlike init, doesn’t switch to .env.local automatically.
--forceOffDeletes skill files edited after installation.
--dry-runOffReports what would be removed without changing files.
--jsonHuman-readable outputPrints { dryRun, mcp, skills, envFile } as JSON (envFile appears with --wipe).

MCP statuses are removed, already_absent, and failed. Skill statuses are removed, already_absent, modified_by_user, kept_shared (used by another tracked agent), and failed. Env file statuses are cleaned, unchanged, not_found, and failed (with removed listing removed variables). uninstall exits 0 when nothing fails and 1 when any item or the env file fails.

Claude Code permission rules

For Claude Code, setup and init offer rules that let read-only Connect tools run without asking (plus doctor, check, and the CLI commands of those read-only tools, such as get-status, when installed globally as runtype-connect; these commands take --api-url only before the command name). They write no rule for any other Connect command or tool, so your Claude Code permission mode decides on those, including init, claim, setup, login, relay, sync, and uninstall. When .claude/settings.local.json holds ask rules that match Connect commands and tools, both commands offer to remove them, and remove them only when you confirm or pass --remove-ask-rules with --allow-rules. Every other ask rule stays. Without --allow-rules or --no-allow-rules, both commands ask in an interactive terminal and write no rules outside one or with --json.

Built-in commands

Built-in commands handle authentication, tool discovery, skill installation, and shell completion. All built-in commands except call and version accept -h or --help and accept --FLAG VALUE or --FLAG=VALUE. For call, run call TOOL_NAME --help to print that tool’s help.

login

Signs in to the Runtype Connect MCP server and saves the credential in the configured credential store. Run login with the following syntax:

login usage
runtype-connect login [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--with-tokenOffReads an API key from stdin (or prompts in a terminal), verifies it, and stores it. Pipe the key on stdin off a terminal.
--deviceOffRuns OAuth device-code sign-in and prints a code to approve on another device. Can’t be combined with --with-token or --complete.
--no-browserOpens a browser when availablePrints the sign-in URL (or uses the paste-code flow) instead of opening a browser.
--jsonDefault off a terminalPrints { url, code, next } as JSON and exits so a script or agent can finish with --complete.
--complete URL_OR_CODENoneCompletes a sign-in started with --json.

logout

Revokes a stored OAuth session on the server and deletes the stored credential locally. If RUNTYPE_CONNECT_TOKEN is still set, logout notes it on stdout (or in envTokenStillSet in JSON output). Takes no command flags. Run logout with the following command:

logout usage
runtype-connect logout

auth status and whoami

Shows the active server, profile, credential source, identity claims, and OAuth expiry or refreshability without a network request. whoami is an alias for auth status. Exits 0 when signed in and 3 when signed out or expired. Check sign-in status with either command:

auth status usage
runtype-connect auth status [--json]
runtype-connect whoami [--json]

Pass --json to print JSON in a terminal; non-TTY stdout prints JSON automatically.

auth token

Prints the active bearer token to stdout, refreshing an expiring OAuth token first, and exits 3 when no credential is available. Takes no command flags. Print the token with the following command:

auth token usage
runtype-connect auth token

tools

Lists the tools offered by the Runtype Connect MCP server. Run tools with the following syntax:

tools usage
runtype-connect tools [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--search QUERYNoneFilters tools by name, command path, title, and description.
--refreshUses fresh cacheFetches a fresh tool list from the server.
--allVisible tools onlyIncludes hidden tools.
--jsonText on a TTY; JSON off a TTYPrints the tool list as JSON.

schema

Prints a tool’s name, command, inputSchema, outputSchema, and annotations as JSON. Pass the server tool name (for example, get_status):

schema usage
runtype-connect schema TOOL_NAME

Replace TOOL_NAME with the server tool name.

call

Calls a server tool by its exact name with the same argument and output flags as any tool command. Use call for tools that aren’t cached or share a name with a built-in command:

call usage
runtype-connect call TOOL_NAME [FLAGS]

Replace the following:

  • TOOL_NAME: the exact tool name on the server.
  • FLAGS: the tool’s argument and output flags.

skill install

Writes the runtype-connect SKILL.md file, overwriting any existing file at the target path. Defaults to .claude/skills/runtype-connect/SKILL.md in the repository root (or the current directory outside git). Run skill install with the following syntax:

skill install usage
runtype-connect skill install [FLAGS]

Replace FLAGS with any flags from the following table:

FlagDefaultDescription
--dir DIRRepository root .claude/skills/runtype-connectWrites SKILL.md inside DIR.
--globalOffInstalls to ~/.claude/skills/runtype-connect/SKILL.md.
--printWrites to diskPrints SKILL.md to stdout instead of writing a file.

completion

Prints a shell completion script to stdout for the shell you name:

completion usage
runtype-connect completion SHELL

Replace SHELL with bash, zsh, or fish.

version and help

version, --version, and -V print the CLI version as the first argument. help, --help, and -h print top-level help as the first argument, and help COMMAND (or COMMAND --help) prints help for COMMAND. Check the version or print help with these commands:

version and help usage
runtype-connect version
runtype-connect --version
runtype-connect help COMMAND

Replace COMMAND with a Connect, built-in, or tool command name.

Tool commands

Every tool on the Runtype Connect MCP server runs as a CLI command, including the run-inspection commands get-run-outline, search-run, read-span-payload, and get-span-context (see Investigate a large run). The CLI caches the server’s tool list and refreshes it on an unknown command or flag, so new server tools work without upgrading the CLI. For the full catalog, see Connect MCP tools.

How tools and arguments map

Tool names and input schema properties map to commands and flags by the following rules:

  • Command names: both the exact server name (get_status) and its kebab-case alias (get-status) invoke the tool.
  • Flag names: every top-level input property becomes a kebab-case flag (productId becomes --product-id).
  • Name collisions: a property matching a reserved flag becomes --arg-NAME. Run TOOL_NAME --help to see final flag names.
  • Schema defaults: a required property with a schema default isn’t required on the command line. Run TOOL_NAME --help to see each tool’s flags.
  • Single positional argument: if a tool has one required string property, pass it positionally or as a flag.
  • Non-object schemas: pass non-object inputs with --json-body, --input, or piped stdin.
  • Booleans: pass --FLAG for true, --no-FLAG for false, or --FLAG=true and --FLAG=false.
  • Arrays and maps: repeat flags (--FLAG VALUE_1 --FLAG VALUE_2). Scalar arrays also accept a JSON array string. Map flags take KEY=VALUE pairs (duplicate keys exit 2).
  • Objects and JSON files: accept inline JSON, @PATH for a UTF-8 file, or @- for stdin. Escape a leading @ as @@.
  • Body and field input: pass full arguments with --input FILE, --json-body JSON, or stdin, and set nested fields with -F (--field) and -f (--raw-field). Precedence from lowest to highest: body input, -f and -F, then typed flags and positional arguments. Objects deep-merge; arrays and scalars replace.

Call a tool by its kebab-case name and flags, or pass --json-body when you need an explicit null value:

Call tool commands
npx @runtypelabs/connect get-status --json
npx @runtypelabs/connect check-first-trace --product-id PRODUCT_ID --json
npx @runtypelabs/connect query-traces --json-body '{"environment": null}' --json

Replace PRODUCT_ID with the product ID printed by init.

A result’s next.cli field starts with the command you used (npx @runtypelabs/connect or runtype-connect, or npx @runtypelabs/connect when a coding agent calls MCP tools directly) and adds --api-url when you target another API.

Common tool flags

Every tool command accepts the following flags in addition to its schema-derived flags:

FlagDefaultDescription
--jsonautoPrints the full MCP tool result envelope as JSON (same as --output json).
-o MODE, --output MODEautoOutput format: auto, json, text, raw, ndjson, or table.
--jsonlOffAlias for --output ndjson.
--stream MODEautoStreaming output: auto, raw (text deltas to stdout), or off. --stream raw can’t combine with --output json, ndjson, table, or an active output limit (pass --max-output 0).
--input FILENoneReads the JSON arguments object from FILE, or stdin for -. Can’t combine with --json-body.
--json-body JSONNonePasses the arguments object as an inline JSON string. Can’t combine with --input.
-F KEY=VALUE, --field KEY=VALUENoneSets a typed JSON or schema-aware field (repeatable; supports KEY[SUB]=VALUE, KEY[]=VALUE, @PATH).
-f KEY=VALUE, --raw-field KEY=VALUENoneSets a string field without JSON parsing or @PATH expansion (repeatable; supports KEY[SUB]=VALUE, KEY[]=VALUE).
--raw-stringsOffMakes -F treat values as raw strings.
--dry-runOffPrints { tool, arguments } as JSON without calling the server.
--exampleOffPrints an example arguments JSON object and exits 0.
-y, --yesPrompts in a terminalConfirms destructive tools (such as share-report) without prompting. Required off a TTY or when reading stdin.
--timeout DURATIONDefault client timeoutRequest timeout with optional ms, s, m, or h unit (for example, 30000, 500ms, 1.5s, 5m, 1h).
--max-output CHARSUnlimited for humans; 30000 under a detected coding agentTruncates output past CHARS characters and writes the full result to results/ in the CLI cache directory. JSON becomes {"truncated":true,"bytes":N,"path":"...","preview":"..."}; text keeps head and tail. Pass 0, none, or unlimited to disable.
-h, --helpNonePrints usage, signature, flags, and an example command.
--help-allNonePrints the full tool description and deprecated flags.

Repeating a non-repeatable reserved flag, or combining --json, --jsonl, and --output with conflicting modes, fails with exit code 2.

JSON output and errors

Output formatting depends on --json (or --output) and whether stdout is a TTY:

  • Connect commands (setup, init, claim, check, doctor, relay, sync, uninstall): print text by default and JSON with --json. init --json omits the ingest key secret and opens no coding agent; claim --json disables prompts.
  • Built-in commands: schema always prints JSON. tools, auth status (whoami), login, logout, and skill install (without --print) emit JSON automatically off a TTY.
  • Tool commands on a TTY (--output auto): get-status, get-agent-profile, get-report, and list-runs render terminal summaries. Other tools print pretty-printed JSON of structuredContent (or text blocks).
  • Tool commands off a TTY (--output auto): print compact single-line JSON of structuredContent.
  • Tool commands with --json: print the full MCP tool result envelope (content, structuredContent, isError) as JSON even on a TTY.

Errors print to stderr as plain text (Error: ...) with a hint on a TTY, or as a single JSON line off a TTY:

Non-TTY error envelope on stderr
{"error":{"code":"auth_required","message":"check needs you to be signed in to Runtype Connect","hint":"Run: runtype-connect login, or run runtype-connect init in the repository","exitCode":3}}

How commands resolve the product

When looking for a local ingest key, commands read .env, or .env.local if git tracks .env and an untracked .env.local exists (or if only .env.local sets RUNTYPE_INGEST_KEY). The CLI uses that key only when RUNTYPE_OTLP_URL matches API_URL/v1/otel/v1/traces and the key has the Runtype ingest key format.

Product resolution works as follows:

  • Product-scoped tool commands (tools accepting productId, other than get-status): when you omit --product-id, the CLI resolves the product from the local .env ingest key. Otherwise the server uses your organization’s only product, or lists your products if you have more than one.
  • get-status: when you omit --product-id in a multi-product organization, the CLI matches the local .env ingest key to one product, calls get_status again for it, and adds productFrom: "ingest_key_in_env" and productNote to the result.
  • check: uses --product, then the local .env ingest key, then the organization’s only product or the product named after the repository. Exits 2 and lists products if none matches.
  • doctor: uses --product, then (when signed in) the local .env ingest key, the organization’s only product, or the product named after the repository.
  • relay --connect: uses --product-id (--product), then the local .env ingest key, then the organization’s only product.

Exit codes

The CLI uses fixed exit codes so scripts and coding agents can branch on outcomes. The following table lists every exit code:

Exit codeCategoryMeaning and command-specific behavior
0SuccessCommand succeeded. check is healthy; doctor has no failed checks.
1Tool or runtime errorTool error, unexpected runtime error, or Node.js older than 22.12.0. check is needs_attention; doctor failed a check; setup, sync, or uninstall failed an item.
2Usage or configurationUnknown command or flag, invalid argument, --api-url or --api after doctor, check, or a read-only tool’s command, --allow-rules off a terminal for a non-default API, conflicting --token and RUNTYPE_CONNECT_TOKEN, unwritable config directory or credential store before sign-in, missing --yes, ambiguous product, missing or invalid .runtype/agents.yaml, manifest command that fails to start or exits before ready, or local configuration refusal.
3AuthenticationSign-in required or credential refused. Returned by auth status (whoami), auth token, doctor, and init off a terminal or with --json when no credential is stored (writes nothing and suggests init --no-browser, login --device, or RUNTYPE_CONNECT_TOKEN).
4Network, timeout, or protocolNetwork error, request timeout, invalid server response, unreachable URL in doctor, or a relay manifest command not ready within readyTimeoutMs.
5DegradedReturned by check when the status is degraded: the traces arrive below the fidelity Runtype needs. The output says what is missing and what it costs.
6Wait timed outTimed out waiting for a result. Returned by check when the status is processing or no_traces.
130InterruptedProcess interrupted by Ctrl-C (SIGINT). Ctrl-C stops the command and exits 130; press it again to exit immediately.

Next steps

Continue with one of the following pages:

  • Quickstart: run through connecting an agent from init to a first simulation report.
  • Trace attributes: look up the span and resource attributes Runtype reads from traces.
  • Limits and pricing: check span, retention, and signal allowances by plan.
  • Troubleshooting: resolve ingest errors, first-trace failures, and connection problems.