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 trycaseQuick 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>
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.
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
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.
- Start by running
trycase login. If a browser cannot be opened, runtrycase login --no-openand ask the user to approve the printed URL. - Run
trycase workspace list. If no workspace is selected, runtrycase workspace use <workspace>ortrycase workspace create --name <name>. - Run
trycase github connectif GitHub is not connected, thentrycase github reposto choose a repo. - Create missing projects with
trycase project create --repo <owner/name>. Keep workspace, project, patch, command, and environment IDs in your notes. - Run
trycase project listand pick the project ID. - Check runtime settings with
trycase project manifest show --project <project>. Repotrycase.yamltakes precedence over saved settings. - 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. - Create the environment with
trycase env create, then runtrycase env wait <env>before sending commands. - After
env execor browser commands, runtrycase command wait <command>to retrieve the result. - Run
trycase computer status <env> --jsonto discover capabilities before using terminal, browser, filesystem, or artifact commands. - Use
terminal open,terminal write,terminal wait-for, andterminal readfor long-running commands, REPLs, dev servers, and watch-mode tests. - Use
fs writeto create temporary scripts in the environment andfs artifactto turn generated files into artifacts. - Prefer
computer browser snapshotbefore clicks. Use text or selector refs from the snapshot before coordinate clicks. - Use
desktop app launch,desktop screenshot,desktop mouse,desktop keyboard, anddesktop windowcommands when the task requires a real visible computer instead of headless browser control. - Capture evidence with
computer browser screenshot,computer browser recording,computer browser console,computer browser network,env logs, andartifact bundle. - Always end with
trycase env destroy <env>ortrycase env destroy --all-active, then confirmSTOPPED - 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-activebefore stopping an automation-heavy session. - Use
env usageorenv statusto confirm active and billable state. - Prefer snapshots and semantic refs for browser control; use coordinates only when necessary.