# basemodo env set

Set Secrets: NAME=value ..., or one NAME alone to read its value from stdin. The App gets them the next time it starts: basemodo restart.

```sh
basemodo env set [OPTIONS] <NAME=value>...
```

All are set or none. Names are letters, digits and _, not starting with a digit; PORT and BASEMODO_* are Basemodo's, and PATH, LD_* and DYLD_* are the image's.

## Arguments

- `NAME=value...` (required): The Secrets, each as NAME=value (everything after the first = is the value). In a terminal, one NAME alone reads its value from stdin.
- `--app <APP>`: The App whose Secrets to change. Default: the one named after the current folder.

Like every command, it also takes the [global options](https://basemodo.com/docs/cli#global-options) `--json` and `--api-url`.

## Examples

Set two Secrets:

```sh
basemodo env set STRIPE_KEY=sk_live_123 MAILER_TOKEN=abc
```

Set one from a file, so the value stays out of your shell history:

```sh
basemodo env set STRIPE_KEY < stripe-key.txt
```

## Output

With `--json`, it prints {"secrets": [{"name", "updated_by", "updated_at"}], "changes": [{"name", "action", "by", "at"}], "warnings": [...]}, never a value. A warning names a Secret set before its name was refused, to rename.

## From an agent

Basemodo's [MCP](https://basemodo.com/docs/mcp) serves it as the tool [`env_set`](https://basemodo.com/docs/mcp/tools/env_set). It changes things, so an agent's client may ask you before it runs. Its arguments are the command's, named as JSON keys: `pairs` (list of text), `app` (text). It answers what the command prints with `--json`.

## Explained in

- [Secrets](https://basemodo.com/docs/secrets)
- [Expose an API to another Owner's App](https://basemodo.com/docs/expose-an-api)
- [Connect your App to Google, Slack or Notion](https://basemodo.com/docs/connections)