Workflows

Type a PR number.
Get a running app.

gtl review creates an isolated worktree, allocates resources, runs setup, and boots the server—all from a PR number. Requires the gh CLI for PR fetching; everything else is built in.

10 minutes of setup for 2 minutes of review

Product owner asks to see PR #42. Here's what happens.

the manual way

$ gh pr checkout 42

$ git worktree add ../pr-42 add-oauth-login

$ cd ../pr-42

$ cp ../.env.local .env.local

$ vim .env.local # change PORT, DATABASE_URL…

$ createdb myapp_dev_pr42

$ rails db:schema:load

$ bundle install

$ bin/dev

# 8 commands. 10 minutes. Hope you didn't miss a step.

Next PR? Do it all again. And don't forget to tear everything down when you're done.

One command replaces all of that

gtl review 42 --start
Fetched PR #42 (Add OAuth login)
Created worktree myapp-pr-42
Allocated port 3020
Cloned database myapp_dev_pr_42
Wrote .env.local, ran setup commands
Server running on :3020
https://myapp-pr-42.prt.dev

named URL via gtl serve

Done reviewing? gtl release --drop-db --remove-worktree frees the allocated port, drops the cloned database, cleans up the env file, and removes the worktree directory in one step.

What this makes possible

Workflows tie isolation and networking together: one command should stand up a branch with resources, a URL, and a running process—and another command should tear it down cleanly. That is the bar this page documents end to end; Isolation and Networking explain the underlying pieces.

Product and design review real apps

gtl review <PR> --start gives stakeholders a running checkout without asking them to clone, install dependencies, or edit env files. Pair with gtl serve for a named HTTPS URL per branch so redirects and demos match what engineers see—no throwaway staging deploy required for a first look.

QA exercises several branches at once

Multiple PRs means multiple allocations: distinct ports, databases, and URLs. Test flows in parallel instead of serially reconfiguring one machine. When a branch is merged or obsolete, gtl release --drop-db (or gtl prune --merged) reclaims disk and registry entries explicitly.

Agents and CI drive the same supervisor

Humans use gtl start in a terminal; scripts and agents use gtl restart / gtl stop over the Unix socket—no PID files or signals to guess. Optional hooks in .treeline.yml still bracket setup and teardown the same way for everyone.

Start, stop, restart — no PID files

feature-auth

Your terminal

$ gtl start

Starting server on port 3010

[HMR] Listening on ws://localhost:3010

GET / 200 in 23ms

GET /api/auth 200 in 8ms

Restarting…

Starting server on port 3010

GET / 200 in 12ms

Meanwhile — agent or CI

$ gtl restart

Server restarted.

$ gtl stop

Server stopped.

Human interface

gtl start boots your commands.start and streams logs to your terminal. You see the output in real time. The supervisor injects allocated env vars directly into the child process.

Machine interface

gtl restart and gtl stop send commands over a Unix socket. No PID files, no signal guessing. Agents or scripts control the server without needing the foreground terminal.

Automation hooks and shortcuts

Automation hooks live in .treeline.yml. Everything else is CLI for speed.

Lifecycle hooks

pre_setup, post_setup, pre_release, and post_release run around allocation and teardown. Pre-hooks abort the operation on failure; post-hooks log and continue. Setup: allocate → env → database → pre_setupcommands.setup → editor → post_setup. Release: confirm → pre_release → free/drop → post_release.

Clone and go

gtl clone <repo-url> runs git clone, detects the framework, creates .treeline.yml if missing, and runs gtl setup. It does not start the dev server—cloning an untrusted repo and executing arbitrary start commands is a trust boundary.

Open and await

gtl open opens the app in a browser—HTTPS on {project}-{branch}.prt.dev when gtl serve is running, otherwise http://localhost:{port}. gtl start --await blocks until something listens on the allocated port (use --await-timeout for scripts and CI).

Interactive terminal dashboard

Run gtl dashboard (or gtl dash / gtl ui) for a full-screen terminal dashboard: all projects and worktrees in one place, refreshed every couple of seconds. Move with j/k; s start/stop, o open browser, d release (confirm), / filter.

Supervisor guide →

Review commands

gtl review <PR>
Fetch PR, create worktree, allocate resources, run setup.
gtl review <PR> --start
Same as above, plus boot the server via the supervisor.
gtl release --drop-db
Free allocated resources, drop the cloned database, clean up env files.
gtl prune --merged
Batch clean up all worktrees whose branches have been merged.

Review your first PR

Requires gh CLI for PR fetching. Everything else is built in.

gtl review 42 --start
Full CLI reference →