op run loads 1Password Environments with --environment
Introduced 2026-10-12 · score 0.98
HOW TO USE IT
When a repository script needs secrets from a 1Password Environment, run it with `op run --environment <environment-uuid> -- <script> [args...]` to provide the Environment’s variables for the subprocess. CLI 2.41.0 made this flag generally available; the release notes report network requests reduced from six to four.
op run --environment <environment-uuid> -- <script> [args...]WHY THIS HELPS
Run a repository script that needs secrets from a 1Password Environment.
REQUIREMENTS AND LIMITATIONS
- Version: 2.41.0
- Availability: generally available
- --environment <environment-uuid> (required): Loads variables from a 1Password Environment by ID. Repeatable; if variables collide across Environments, the last specified takes precedence.
- <script> [args...] (required): Command and arguments to run in a subprocess with Environment variables available for the subprocess duration.
- -- (required): Separates `op run` options from the command to run; shown in the documented syntax and example.
- Prerequisite: Sign up for 1Password, install 1Password CLI, and store the needed secrets in your 1Password account.
- Prerequisite: Use the Environment ID; the docs describe finding it in the 1Password app under Developer > View Environments > View environment > Manage environment > Copy environment ID.
FIRST-PARTY EVIDENCE
- https://app-updates.agilebits.com/product_history/CLI2#v2410001
- https://www.1password.dev/cli/reference/commands/run
- https://www.1password.dev/cli/secrets-scripts
Check the installed version and the source before using it. Entry JSON