run_with_secrets
Run shell commands with 1Password secrets injected as environment variables and replace secret values in output with [secret NAME] to keep credentials hidden.
Instructions
Run a shell command with 1Password secrets injected as environment variables. Windows: PowerShell (reference as $env:NAME); Linux/macOS: bash (reference as $NAME). Output (stdout+stderr) is returned with secret values replaced by [secret NAME].
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"secrets": "<secrets>"
},
"name": "run_with_secrets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory | |
| argv | No | Alternative to command: program and arguments, run without a shell | |
| shell | No | "wsl" runs the command in WSL bash (Windows only) | |
| command | No | Shell command to run (PowerShell on Windows, bash elsewhere) | |
| secrets | Yes | Item names that are variable names, e.g. ["GITHUB_TOKEN"]; or a map from env var to item: {"APP_USER": {"item": "Staging admin", "field": "username"}, "APP_PASS": {"item": "Staging admin", "field": "password"}}. Map values may also be "Item title", "Item title.field" or "op://vault/item/field". Without a field, the item's primary field is used. | |
| timeout_seconds | No | Default 120, max 600 |