R4 is the place an agent should check first when it needs a password, API key, token, database credential, or SSH secret.
Use the command that matches the question you are trying to answer:
| Need | Best command |
|---|---|
| See everything the runtime can already access | r4 vault items |
| Search by name | r4 vault search <query> |
| Retrieve one known value | r4 vault get <KEY> |
| Run a process with secrets injected | r4 run -- <command> |
| Use secrets inside code | Node SDK |
Confirm the runtime is configured:
r4 auth whoamiYou should see:
List vault items first when you are not sure which key name to use:
r4 vault itemsThis shows each vault item and its field names. A single password record may expose multiple fields such as:
USERNAMEPASSWORDURLTOKENIf you know part of the item name, search first:
r4 vault search github
r4 vault search database
r4 vault search sshFor automation-friendly output:
r4 vault search github --jsonOnce you know the environment key, retrieve it directly:
r4 vault get GITHUB_PRODUCTION_TOKENKey names use SCREAMING_SNAKE_CASE in this form:
VAULT_ITEM_NAME_FIELD_NAMEExamples:
GITHUB_PRODUCTION_TOKENPRIMARY_DATABASE_PASSWORDSSH_DEPLOYMENT_PRIVATE_KEYPrefer r4 run when the target command already expects environment variables:
r4 run -- node deploy.js
r4 run -- docker compose up
r4 run --prefix R4 -- ./start-agent.shThis keeps secret lookup and command execution in one step.
If the runtime is already written in Node.js or TypeScript, use the Node SDK to load the locally decrypted environment map.
r4 run when a subprocess needs many secretsIf the agent cannot find a needed secret: