Reference

lessly_set_env

Create or update an environment variable on an app.

Tool

lessly_set_env

Create or update an environment variable on an app.

Writes a single env var to the app. Marking secret=true encrypts the value at rest and redacts it in logs and tool output. The change applies on the next deployment unless redeploy=true is set.

Arguments

Name Type Required Description
app string Slug of the Lessly app.
key string Env var name. Must match /^[A-Z_][A-Z0-9_]*$/.
value string Value to store. Pass an empty string to set the var to empty; use lessly_list_envs and the workspace UI to delete.
environment "production" | "staging" | "preview" | "all" Which environments the var applies to. default: all
secret boolean Encrypt at rest and redact in logs. Default true for keys ending in _KEY, _TOKEN, _SECRET, _PASSWORD. default: false
redeploy boolean Trigger a redeploy of the current production deployment so the new value takes effect immediately. default: false

Try it

Set STRIPE_SECRET_KEY on acme-store in production as a secret and redeploy.

When to use

Writes a single env var to the app. Marking secret=true encrypts the value at rest and redacts it in logs and tool output. The change applies on the next deployment unless redeploy=true is set.

Example

Ask your agent something like this:

Set STRIPE_SECRET_KEY on acme-store in production as a secret and redeploy.

The agent will invoke lessly_set_env with these arguments:

json
{
  "app": "acme-store",
  "key": "STRIPE_SECRET_KEY",
  "value": "sk_live_…",
  "environment": "production",
  "secret": true,
  "redeploy": true
}

Esc

Start typing to search the docs.

navigate select