CLI reference

On this page

Commands that take a site use the site for the current folder when you leave it out.

leash sites

List sites and what serves them

Terminal window
leash sites [OPTIONS]
Argument Meaning
--json Print JSON

leash status

Show Short Leash's status

Terminal window
leash status

leash park

Serve every folder inside PATH (default: current folder) as name.test

Terminal window
leash park [PATH]
Argument Meaning
PATH Folder (default: the current folder)

leash forget

Stop parking PATH (default: current folder)

Terminal window
leash forget [PATH]
Argument Meaning
PATH Folder (default: the current folder)

Serve the current folder as NAME.test (default: the folder's name)

Terminal window
leash link [NAME]
Argument Meaning
NAME Site name (default: the folder's name)

Remove a link. A renamed site in a parked folder gets its folder's name back

Terminal window
leash unlink [SITE]
Argument Meaning
SITE Site (default: the site for the current folder)

leash rename

Give a site a new address, NAME.test. Its folder keeps its name

Terminal window
leash rename [OPTIONS] <NAME>
Argument Meaning
NAME The new name, e.g. shop for shop.test
--site Site (default: the site for the current folder)

leash alias

List a site's aliases (other NAME.test addresses it answers at), or add or remove one

Terminal window
leash alias [OPTIONS] [ACTION] [NAME]
Argument Meaning
ACTION add or remove; leave out to list them
NAME The alias, e.g. legacy for legacy.test
--site Site (default: the site for the current folder)

leash secure

Serve sites over HTTPS, e.g. leash secure shop blog

Terminal window
leash secure [SITES]...
Argument Meaning
SITES Sites (default: the site for the current folder)

leash unsecure

Serve sites over plain HTTP

Terminal window
leash unsecure [SITES]...
Argument Meaning
SITES Sites (default: the site for the current folder)

leash use

Set the default PHP version

Terminal window
leash use <VERSION>
Argument Meaning
VERSION PHP version, e.g. 8.4

leash isolate

Pin a site to a PHP or Python version

Terminal window
leash isolate [OPTIONS] <VERSION>
Argument Meaning
VERSION Version, e.g. 8.4 for PHP or 3.12 for Python
--site Site (default: the site for the current folder)

leash unisolate

Go back to the default version

Terminal window
leash unisolate [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder)

leash run

Set the command that starts a site's dev server ("$PORT" is substituted)

Terminal window
leash run <SITE> <COMMAND>
Argument Meaning
SITE Site name
COMMAND Command, e.g. npm run dev -- --port $PORT

leash start

Start sites, e.g. leash start shop blog

Terminal window
leash start [SITES]...
Argument Meaning
SITES Sites (default: the site for the current folder)

leash stop

Stop sites, e.g. leash stop shop blog

Terminal window
leash stop [SITES]...
Argument Meaning
SITES Sites (default: the site for the current folder)

leash share

Share a site on a public https address through Cloudflare

Terminal window
leash share [SITE]
Argument Meaning
SITE Site (default: the site for the current folder)

leash unshare

Stop sharing a site

Terminal window
leash unshare [SITE]
Argument Meaning
SITE Site (default: the site for the current folder)

leash open

Open a site in the browser

Terminal window
leash open [SITE]
Argument Meaning
SITE Site (default: the site for the current folder)

leash requests

Show recent requests (add --follow to watch)

Terminal window
leash requests [OPTIONS] [SITE]
Argument Meaning
SITE Site (default: the site for the current folder)
-f, --follow Keep watching for new lines

leash logs

Show a process's log, e.g. site:shop, php:8.4 (add --follow to watch)

Terminal window
leash logs [OPTIONS] [SOURCE]
Argument Meaning
SOURCE Log source (default: the site for the current folder)
-f, --follow Keep watching for new lines

leash ca

Print the Short Leash CA certificate (for tools that need it)

Terminal window
leash ca

leash php

Run PHP for the current folder: the site's version, with Short Leash's settings, e.g. leash php artisan inspire

Terminal window
leash php [ARGS]...
Argument Meaning
ARGS Arguments passed to PHP

leash composer

Run Composer with the current folder's PHP, e.g. leash composer install

Terminal window
leash composer [ARGS]...
Argument Meaning
ARGS Arguments passed to Composer

leash node

Run Node for the current folder: the site's version, e.g. leash node server.js

Terminal window
leash node [ARGS]...
Argument Meaning
ARGS Arguments passed to Node

leash npm

Run npm with the current folder's Node, e.g. leash npm run dev

Terminal window
leash npm [ARGS]...
Argument Meaning
ARGS Arguments passed to npm

leash npx

Run npx with the current folder's Node, e.g. leash npx vite build

Terminal window
leash npx [ARGS]...
Argument Meaning
ARGS Arguments passed to npx

leash mcp

Serve the Model Context Protocol on stdio, for AI coding tools

Terminal window
leash mcp

leash process

Manage a site's background processes (queue workers, schedulers…)

Subcommands: list, add, starts, run, start, stop, restart, remove.

leash process list

List the current site's processes and suggestions

Terminal window
leash process list [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder)

leash process add

Add a process and start it, e.g. leash process add "php artisan queue:work"

Terminal window
leash process add [OPTIONS] <COMMAND>
Argument Meaning
COMMAND Command to run in the site's folder
--name Display name (default: the command)
--once A command that runs once and stops (a migration, a build): it's added without running; run it with leash process run
--on-visit Start it on the site's first visit since Short Leash (or the site) started, instead of with Short Leash; it isn't started now
--site Site (default: the site for the current folder)

leash process starts

Choose when a process starts: only when you start it, with Short Leash, or on the site's first visit, e.g. leash process starts vite on-visit

Terminal window
leash process starts [OPTIONS] <ID> <WHEN>
Argument Meaning
ID Process ID, from leash process list
WHEN When it starts: manually, with-leash or on-visit
--site Site (default: the site for the current folder)

leash process run

Run a command that runs once, wait for it to end, and exit with its status, e.g. leash process run migrate

Terminal window
leash process run [OPTIONS] <ID>
Argument Meaning
ID Process ID, from leash process list
--site Site (default: the site for the current folder)

leash process start

Start a process

Terminal window
leash process start [OPTIONS] <ID>
Argument Meaning
ID Process ID, from leash process list
--site Site (default: the site for the current folder)

leash process stop

Stop a process

Terminal window
leash process stop [OPTIONS] <ID>
Argument Meaning
ID Process ID, from leash process list
--site Site (default: the site for the current folder)

leash process restart

Restart a process

Terminal window
leash process restart [OPTIONS] <ID>
Argument Meaning
ID Process ID, from leash process list
--site Site (default: the site for the current folder)

leash process remove

Stop and remove a process

Terminal window
leash process remove [OPTIONS] <ID>
Argument Meaning
ID Process ID, from leash process list
--site Site (default: the site for the current folder)

leash octane

Serve a Laravel site with Laravel Octane, e.g. leash octane frankenphp, or leash octane off

Terminal window
leash octane [OPTIONS] <SERVER>
Argument Meaning
SERVER swoole, frankenphp, or off for PHP-FPM
--site Site (default: the site for the current folder)

leash docroot

Serve a PHP or static site from another folder, e.g. leash docroot web, or leash docroot auto

Terminal window
leash docroot [OPTIONS] [PATH]
Argument Meaning
PATH A folder inside the project, or auto for the one Short Leash detects. Leave it out to see the folder served now
--site Site (default: the site for the current folder)

leash proxy

Send a site's requests to an app you run yourself on a port of this computer, e.g. leash proxy 3000, or leash proxy off

Terminal window
leash proxy [OPTIONS] [TARGET]
Argument Meaning
TARGET The app's port (3000, localhost:3000, 127.0.0.1:3000), or off to serve the site from its folder again. Leave it out to see the port used now
--site Site (default: the site for the current folder)

leash init

Write leash.toml in a site's folder from its settings in Short Leash.

Anything that looks like a secret is left out, and nothing comes from leash.local.toml. In a Git repository that doesn't ignore leash.local.toml yet, it's added to the site folder's .gitignore

Terminal window
leash init [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder)
--force Replace a leash.toml that's already there

leash project

Show what a site's leash.toml sets and whether its folder is trusted

Terminal window
leash project [OPTIONS] [COMMAND]
Argument Meaning
--site Site (default: the site for the current folder)
--json Print JSON

Subcommands: apply, trust, untrust.

leash project apply

Apply a site's leash.toml: install what it names and start its services and processes.

It lists the Short Leash settings it replaces with the file's and asks first. A folder that isn't trusted is asked about at a terminal whatever the options

Terminal window
leash project apply [OPTIONS]
Argument Meaning
--yes Replace Short Leash's settings with the file's without asking. It never trusts the folder
--site Site (default: the site for the current folder)

leash project trust

Trust a site's folder to run the commands and services its leash.toml asks for, and its Git hooks.

It lists what the grant allows and asks at a terminal; there's no way to trust without one

Terminal window
leash project trust [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder)

leash project untrust

Stop trusting a site's folder: its processes from leash.toml stop, and its services keep running

Terminal window
leash project untrust [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder)

leash env

Manage a site's environment variables (its server, processes and PHP requests see them)

Subcommands: list, set, unset.

leash env list

List a site's environment variables

Terminal window
leash env list [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder)

leash env set

Set a variable, e.g. leash env set APP_ENV staging

Terminal window
leash env set [OPTIONS] <KEY> <VALUE>
Argument Meaning
KEY Variable name
VALUE Value
--site Site (default: the site for the current folder)

leash env unset

Remove a variable

Terminal window
leash env unset [OPTIONS] <KEY>
Argument Meaning
KEY Variable name
--site Site (default: the site for the current folder)

leash webhook

Webhooks: public addresses that check and forward deliveries to your sites

Subcommands: list, start, stop, deliveries, show, resend, release.

leash webhook list

List webhooks, their addresses and where they send

Terminal window
leash webhook list [OPTIONS]
Argument Meaning
--json Print JSON

leash webhook start

Start a webhook's tunnel (it starts again with Short Leash)

Terminal window
leash webhook start <WEBHOOK>
Argument Meaning
WEBHOOK Webhook name or id

leash webhook stop

Stop a webhook's tunnel

Terminal window
leash webhook stop <WEBHOOK>
Argument Meaning
WEBHOOK Webhook name or id

leash webhook deliveries

Show recent deliveries (add --follow to watch)

Terminal window
leash webhook deliveries [OPTIONS] <WEBHOOK>
Argument Meaning
WEBHOOK Webhook name or id
-f, --follow Keep watching for new deliveries

leash webhook show

Show one delivery: headers, body, signature check and replies

Terminal window
leash webhook show <DELIVERY>
Argument Meaning
DELIVERY Delivery number, from leash webhook deliveries

leash webhook resend

Send a delivery again to the webhook's sites, signed afresh

Terminal window
leash webhook resend <DELIVERY>
Argument Meaning
DELIVERY Delivery number

leash webhook release

Send every held delivery on, oldest first

Terminal window
leash webhook release <WEBHOOK>
Argument Meaning
WEBHOOK Webhook name or id

leash pair

Pair: share your screen, talk, and give control to up to three people

Subcommands: start, share, stop-sharing, status, let-in, give-control, take-back, join, end.

leash pair start

Start a call and print its invite once it can be opened. It starts with voice only; share your screen with leash pair share, or at once with --share. The call itself is in the Short Leash app

Terminal window
leash pair start [OPTIONS]
Argument Meaning
--share Share your screen from the start

leash pair share

Share your screen with the call (on a Mac, pick it in the system's picker)

Terminal window
leash pair share

leash pair stop-sharing

Stop sharing your screen; the call goes on with voice. Control comes back to you

Terminal window
leash pair stop-sharing

leash pair status

Who's in, who's waiting, and the invite

Terminal window
leash pair status [OPTIONS]
Argument Meaning
--json Print JSON

leash pair let-in

Let someone who's waiting in

Terminal window
leash pair let-in <ID>
Argument Meaning
ID Their number from leash pair status

leash pair give-control

Give someone in the call your mouse and keyboard, while your screen is shared (host or guest). Moving your own mouse or touching a key takes control back

Terminal window
leash pair give-control <ID>
Argument Meaning
ID Their number from leash pair status

leash pair take-back

Take control of your screen back from whoever has it

Terminal window
leash pair take-back

leash pair join

Join a call from an invite link (the Short Leash app shows the call)

Terminal window
leash pair join <INVITE>
Argument Meaning
INVITE The invite, https://….trycloudflare.com/#…

leash pair end

End the call you host, or leave the one you're in

Terminal window
leash pair end

leash backup

Back up and restore MySQL, MariaDB, PostgreSQL and MongoDB databases

Subcommands: list, now, skip, include, restore.

leash backup list

List each database's backups, newest first

Terminal window
leash backup list [OPTIONS]
Argument Meaning
--json Print JSON

leash backup now

Back up now: every running database service, one service, or one database

Terminal window
leash backup now [SERVICE] [DATABASE]
Argument Meaning
SERVICE Service, e.g. mysql or postgres (default: all running)
DATABASE Database (default: all of the service's)

leash backup skip

Leave a database out of the daily backup and of leash backup now. Backing it up by name still works

Terminal window
leash backup skip <SERVICE> <DATABASE>
Argument Meaning
SERVICE Service, e.g. mysql or postgres
DATABASE Database to leave out

leash backup include

Put a skipped database back into the daily backup

Terminal window
leash backup include <SERVICE> <DATABASE>
Argument Meaning
SERVICE Service, e.g. mysql or postgres
DATABASE Database to include again

leash backup restore

Restore a backup, replacing its database after backing it up first

Terminal window
leash backup restore [OPTIONS] <BACKUP>
Argument Meaning
BACKUP Backup id, from leash backup list
--into Restore into a new database with this name instead

leash task

A site's task list, shared with AI agents: add, claim, note, block, review and finish tasks

Subcommands: list, show, add, note, block, release, review, status, done, claim.

leash task list

List the site's tasks: status, priority, tags and who has each

Terminal window
leash task list [OPTIONS]
Argument Meaning
--json Print JSON
--site Site (default: the site for the current folder)

leash task show

Show a task: its description, steps and activity

Terminal window
leash task show [OPTIONS] <ID>
Argument Meaning
ID Task ID, from leash task list
--site Site (default: the site for the current folder)
--json Print JSON

leash task add

Add a task, e.g. leash task add "Fix the cart total" --tag cart

Terminal window
leash task add [OPTIONS] <TITLE>
Argument Meaning
TITLE What to do
--notes The description, in Markdown; - [ ] lines are its steps
--priority How much it matters
--tag A tag, e.g. cart; repeat for more
--by Who is adding it: you, or an agent's name, e.g. "Claude Code"
--site Site (default: the site for the current folder)

leash task note

Add a note to a task. Yours on a blocked task gets it moving again

Terminal window
leash task note [OPTIONS] <ID> <TEXT>
Argument Meaning
ID Task ID, from leash task list
TEXT What you did or found
--by Who is writing it: you, or an agent's name, e.g. "Claude Code"
--site Site (default: the site for the current folder)

leash task block

Say what's in the way: the task stays in progress, blocked, until a note from you

Terminal window
leash task block [OPTIONS] <ID> <REASON>
Argument Meaning
ID Task ID, from leash task list
REASON What's needed to go on
--by Who is stuck: an agent's name, e.g. "Claude Code"
--site Site (default: the site for the current folder)

leash task release

Let a claimed task go, back to To do

Terminal window
leash task release [OPTIONS] <ID> [TEXT]
Argument Meaning
ID Task ID, from leash task list
TEXT Where you left it
--by Who is letting it go: an agent's name, e.g. "Claude Code"
--site Site (default: the site for the current folder)

leash task review

Hand finished work back for review, with what was done

Terminal window
leash task review [OPTIONS] <ID> <SUMMARY>
Argument Meaning
ID Task ID, from leash task list
SUMMARY What was done
--by Who did it: an agent's name, e.g. "Claude Code"
--workspace The branch workspace the work is in
--site Site (default: the site for the current folder)

leash task status

Move a task to To do, In progress, Review or Done

Terminal window
leash task status [OPTIONS] <ID> <STATUS>
Argument Meaning
ID Task ID, from leash task list
STATUS Where it goes
--by Who is moving it: you, or an agent's name, e.g. "Claude Code"
--site Site (default: the site for the current folder)

leash task done

Mark a task done. An agent's done waits for your review when Review is on

Terminal window
leash task done [OPTIONS] <ID>
Argument Meaning
ID Task ID, from leash task list
--by Who finished it: you, or an agent's name, e.g. "Claude Code"
--site Site (default: the site for the current folder)

leash task claim

Claim a task while you work on it; others are refused until the claim runs out

Terminal window
leash task claim [OPTIONS] --by <BY> <ID>
Argument Meaning
ID Task ID, from leash task list
--by Who is claiming it, e.g. "Claude Code"
--minutes How long the claim lasts
--site Site (default: the site for the current folder)

leash scratchpad

Run code inside a site with its app booted, e.g. leash scratchpad run --code "User::count()"

Subcommands: run, list.

leash scratchpad run

Run code inside the site, as a scratchpad does, and print what came back

Terminal window
leash scratchpad run [OPTIONS] [FILE]
Argument Meaning
FILE A file with the code, or - for standard input (the default)
--code The code itself, instead of a file
--timeout Seconds before the run is stopped
--json Print JSON
--site Site (default: the site for the current folder)

leash scratchpad list

List the site's scratchpads

Terminal window
leash scratchpad list [OPTIONS]
Argument Meaning
--json Print JSON
--site Site (default: the site for the current folder)

leash call

Send a site's saved calls, or any request, and see what each caused, e.g. leash call send /api/orders

Subcommands: list, send, run, routes, import, export.

leash call list

List the site's saved calls

Terminal window
leash call list [OPTIONS]
Argument Meaning
--json Print JSON
--site Site (default: the site for the current folder)

leash call send

Send a saved call (by id or name) or a request (a path on the site, or a full URL), and print the answer and what it caused

Terminal window
leash call send [OPTIONS] <TARGET>
Argument Meaning
TARGET A saved call's id or name, a path like /api/orders, or a URL
-X, --method The method, for a request (GET unless there's data)
-H, --header A header, Name: value; give it more than once for more
-d, --data The body; @file reads it from a file. JSON is sent as JSON
--env The environment to send with, by name or id
--share Send to the site's share URL instead
--no-redirects Don't follow redirects
--json Print the whole answer as JSON
--site Site (default: the site for the current folder)

leash call run

Send every saved call, or a folder's, in order; exits 1 if any fails

Terminal window
leash call run [OPTIONS] [FOLDER]
Argument Meaning
FOLDER A folder, by name or id
--env The environment to send with, by name or id
--stop-on-failure Stop at the first call that fails
--json Print JSON
--site Site (default: the site for the current folder)

leash call routes

List the site's routes (Laravel or Symfony)

Terminal window
leash call routes [OPTIONS]
Argument Meaning
--refresh Read them again even if the route files didn't change
--json Print JSON
--site Site (default: the site for the current folder)

leash call import

Import calls from a file or folder: Postman, OpenAPI, Bruno, .http, HAR, a curl command, or a Short Leash export

Terminal window
leash call import [OPTIONS] <PATH>
Argument Meaning
PATH The file or folder; - reads a file from standard input
--dry-run Show what would be added, without adding it
--site Site (default: the site for the current folder)

leash call export

Write the site's calls as an .http file (to standard output)

Terminal window
leash call export [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder)

leash monitor

The Monitor: canonical log lines and each request's trace, e.g. leash monitor tail --follow -q 'status>=500'

Subcommands: tail, trace.

leash monitor tail

Print canonical log lines (one per request, job or command), oldest first

Terminal window
leash monitor tail [OPTIONS]
Argument Meaning
--site Only this site
-q, --q Only lines matching a search, e.g. status>=500 db.queries>20 app.tenant=acme
--format How lines are printed
-n, --lines How many saved lines to start with
-f, --follow Keep watching for new lines

leash monitor trace

Show one request's trace: stages, queries, events, N+1s, exceptions

Terminal window
leash monitor trace [OPTIONS] <ID>
Argument Meaning
ID The request's id, from leash requests
--json Print JSON

leash runtime

Check installed PHP, Node, Go and Ruby versions for updates

Subcommands: updates, update.

leash runtime updates

List installed versions with a newer patch release (checks now)

Terminal window
leash runtime updates

leash runtime update

Update an installed version to its newest patch, e.g. leash runtime update PHP 8.4

Terminal window
leash runtime update <NAME> <VERSION>
Argument Meaning
NAME PHP, Node, Go or Ruby
VERSION The installed version, e.g. 8.4, 22 or 1.26

leash ai

Chat with Short Leash's local model about your sites, logs and requests, e.g. leash ai chat "Why is shop.test slow?"

Subcommands: chat, chats.

leash ai chat

Ask a question; leave it out to chat until an empty line. Reads run on their own, and you're asked before anything changes

Terminal window
leash ai chat [OPTIONS] [MESSAGE]
Argument Meaning
MESSAGE The question (default: read from stdin, or chat in the terminal)
--chat Carry on a chat, by its id from leash ai chats
--site Start a chat about this site: every tool that takes a site uses it

leash ai chats

List chats, newest first

Terminal window
leash ai chats [OPTIONS]
Argument Meaning
--site Only this site's chats
--json Print JSON

leash meetings

Meeting notes: list, read, export or summarize them, e.g. leash meetings export <id> -o notes.md

Subcommands: list, show, export, summarize.

leash meetings list

List meetings, newest first

Terminal window
leash meetings list [OPTIONS]
Argument Meaning
-q, --query Only meetings whose title, summary or transcript has these words
--json Print JSON

leash meetings show

Print a meeting's summary, action items and transcript

Terminal window
leash meetings show [OPTIONS] <ID>
Argument Meaning
ID The meeting's id, from leash meetings list
--json Print JSON

leash meetings export

Print a meeting as Markdown, with front matter saying how it was made

Terminal window
leash meetings export [OPTIONS] <ID>
Argument Meaning
ID The meeting's id
-o, --output Write it to this file instead

leash meetings summarize

Write (or rewrite) a meeting's summary with the local model. Needs Short Leash running

Terminal window
leash meetings summarize <ID>
Argument Meaning
ID The meeting's id

leash notes

Your notes in Short Leash: list, read, write, change or delete them, e.g. leash notes add "Deploy steps" < steps.md

Subcommands: list, edit, tags, show, add, rm.

leash notes list

List notes, pinned first, then last changed first

Terminal window
leash notes list [OPTIONS]
Argument Meaning
-q, --query Only notes whose title or text has these words (#tags filter by tag)
--tag Only notes with this tag
--sort The order: updated, created, title or relevance (with --query)
--json Print JSON

leash notes edit

Change a note: its title, its text (from --text or stdin), or pin it

Terminal window
leash notes edit [OPTIONS] <ID>
Argument Meaning
ID The note's id, from leash notes list
--title A new title
--text New text, in Markdown (default: read from stdin, unless only --title, --pin or --unpin is given)
--append Add the text at the end, as a new paragraph, instead of replacing it
--pin Pin it to the top of the list
--unpin Unpin it

leash notes tags

List the tags in your notes, most used first

Terminal window
leash notes tags [OPTIONS]
Argument Meaning
--site Only tags in notes about this site
--json Print JSON

leash notes show

Print a note, in Markdown

Terminal window
leash notes show <ID>
Argument Meaning
ID The note's id, from leash notes list

leash notes add

Write a note; its text comes from --text or stdin

Terminal window
leash notes add [OPTIONS] <TITLE>
Argument Meaning
TITLE Its title
--text Its text, in Markdown (default: read from stdin)
--site The site it's about

leash notes rm

Delete a note

Terminal window
leash notes rm <ID>
Argument Meaning
ID The note's id

leash license

Short Leash Pro on this computer: the trial or license, e.g. leash license activate LEASH-…

Subcommands: status, activate, deactivate, refresh.

leash license status

Show whether Short Leash Pro is on, and until when

Terminal window
leash license status [OPTIONS]
Argument Meaning
--json Print JSON

leash license activate

Activate a license key on this computer (it works on 2)

Terminal window
leash license activate [OPTIONS] <KEY>
Argument Meaning
KEY The key from your Polar email, e.g. LEASH-…
--name This computer's name in Manage license (default: its own name)

leash license deactivate

Free this computer's activation so the key can go on another

Terminal window
leash license deactivate

leash license refresh

Check the license with Polar now

Terminal window
leash license refresh

leash workspace

Branch workspaces: a checkout of a branch beside a site, with its own address, e.g. leash workspace add fix/login

Subcommands: add, list, merge, remove.

leash workspace add

Make a branch workspace from a site: a checkout of the branch with its own address.

The branch can be a local branch, a remote branch Git already has (Short Leash never fetches), or a new one started from --base. It's served at <branch>-<site>.test, with the files Git ignores copied from the site

Terminal window
leash workspace add [OPTIONS] <BRANCH>
Argument Meaning
BRANCH The branch, e.g. fix/login
--site Site (default: the site for the current folder, or the site of the branch workspace you're in)
--base The branch a new branch starts from and the branch workspace merges back into (default: the site's current branch)
--database Its database: shared (the site's own), copy (a new one holding a copy of it) or empty (a new, empty one)

leash workspace list

List a site's branch workspaces

Terminal window
leash workspace list [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder, or the site of the branch workspace you're in)
--json Print JSON

leash workspace merge

Merge a branch workspace's branch into its base.

It runs in the site's folder, which must be on the base branch with no uncommitted changes. A conflict stops the merge and leaves the base as it was. Hooks run only in a repository Short Leash trusts

Terminal window
leash workspace merge [OPTIONS] [WORKSPACE]
Argument Meaning
WORKSPACE Branch workspace, e.g. fix-login-shop (default: the one for the current folder)
--push Push the base branch to its upstream after merging
--remove Remove the branch workspace after merging, as leash workspace remove does
--hooks The repository's hooks when it isn't trusted: auto asks at the terminal, trust shows what trusting covers and asks to trust it and run them (it needs a terminal), skip merges without them
-y, --yes Merge (and remove) without asking

leash workspace remove

Remove a branch workspace: its folder goes to the Trash and its branch stays.

A database the branch workspace made is backed up, then dropped. Uncommitted changes are listed first and go to the Trash with the folder

Terminal window
leash workspace remove [OPTIONS] [WORKSPACE]
Argument Meaning
WORKSPACE Branch workspace, e.g. fix-login-shop (default: the one for the current folder)
--force Remove it even though Short Leash can't read its changes (its repository is gone, say)
-y, --yes Remove without asking

leash import

Import sites from Herd, Valet or Flock: parked folders, links, HTTPS and PHP versions.

Reads that tool's settings once and changes nothing in it. It lists what it would add, then imports only after you confirm, or with --yes

Terminal window
leash import [OPTIONS] [SOURCE]
Argument Meaning
SOURCE herd, valet, flock, or projects (project files of your Short Leash sites). Default: the one tool found
--dry-run Show what would be added, and change nothing
--yes Import without asking first
--skip Leave out an item, by the id --dry-run prints. Repeatable
--project-files Also write leash.toml from herd.yml or .flockrc (left out unless asked)

Subcommands: database.

leash import database

Print the command that dumps a database from the other tool, or restore FILE into Short Leash's service.

Short Leash never runs the dump command: it prints it for you to run. With FILE, the dump is copied into Short Leash's backups and restored into a new database; a database that's already there is never replaced

Terminal window
leash import database [OPTIONS] --kind <KIND> --database <DATABASE> [FILE]
Argument Meaning
--kind mysql, mariadb or postgres
--database The database's name. The restored copy keeps it
--port The other tool's database port (default: the kind's standard port)
--version The version of Short Leash's service to restore into (default: the recommended one)
FILE The dump to restore. Leave it out to print the command that makes it

leash changes

Stage, discard, commit and push a site's changes, e.g. leash changes commit -m "Add invoice numbers"

Subcommands: stage, unstage, discard, commit, trust, push.

leash changes stage

Stage files for the next commit, or every change in the site's folder with --all

Terminal window
leash changes stage [OPTIONS] [PATHS]...
Argument Meaning
PATHS Files, from the current folder
--all Every change in the site's folder
--site Site (default: the site for the current folder)

leash changes unstage

Unstage files, keeping their changes, or everything staged with --all

Terminal window
leash changes unstage [OPTIONS] [PATHS]...
Argument Meaning
PATHS Files, from the current folder
--all Everything staged in the site's folder
--site Site (default: the site for the current folder)

leash changes discard

Throw away changes to files, after showing what's lost. New files move to the Trash (Recycle Bin on Windows)

Terminal window
leash changes discard [OPTIONS] <PATHS>...
Argument Meaning
PATHS Files, from the current folder
--yes Discard without asking
--site Site (default: the site for the current folder)

leash changes commit

Commit the staged files. Hooks run only in a folder Short Leash trusts

Terminal window
leash changes commit [OPTIONS] --message <MESSAGE>
Argument Meaning
-m, --message The commit message
--no-verify Commit without running the repository's hooks
--trust Trust the repository's folder and run its hooks, after showing what trusting covers and asking. It needs a terminal
--site Site (default: the site for the current folder)

leash changes trust

Trust the site's repository, after showing what trusting covers and asking. It needs a terminal.

Trusting lets the repository's hooks run and its Git settings apply when Short Leash runs Git in it, and applies what its project files ask for. Stage, unstage and discard ask for it when a setting needs trust; commit and push can ask with --trust

Terminal window
leash changes trust [OPTIONS]
Argument Meaning
--site Site (default: the site for the current folder)

leash changes push

Push the current branch to its upstream with your own Git and its sign-in. Never forces

Terminal window
leash changes push [OPTIONS]
Argument Meaning
--set-upstream Push a branch without an upstream to origin and track it
--no-verify Push without running the repository's hooks
--trust Trust the repository's folder and run its hooks, after showing what trusting covers and asking. It needs a terminal
--site Site (default: the site for the current folder)

leash db

Databases: create, list, drop or get a URL for one, or open a service's client (mysql, mariadb or psql), e.g. leash db create, leash db mysql shop

Terminal window
leash db <SERVICE> [DATABASE]
Argument Meaning
SERVICE Service whose client to open, e.g. mysql, mariadb or postgres
DATABASE Database to open

Subcommands: list, create, url, drop.

leash db list

List each database service's databases

Terminal window
leash db list [OPTIONS]
Argument Meaning
--service Only this service, e.g. mysql
--json Print JSON

leash db create

Create a database and print its URL.

Without a name, it's the database the site's .env names, or one named after the site. A service that's off is turned on first

Terminal window
leash db create [OPTIONS] [NAME]
Argument Meaning
NAME Database name
--service Service, e.g. mysql or postgres (default: the one the site's .env points at, or the only one that's on)
--site Site (default: the site for the current folder)

leash db url

Print a database's URL on 127.0.0.1, e.g. export DATABASE_URL=$(leash db url)

Terminal window
leash db url [OPTIONS] [NAME]
Argument Meaning
NAME Database name
--service Service, e.g. mysql or postgres (default: the one the site's .env points at, or the only one that's on)
--site Site (default: the site for the current folder)

leash db drop

Drop a database after backing it up.

Short Leash takes a Before drop backup first, and drops nothing if that fails. Restore it with leash backup restore <id>

Terminal window
leash db drop [OPTIONS] --service <SERVICE> <NAME>
Argument Meaning
NAME Database name
--service Service, e.g. mysql or postgres
--yes Drop without asking

leash service

Services: list them, add one, turn one on or off, or remove one you added, e.g. leash service add mysql 9.7

Subcommands: list, add, start, stop, remove.

leash service list

List services, their ports and whether each is on

Terminal window
leash service list [OPTIONS]
Argument Meaning
--json Print JSON

leash service add

Add a service, or another version of one, and start it.

The version may be short (9.7 for 9.7.2). Without one, it's the recommended version

Terminal window
leash service add [OPTIONS] <KIND> [VERSION]
Argument Meaning
KIND Kind, e.g. mysql, postgres, redis, meilisearch or typesense
VERSION Version, e.g. 9.7 (default: the recommended one)
--port Port on 127.0.0.1 (default: the next free one from the standard port)

leash service start

Start a service. It starts with Short Leash from then on

Terminal window
leash service start <ID>
Argument Meaning
ID Service id, e.g. mysql or mysql-9-7 (see leash service list)

leash service stop

Stop a service. It stays off until you start it

Terminal window
leash service stop <ID>
Argument Meaning
ID Service id, e.g. mysql or mysql-9-7 (see leash service list)

leash service remove

Remove a service you added. Its data stays unless you add --delete-data

Terminal window
leash service remove [OPTIONS] <ID>
Argument Meaning
ID Service id, e.g. mysql-9-7 (see leash service list)
--delete-data Delete its data folder too

leash mail

Caught mail for scripts and agents: wait for a message, or print its links, e.g. leash mail wait --to [email protected]

Subcommands: wait, links.

leash mail wait

Wait for a caught message and print it.

Mail that arrived in the last --since seconds counts too, so a message sent just before the wait started is found

Terminal window
leash mail wait [OPTIONS]
Argument Meaning
--to Part of a recipient's address or name, e.g. [email protected]
--subject Part of the subject, e.g. Verify
--site Only mail in this site's inbox: its SMTP user name is the site's name, written any way (Dibs Marketing for dibs-marketing)
--timeout Seconds to wait before giving up
--since Count mail received this many seconds before the wait started
--json Print the message as JSON

Print a message's links, one per line.

Without an ID, it's the newest message the filters match

Terminal window
leash mail links [OPTIONS] [ID]
Argument Meaning
ID Message id (default: the newest message the filters match)
--to Part of a recipient's address or name, e.g. [email protected]
--subject Part of the subject, e.g. Verify
--site Only mail in this site's inbox: its SMTP user name is the site's name, written any way (Dibs Marketing for dibs-marketing)
--match Only links that contain this text, e.g. verify
--first Print only the first link
--json Print the links as JSON