Declare a connection
Authorization, Cookie, and X-API-Key; reference a managed secret
instead.
Tools can make requests through the same connection:
Synchronize development secrets
Place development-only values inopencomputer/.env.local:
npm run dev starts, the CLI considers only names referenced by
useSecret() in a defineConnection() declaration. It infers the allowed
origins from those declarations and asks before uploading each newly discovered
secret. Changed values are synchronized while the development process is
running.
Variables without a matching declaration are skipped. OpenComputer never
grants an unmatched value access to every host, and removing a local variable
does not delete its cloud value. Use opencomputer secrets remove when deletion
is intentional. The starter ignores opencomputer/.env.local and includes an
opencomputer/.env.example file for documenting required names without values.
Set a project secret
Secrets belong to a cloud project. If the app is not linked yet, this command first asks you to select or create one, then continues setting the secret.development and production:
Agent runtime variables
Use an agent runtime variable when code or a command must receive a value as a normal environment variable. Configure it in the Agent runtime variables section of the project’s Secrets page, or with the CLI:--agent current, and development
and production values are separate. No declaration in agent source is needed.
OpenComputer stores these values encrypted and never returns them through the
dashboard or management API. A newly started agent runtime receives the
resolved values in its process environment, so agent code, tools, commands, and
child processes can read them. Because the agent can access the plaintext,
runtime variables are appropriate for personal-agent credentials such as
DATABASE_URL, but they do not provide the destination isolation of managed
secrets. Restart a running agent runtime after changing a value.