set_variable
Set or merge project and service environment variables by key, defaulting to write-only secrets. Use it for non-sensitive values like log levels, flags, or public URLs; ask humans for credentials.
Instructions
Set/merge a project's variables; write-only unless secret=false. Returns names only.
WARNING: the values you pass here transit this agent's transcript in
plaintext, whether ``secret`` is omitted, ``true`` or ``false``. For any
credential, do not pass the value at all: ask the human to run
``nerdit vars set <project> --secret --prompt KEY`` (hidden input) and
only ever name ``KEY`` yourself. Use this tool for values that are fine
to appear in a transcript (a log level, a feature flag, a public URL).
A variable reaches a service's environment at launch. Precedence, lowest
to highest: the manifest ``env`` table, the project scope, the service
scope, then platform-injected bindings (``OPENAI_BASE_URL``,
``DATABASE_URL``…), which a variable can never override. Setting a key
again flips its plain/secret flag in that scope. Only the project's owner
or an admin may write (another token gets 403).
A running service picks the change up on its next restart or redeploy.
The machine-wide scope is not reachable here: use ``set_secret`` with
``shared``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| secret | No | Omit (or ``true``) for a write-only SECRET: no API, tool or dashboard ever returns the value again. ``false`` is the explicit PLAIN write: the project's owner or an admin can read the value back. When unsure, omit it. | |
| values | Yes | KEY → value pairs merged into the scope: a listed key is overwritten, an unlisted one kept. Key names are env-var identifiers (``[A-Za-z_][A-Za-z0-9_]*``); a value may be multi-line but may contain no NUL and no control character other than tab/newline/CR. An empty map is refused. | |
| project | Yes | Immutable prj_ ID or name of the project to modify. An unknown name creates it for your token; an unknown or retired ID is refused. | |
| service | No | Service inside the project (``web`` for a single-app project) to set the key for that service only; omit for the project scope, shared by every service of the project. On a key set in both, the service scope wins. | |
| idempotency_key | No | Caller-chosen key: a retry with the same key replays the first result instead of acting twice. Omit and a fresh key is minted per call, so each call acts. |