CLI reference
Every command and option of the interleave CLI.
The CLI sets your repo up, starts runs and manages secrets. Run it with npx, or install it globally
to get the interleave command:
npx @interleaveqa/cli --helpnpm install -g @interleaveqa/cliIt ships as a single binary for macOS and Linux (x64 and arm64), with a Node fallback elsewhere.
Global options
These work with every command, before or after it.
| Option | Env | |
|---|---|---|
--json | Print machine-readable JSON on stdout. Progress still goes to stderr. | |
--api-url <url> | INTERLEAVE_API_URL | Interleave API to talk to. Default https://api.interleaveqa.com. |
--org <slug> | INTERLEAVE_ORG | Org to act in. Default: the one chosen at interleave login, else your personal org. |
-v, --version | Print the version. | |
-h, --help | Help for any command. |
interleave login
Sign in from this machine. Prints a one-time code and opens the dashboard's device page; check the code
and click Approve. The token is saved to ~/.config/interleave/credentials.json (mode 0600).
| Option | |
|---|---|
--no-browser | Print the URL instead of opening a browser. Use it over SSH. |
interleave --org acme login pins the key to the acme org, so later commands act there by default.
interleave whoami
Show the account, org and API this machine is signed in as. Fails if the saved token was rejected.
interleave logout
Forget the token saved on this machine.
interleave init
Set up this repo on Interleave: scan, draft interleave.yml, upload secrets and build the cloud
environment. See the Quickstart. If interleave.yml already exists,
init redrafts it from the current scan and overwrites it; pass --keep-recipe to use the existing file as is.
Run it while your app is running locally, services and dev server included. init drafts start
commands, ports and service versions from what it sees running; an app it can't see may be left out.
interleave scan works the same way.
interleave init [dir]| Option | |
|---|---|
[dir] | Directory to set up. Default: the git repo you're in. |
-y, --yes | Accept the defaults without asking. |
--keep <name> | Keep this env var's local value verbatim, for example to opt in a live key or telemetry. Repeatable. |
--keep-recipe | Use the existing interleave.yml as is instead of redrafting and overwriting it. Hand edits are lost without it. |
--no-upload | Don't upload secrets. They're empty in the sandbox. |
--repo <owner/name> | GitHub repo to link, if it can't be read from the git remote. |
--test-user <email> | Test user cases start signed in as, when the repo has none. Signed up through your app. See test users. |
--login-path <path> | The test user's login page. Default /login. |
--signup-path <path> | Page that signs the test user up. Default /signup; none for an existing account. |
--source <auto|git|archive> | Where the cloud gets your code. auto (default) clones from GitHub when the App is installed and your working tree is clean; otherwise it uploads the working tree, without env files. |
--db-dump | Seed from a sanitized dump of your local database. Not available yet: prints a notice. |
Exits 1 if the environment didn't come up ready.
interleave run
Run QA on a pushed branch (default: the current one) or a PR, follow it live and print the report.
interleave run --pr 42 -m "focus on checkout"| Option | |
|---|---|
--pr <number> | Test this pull request's head. |
--branch <name> | Test this pushed branch. Can't be combined with --pr. |
-m, --message <instructions> | What to focus on, as in @interleave test …. |
--repo <owner/name> | GitHub repo, if it can't be read from the git remote. |
--detach | Start the run, print its URL and exit without following it. |
The branch must be pushed: the run tests GitHub's copy, and the CLI warns when your local commit differs. CLI runs don't post PR comments.
Exit status: 1 if any case failed, errored, was blocked or needs a look, or the run didn't
complete; 0 otherwise. Flaky cases count as passes. This is stricter than the GitHub check, which
is neutral for cases that need a look. With --detach, 0 once the run is queued.
interleave scan
Scan this repo and machine and draft interleave.yml without uploading anything or contacting the cloud.
interleave scan --recipe| Option | |
|---|---|
[dir] | Directory to scan. Default: the git repo you're in. |
--recipe | Print the drafted interleave.yml after the summary. |
--out <file> | Also write the full scan as JSON to <file>. |
--files-only | Skip processes, containers, local versions and database counts. |
--keep <name> | Keep this env value verbatim in the draft. Repeatable. |
interleave secrets
Manage the project's encrypted secrets. Values are never shown. See Secrets.
| Command | |
|---|---|
interleave secrets list (ls) | List secret names, classes and update times. |
interleave secrets set <name> | Encrypt and save a secret. The value comes from stdin or a masked prompt, never an argument. |
interleave secrets rm <name> (remove) | Delete a secret. |
| Option | |
|---|---|
--repo <owner/name> | GitHub repo, if it can't be read from the git remote. All three commands. |
--class <class> | set only: override the detected class. |
Environment variables
| Variable | |
|---|---|
INTERLEAVE_API_KEY | An il_… API key. Beats the saved login. Use it in CI. |
INTERLEAVE_API_URL | Same as --api-url. |
INTERLEAVE_ORG | Same as --org. |
INTERLEAVE_NO_UPDATE_CHECK | Set to anything to skip the daily "newer version" check. It's also skipped in CI and with --json. |
XDG_CONFIG_HOME | Where the CLI keeps its files: $XDG_CONFIG_HOME/interleave/, default ~/.config/interleave/. |
Exit codes
| Code | |
|---|---|
0 | Success. |
1 | The command failed, or (run) a case failed. With --json, the error is on stdout as {"error": …}. |
2 | Bad usage: an unknown option or a missing argument. |
Using it in CI
Create an API key, set it as INTERLEAVE_API_KEY from a secret and run:
npx @interleaveqa/cli run --pr "$PR_NUMBER"On GitHub, the Action wraps this and sets outputs for you.