Skip to content

Secrets

Secrets never go into env.toml — sooner or later someone commits a token. Instead, Outry reads them from the operating system’s password storage.

Terminal window
outry secret set token --env dev # reads the value from stdin
outry secret rm token --env dev
GET /me {
headers { Authorization: "Bearer ${token}" }
}

When token is not defined anywhere else, Outry looks it up in:

  • macOS — Keychain;
  • Windows — Credential Manager;
  • Linux — Secret Service (GNOME Keyring, KWallet, KeePassXC).

Secrets are stored per project and environment, under the service outry with the key <project>/<env>/<name>. The project name is project from env.toml, or the name of the project folder (the parent folder if it is called api).

In the desktop app use Add secret at the bottom of the sidebar — it saves to the same place.

Without a keychain: WSL and headless Linux

Section titled “Without a keychain: WSL and headless Linux”

WSL and servers without a desktop session usually have no Secret Service. There outry secret set saves to ~/.config/outry/secrets.toml instead (readable only by you, mode 600), and every Outry process on that machine — CLI, outry lsp, the VS Code extension — reads secrets from it:

~/.config/outry/secrets.toml
[shop.dev]
admin_password = "…"

The values are stored as plain text, so this file must stay outside the repository. Secrets saved by the Windows app live in Windows Credential Manager, which WSL cannot read — save them again inside WSL.

List the names of secrets in env.toml — only the names, never the values:

api/env.toml
secrets = ["token", "api_key"]

Then outry vars and the Variables tab in the app show which secrets are missing for the current environment, and the editor suggests them. Secret values are masked in both places.

There is no keychain on CI runners. Pass secrets as OUTRY_<NAME> environment variables — they take precedence over env.toml and the keychain:

- run: outry run api --env staging --no-keyring
env:
OUTRY_TOKEN: ${{ secrets.API_TOKEN }}

--no-keyring skips the keychain (and secrets.toml) entirely. Without it Outry also works on headless machines: if no secret storage is available and the secret is not in secrets.toml, it is treated as missing.