Skip to content

Environments and secrets

Environments let the same request use different URLs and credentials without editing the request itself. This walkthrough uses the my-api collection from Your first request.

  1. Press F3 to open the environment editor.
  2. Press Ctrl+N, name the environment staging, choose a color if useful, and save the new environment.
  3. In its variable grid, move to the empty row after the existing variables. Enter key BASE_URL and value https://httpbin.org; Tab moves between key and value, and Return commits the edit.
  4. Press Ctrl+S to save the environment and Escape to return to requests.
  5. Press e, choose staging, and press Return to activate it.

The header shows the selected environment. New collections created by collection create already include a development environment, which you can edit instead of creating another.

Set your GET request URL to $BASE_URL/get, save, and send it. With staging selected, Noodle sends to https://httpbin.org/get. The response contains the resolved URL. Variable names are case-sensitive.

Variables also work in headers, parameters, bodies, auth fields, file paths, and assertion expectations. Substitution happens once; $$ sends a literal dollar sign. See Environment files for the complete rules.

For a protected API, add an API_TOKEN row in the environment editor. Mark the row as secret with s before entering its value, then save with Ctrl+S. Use $API_TOKEN in the request’s Auth tab, such as its Bearer Token field. Use a token only with the API it belongs to, not with the public httpbin example.

Noodle stores the value in the OS credential vault. The environment file keeps only this declaration:

# @secret API_TOKEN
API_TOKEN=

Press r on a secret row to reveal or mask its value for the current session. A same-named process environment variable takes precedence over the vault. Known secrets are redacted from diagnostics; ordinary variables remain plaintext.

noodle environment set BASE_URL https://httpbin.org --env staging --collection ./my-api
noodle secret set API_TOKEN --env staging --collection ./my-api
noodle secret list --env staging --collection ./my-api

secret set prompts without echo. secret list shows names and resolution status, not values. For unattended jobs, use a declared secret with a process environment value as shown in CLI automation and CI.

Use the header picker for manual sends and the environment selector in the Collection Runner. CLI run commands accept --env; otherwise they use environment in collection settings.yml:

noodle request run example-request --collection ./my-api --env staging

If $BASE_URL or $API_TOKEN is unresolved, confirm the selected environment, exact key spelling, enabled state, and saved changes. A secret declaration alone does not provide a value: set it in the vault or supply its process environment variable. See Troubleshooting for headless and keyring errors.

Environment editor

Press Ctrl+U to cycle through available environments. The active environment shows in the header with a color marker.

Press e, or click the environment in the header, to open a searchable picker. Type to filter environment names and press Return to activate the highlighted environment.

Press F3 to open the full environment editor. The TUI splits into three sections:

  • Sidebar (left): lists all .env files with color dots and unsaved indicators
  • Header (top): edit name and pick a color badge
  • Main: key/value grid

All env editor actions are also available in the command palette (Ctrl+P) when the env editor is open.

Key Action
↑/↓ Navigate rows or sidebar items
Return Edit field or select environment
Tab Switch between key and value columns
Space Select/activate environment
Ctrl+D Delete current variable row
s Toggle secure storage for the selected variable
r Reveal or mask the selected secret for this session
Ctrl+S Save environment
Ctrl+N Create an environment with a name and optional color
Ctrl+K Clone selected environment
Ctrl+W Delete environment (with confirmation)
Escape Return to main view
  • Dirty tracking: unsaved changes show a yellow bullet
  • Color badges: 17 theme colors available
  • Searchable picker: filter and activate environments without opening the editor
  • Create form: validate a new name and choose its color before saving
  • Disable variables: checkbox toggles a # prefix
  • Secure values: mark a row [secret]; Noodle stores its value in the OS credential vault and keeps only a blank declaration in the .env file
  • Secret sources: a same-named process environment variable takes precedence over the vault; missing secrets are highlighted
  • Clone: appends “ - Copy“ to the name, then asks whether to copy stored values or only the secret declarations
  • Context menu: right-click an environment in the sidebar to save, create, clone, or delete environments