CLI docs

Control TryCase environments from the command line.

Use the CLI to sign in, connect projects, save runtime settings, upload patches, create disposable environments, control the browser, capture artifacts, and destroy active work cleanly.

Install

The published CLI connects to production by default. Use a one-off runner, or install it globally when you want trycase available in every shell.

npx trycase loginbunx trycase loginpnpm dlx trycase loginnpm install -g trycase

Quick Start

Examples use trycase. In a source checkout, run the same commands with bun apps/cli/src/index.ts. For a fresh machine, start with npx trycase login or bunx trycase login.

trycase login
trycase workspace list
trycase github connect
trycase github repos
trycase project create --repo <owner/name>
trycase project list
trycase env create --project <project> --ref main
trycase env wait <env>
trycase computer browser goto <env> http://localhost:3000
trycase command wait <command>
trycase computer status <env> --json
trycase computer browser snapshot <env>
trycase computer browser screenshot <env>
trycase desktop app launch <env> browser http://localhost:3000
trycase desktop screenshot <env>
trycase artifact bundle <env>
trycase env destroy <env>
Billing rule: environments become active and billable after runner capacity is allocated. Destroy environments when the task is done and verify STOPPED - NOT BILLABLE.

Runtime Settings

TryCase checks for trycase.yaml in the repo first. If the file exists, those repo settings are authoritative. If it does not exist, saved settings from the dashboard or CLI are used.

Supported runtimes
docker-composeUses a Compose file and app URL.
npmRuns install and start commands with npm.
pnpmRuns install and start commands with pnpm.
yarnRuns install and start commands with yarn.
bunRuns install and start commands with Bun.
Runner sizes

Use small, standard, large, or xlarge. Start with standard unless the project needs more CPU or memory.

trycase project manifest generate \
  --project <project> \
  --runtime npm \
  --install "npm install" \
  --start "npm run dev" \
  --app-url http://localhost:3000 \
  --healthcheck http://localhost:3000 \
  --size standard
version: 1
runtime:
  type: npm
  size: standard
  timeout_minutes: 60
repo:
  provider: github
  owner: example
  name: app
  ref: main
package:
  install: npm install
  start: npm run dev
  app_url: http://localhost:3000
  healthcheck: http://localhost:3000
artifacts:
  video: always
  screenshots: always
  logs: always
  traces: on_failure

Command Reference

Sign In And Configuration
trycase login
Open the browser approval flow and save CLI credentials.
trycase login --no-open
Print the approval URL when another browser or user needs to open it.
trycase logout
Clear saved CLI sign-in data.
trycase doctor
Check sign-in, selected workspace, and GitHub connection state.
trycase cleanup
Destroy all active environments for the signed-in user.
trycase config set dashboardUrl https://www.trycase.dev
Point the CLI at a dashboard.
trycase config set apiUrl <api-url>
Override the control API URL when testing another deployment.
Workspaces And GitHub
trycase workspace list
List workspaces available to the signed-in user.
trycase workspace create --name <name>
Create and select a workspace.
trycase workspace use <workspace>
Select a workspace for future CLI commands.
trycase github connect
Open GitHub setup for the selected workspace and wait for it to finish.
trycase github connect --no-open
Print the GitHub setup URL for manual approval.
trycase github installations
List connected GitHub accounts for the selected workspace.
trycase github repos
List repos available to create projects from.
trycase github repos --query <owner/name>
Filter connected repos before creating a project.
trycase github disconnect <installation> --yes
Disconnect a GitHub account and detach linked projects.
Usage Credits
trycase billing status
Workspace admin: show your workspace tier, credits, and active environment allowance.
trycase billing ledger
Workspace admin: show your workspace credit grants, tier changes, and usage debits.
trycase admin billing list
Platform admin: list workspaces and billing state.
trycase admin billing set-tier --workspace <workspace> --tier pro
Platform admin: set a workspace tier.
trycase admin billing grant --workspace <workspace> --credits 1000 --reason "Beta top-up"
Platform admin: add manual top-up credits.
trycase admin billing deduct --workspace <workspace> --credits 100
Platform admin: correct a credit balance.
trycase admin billing set-credits --workspace <workspace> --credits 5000
Platform admin: set the exact available credit balance.
Projects And Runtime Settings
trycase project list
List projects in the selected workspace.
trycase project create --repo <owner/name>
Create a project from a connected GitHub repo.
trycase project create --workspace <workspace> --name <name> --repo <owner/name>
Create a project in an explicit workspace.
trycase project manifest show --project <project>
Print the saved runtime settings for a project.
trycase project manifest generate --project <project> --runtime npm --start "npm run dev"
Generate saved settings without writing a file to the repo.
trycase project manifest set --project <project> --file trycase.yaml
Validate and save runtime settings from a local YAML file.
Secrets
trycase project secret set --project <project> --name <name> --value <value>
Store a project-scoped secret.
trycase project secret list --project <project>
List secret names without exposing values.
Patches
trycase patch upload --project <project> --base main
Upload local unpushed edits from a git working tree.
trycase patch upload --project <project> --base main --base-sha <sha>
Upload a patch tied to an expected base commit.
trycase patch list --project <project>
List uploaded patches for a project.
trycase patch show <patch>
Show patch metadata.
Environments
trycase env create --project <project> --ref main
Create an environment from a ref.
trycase env create --project <project> --ref main --patch <patch>
Create an environment with a local patch applied.
trycase env wait <env>
Wait until the environment is ready, stopped, failed, or expired.
trycase env status <env>
Print state, active time, and billable status.
trycase env exec <env> "npm test"
Run a shell command in the environment.
trycase env exec <env> "npm test" --wait
Run a shell command and wait for the result.
trycase env logs <env>
Print command output and logs collected so far.
trycase env artifacts <env>
List uploaded screenshots, recordings, traces, and logs.
trycase env destroy <env>
Destroy one environment and wait until it is stopped.
trycase env destroy --all-active
Destroy every active environment for the signed-in user.
Command Results
trycase command status <command>
Print the current state and output for one command.
trycase command wait <command>
Wait until a command succeeds or fails and print the output.
Computer And Browser Control
trycase computer status <env>
Print environment status and available computer capabilities.
trycase computer status <env> --json
Print machine-readable computer capability data.
trycase computer exec <env> "pwd && ls" --wait
Run a one-shot shell command and print the output.
trycase computer browser goto <env> http://localhost:3000
Open a URL in the environment browser.
trycase computer browser snapshot <env>
Read the accessibility snapshot for reliable element targeting.
trycase computer browser click <env> "text=Submit"
Click an element by browser reference.
trycase computer browser type <env> "input[name=email]" "agent@example.com"
Type text into a referenced element.
trycase computer browser press <env> Enter
Press a key in the browser.
trycase computer browser hover <env> "text=Menu"
Hover an element.
trycase computer browser scroll <env> --y 800
Scroll the page.
trycase computer browser wait-for <env> --text Ready
Wait for visible text or a selector.
trycase computer browser evaluate <env> "document.title"
Evaluate a browser expression.
trycase computer browser console <env>
Print captured browser console messages.
trycase computer browser network <env>
Print captured browser network events.
trycase computer browser screenshot <env>
Capture a screenshot artifact.
trycase computer browser recording <env>
Finalize and upload the browser recording.
trycase computer browser run <env> scripts/check-page.js
Run a custom page-scoped browser script from the repo.
Full Desktop Control
trycase desktop status <env>
Check desktop display state and available Linux desktop tools.
trycase desktop app launch <env> browser http://localhost:3000
Open Chromium on the visible desktop.
trycase desktop screenshot <env>
Capture the full desktop as an artifact.
trycase desktop mouse move <env> --x 400 --y 300
Move the desktop mouse.
trycase desktop mouse click <env> --window <window> --x 400 --y 300
Click coordinates relative to a desktop window.
trycase desktop mouse drag <env> --window <window> --from 100,100 --to 500,400
Drag between window-relative coordinates.
trycase desktop keyboard type <env> "hello"
Type text into the focused desktop app.
trycase desktop keyboard hotkey <env> ctrl+l
Press a desktop key combination.
trycase desktop window list <env>
List visible desktop windows and their coordinates.
trycase desktop window resize <env> <window> --width 1200 --height 800
Resize or move a desktop window.
trycase desktop clipboard set <env> "text"
Set the desktop clipboard.
trycase desktop recording start <env>
Start full desktop recording.
trycase desktop recording stop <env>
Stop and upload the desktop recording artifact.
Terminal Sessions
trycase terminal open <env>
Open a persistent terminal session in the repo.
trycase terminal write <session> "npm test" --env <env> --enter
Write input to a terminal session.
trycase terminal write <session> "npm run dev" --env <env> --enter --wait-for "Ready"
Write and wait for output after the write cursor.
trycase terminal read <session> --env <env>
Read terminal output and get the next cursor.
trycase terminal wait-for <session> "Ready" --env <env>
Wait until expected output appears.
trycase terminal resize <session> --env <env> --cols 120 --rows 40
Update session dimensions.
trycase terminal interrupt <session> --env <env>
Send an interrupt to the session.
trycase terminal close <session> --env <env>
Close the terminal session.
Filesystem And Artifacts
trycase fs list <env> .
List files in the repo scope.
trycase fs read <env> package.json
Read a small text file.
trycase fs write <env> scripts/check.js --content "export default async () => 'ok'"
Write a file inside the environment.
trycase fs artifact <env> test-results/report.html --name report.html
Export a file as a downloadable artifact.
trycase artifact list <env>
List artifact IDs, names, and sizes.
trycase artifact url <artifact>
Print a short-lived artifact download URL.
trycase artifact download <artifact> --out tmp-artifacts/file
Download one artifact.
trycase artifact bundle <env> --out tmp-artifacts
Download all artifacts for an environment.

LLM Operating Guide

This flow is designed for coding agents that need to verify web apps without direct access to a long-lived browser session.

  1. Start by running trycase login. If a browser cannot be opened, run trycase login --no-open and ask the user to approve the printed URL.
  2. Run trycase workspace list. If no workspace is selected, run trycase workspace use <workspace> or trycase workspace create --name <name>.
  3. Run trycase github connect if GitHub is not connected, then trycase github repos to choose a repo.
  4. Create missing projects with trycase project create --repo <owner/name>. Keep workspace, project, patch, command, and environment IDs in your notes.
  5. Run trycase project list and pick the project ID.
  6. Check runtime settings with trycase project manifest show --project <project>. Repo trycase.yaml takes precedence over saved settings.
  7. For unpushed edits, work in the target repo or a temp clone, run trycase patch upload --project <project> --base <ref>, and use the returned patch ID.
  8. Create the environment with trycase env create, then run trycase env wait <env> before sending commands.
  9. After env exec or browser commands, run trycase command wait <command> to retrieve the result.
  10. Run trycase computer status <env> --json to discover capabilities before using terminal, browser, filesystem, or artifact commands.
  11. Use terminal open, terminal write, terminal wait-for, and terminal read for long-running commands, REPLs, dev servers, and watch-mode tests.
  12. Use fs write to create temporary scripts in the environment and fs artifact to turn generated files into artifacts.
  13. Prefer computer browser snapshot before clicks. Use text or selector refs from the snapshot before coordinate clicks.
  14. Use desktop app launch, desktop screenshot, desktop mouse, desktop keyboard, and desktop window commands when the task requires a real visible computer instead of headless browser control.
  15. Capture evidence with computer browser screenshot, computer browser recording, computer browser console, computer browser network, env logs, and artifact bundle.
  16. Always end with trycase env destroy <env> or trycase env destroy --all-active, then confirm STOPPED - NOT BILLABLE.
# Recommended patch workflow
tmpdir=$(mktemp -d)
git clone https://github.com/<owner>/<repo>.git "$tmpdir"
cd "$tmpdir"
git checkout -b trycase-temp-verify
# make or copy changes
trycase github repos --query <owner/repo>
trycase project create --repo <owner/repo>
trycase billing status
trycase patch upload --project <project> --base main
trycase env create --project <project> --ref main --patch <patch>
trycase env wait <env>
trycase computer browser goto <env> http://localhost:3000
trycase command wait <command>
trycase computer browser snapshot <env>
trycase computer browser screenshot <env>
trycase computer browser recording <env>
trycase artifact bundle <env>
trycase env destroy <env>

Safety Checklist

  • Do not print saved tokens or paste them into chat.
  • Use temp branches or patch upload for test changes. Do not modify a main branch for verification.
  • Use env destroy --all-active before stopping an automation-heavy session.
  • Use env usage or env status to confirm active and billable state.
  • Prefer snapshots and semantic refs for browser control; use coordinates only when necessary.

Troubleshooting

Login expires

Run trycase login again. Login approvals are short lived and one time use.

Environment stays queued

Check env status. If it does not progress, destroy it and create a fresh environment.

Command only prints an ID

Use trycase command wait <command>, then env logs <env> for broader environment logs.

Patch does not apply

Check logs and artifacts. Recreate the patch from the correct base ref and try again.