Skip to content

CLI

outry <COMMAND>

Send requests and run their checks.

Terminal window
outry run <PATHS|NAMES>...

Folders expand to every *.outry and *.http file inside them, in alphabetical order; a .outry file runs every request and flow in it, top to bottom. Files given explicitly run in the given order. A request or flow can also be given by name (CreateOrder, users.Create) or by line (api/orders.outry:12). Values captured by save are passed to the following requests; requests called from .outry share one run cache and cookie jar.

Flag Description
-e, --env <ENV> Environment from env.toml (default: default in the config)
--project <DIR> Project folder (default: env.toml is searched upwards from the first path)
--var <NAME=VALUE> Override a variable; can be repeated
--fail-fast Stop at the first failed request
-v, --verbose Print response headers and body
--json Print one JSON object per request (JSON Lines)
--timeout <SECONDS> Request timeout, default 30
--fresh Do not read or store values saved by save and responses kept by cache: between runs
--no-keyring Do not look up secrets in the system keychain
--yes Send requests marked confirm: true without asking

Exit code: 0 — everything passed, 1 — at least one request failed, 2 — Outry could not start.

Check the project without sending anything. Exit code 1 if there is an error.

Terminal window
outry check [PATHS]... [--env <ENV>] [--var <NAME=VALUE>]... [--no-keyring]
[--no-fmt] [--go <DIR> | --no-go] [--format text|github]

Without paths (or with the path of the project itself, outry check api) it checks everything:

  • syntax, and in .outry names of called requests, their arguments, shapes, schema() files and call cycles;
  • every environment: calls of requests whose only excludes it, only lists with unknown environments, and variables that are defined nowhere in it (names captured by save somewhere in the project count as defined). The keychain is not read — a secret counts as defined when it is listed in secrets. The same error in several environments is printed once;
  • formatting, as outry fmt --check (--no-fmt turns it off);
  • the Go code, as outry import go --check, when a go.mod is found in the project directory or above it, up to the repository root. --go <DIR> points to the service, --no-go skips it.

With paths only those files are checked, without Go. --env checks a single environment with its real variables — --var, OUTRY_*, env.toml and the keychain (--no-keyring turns it off). --format github prints GitHub Actions annotations.

api/orders/create.outry:1:1: error: not formatted (`outry fmt`)
api/orders/create.outry:7:22: error: variable `api_key` is not defined in staging, prod
api/orders/create.outry:9:13: error: `Seed` is limited to dev and cannot be called in prod
main.go:42:1: error: route DELETE /orders/{id} has no request (`outry import go` creates api/orders/delete.outry)
12 files, 3 environments, 18 Go routes: 4 errors, 0 warnings

Rewrite .outry files in the canonical style, like gofmt; comments are kept. Prints the changed files.

Terminal window
outry fmt [PATHS]... [--check]

PATHS default to the current folder. --check changes nothing and exits with 1 if a file is not formatted — for CI.

Rewrite .http files into .outry next to them. An existing .outry is never overwritten. See .http files.

Terminal window
outry convert [PATHS]... [--dry-run] [--rm]
Flag Description
--dry-run Print the result instead of writing files
--rm Delete each .http after its .outry is written

Show the final value of every variable in an environment and where it comes from. Secret values (from the keychain or listed in secrets) are masked.

Terminal window
outry vars [-e <ENV>] [--project <DIR>] [--var <NAME=VALUE>]...
project billing-api · env dev
base env.toml http://localhost:8080
token keychain eyJ…(212 chars)
api_key missing not set: outry secret set api_key --env dev
user_id saved 42
Flag Description
--var <NAME=VALUE> Override a variable, as in outry run
--fresh Ignore values saved by save
--no-keyring Do not look up secrets in the system keychain
--reveal Print secret values in full
--json Print a JSON array

Variables from OUTRY_* and the keychain are only listed for names that appear in env.toml (including secrets) or in saved values.

List the project’s environments; * marks the default.

Terminal window
outry envs [--dir <DIR>]

Store or remove a secret in the system keychain. set reads the value from stdin.

Terminal window
outry secret set <NAME> [-e <ENV>] [--project <DIR>]
outry secret rm <NAME> [-e <ENV>] [--project <DIR>]
Terminal window
echo -n "$TOKEN" | outry secret set token --env prod

Create api/env.toml and an example request in the given folder (default: current). Fails if env.toml already exists.

Terminal window
outry init [DIR]

Create a .outry request for every route of a Go service (chi, gin, net/http) that doesn’t have one yet. Differences from the code of existing requests are listed under the route; files change only with --fix. See Import routes from Go.

Terminal window
outry import go [DIR]

DIR is the folder with Go code, scanned recursively (default: current). Files are created in the project found from the current folder; it must have an env.toml.

Flag Description
--dry-run Only print the plan (with --fix — the diff of the fixes)
--check For CI: write nothing, report differences by file, exit with 1 on errors
--fix Fix the differences that can be fixed safely
--prune Delete files whose requests all point at removed routes
--format <F> text (default), github (GitHub Actions annotations), json
--base <NAME> Variable with the service address in existing .http URLs (for matching), default base
--query <FILE.scm> An extra tree-sitter query for another router; can be repeated
--project <DIR> Project folder with env.toml
--json Same as --format json

The language server for .outry files over stdin/stdout: outry check errors, environment warnings, differences from the Go code with quick fixes, completion, hover, go to definition, formatting and “▶ Send” code lenses. Editors start it themselves — see Editors.

Terminal window
outry lsp [--env <ENV>] [--no-keyring]
Flag Description
--env <ENV> Environment for variables and sending, default: default from env.toml
--no-keyring Don’t read secrets from the system keychain

Update the CLI to the latest GitHub release. The archive’s SHA-256 checksum is verified before the binary is replaced.

Terminal window
outry update [--check]

--check only reports whether a newer version exists.

Print a completion script for a shell: bash, zsh, fish, powershell or elvish. Commands, flags and their descriptions are completed.

Terminal window
outry completions fish > ~/.config/fish/completions/outry.fish
outry completions bash > ~/.local/share/bash-completion/completions/outry
echo 'source <(outry completions zsh)' >> ~/.zshrc

Run it again after outry update to pick up new commands.

Variable Effect
OUTRY_<NAME> Value of the variable name; see Variables
OUTRY_NO_UPDATE_NOTIFIER=1 Disable the new-version notice (NO_UPDATE_NOTIFIER works too)
CI When set, the new-version notice is disabled
NO_COLOR Disable colored output