> ## Documentation Index
> Fetch the complete documentation index at: https://getfloo.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# env

> CLI reference: floo env set, floo env get, floo env list, floo env unset, floo env import

Manage environment variables for your apps. Values are encrypted at rest.

## set

Set an environment variable. Keys are auto-uppercased.

```bash theme={null}
floo env set KEY=value --app my-app
```

### Flags

| Flag             | Description                                                                  |
| ---------------- | ---------------------------------------------------------------------------- |
| `--app APP`      | App name or UUID (reads from config if omitted)                              |
| `--services SVC` | Target specific services (repeatable)                                        |
| `--env ENV`      | Environment: `dev` (default) or `prod`                                       |
| `--restart`      | Restart the app after setting (triggers a full redeploy with fresh env vars) |

### Examples

```bash theme={null}
floo env set DATABASE_URL=postgres://user:pass@host:5432/db --app my-app
floo env set STRIPE_SECRET_KEY=sk_live_... --app my-app
floo env set NODE_ENV=production --app my-app --restart
floo env set API_KEY=secret --app my-app --services api --services worker
```

### JSON output

```json theme={null}
{
  "success": true,
  "data": {
    "key": "DATABASE_URL",
    "masked_value": "postgres://us...***"
  }
}
```

***

## get

Get the plaintext value of an environment variable.

```bash theme={null}
floo env get DATABASE_URL --app my-app
```

### Flags

| Flag            | Description                                     |
| --------------- | ----------------------------------------------- |
| `--app APP`     | App name or UUID (reads from config if omitted) |
| `--service SVC` | Target a specific service                       |
| `--env ENV`     | Environment: `dev` (default) or `prod`          |

### JSON output

```json theme={null}
{
  "success": true,
  "data": {
    "key": "DATABASE_URL",
    "value": "postgres://user:pass@host:5432/db"
  }
}
```

***

## list

List all environment variables for an app. Values are masked.

```bash theme={null}
floo env list --app my-app
```

### Flags

| Flag             | Description                                     |
| ---------------- | ----------------------------------------------- |
| `--app APP`      | App name or UUID (reads from config if omitted) |
| `--services SVC` | Target specific services (repeatable)           |
| `--env ENV`      | Environment: `dev` (default) or `prod`          |

### JSON output

```json theme={null}
{
  "success": true,
  "data": {
    "env_vars": [
      { "key": "DATABASE_URL", "masked_value": "postgres://us...***" },
      { "key": "STRIPE_SECRET_KEY", "masked_value": "sk_live_...***" }
    ]
  }
}
```

***

## unset

Remove an environment variable. Keys are auto-uppercased.

```bash theme={null}
floo env unset DATABASE_URL --app my-app
```

### Flags

| Flag             | Description                                     |
| ---------------- | ----------------------------------------------- |
| `--app APP`      | App name or UUID (reads from config if omitted) |
| `--services SVC` | Target specific services (repeatable)           |
| `--env ENV`      | Environment: `dev` (default) or `prod`          |

### JSON output

```json theme={null}
{
  "success": true,
  "data": {
    "key": "DATABASE_URL"
  }
}
```

***

## import

Import environment variables from a `.env` file.

```bash theme={null}
floo env import .env --app my-app
```

### Flags

| Flag             | Description                                                                                                           |
| ---------------- | --------------------------------------------------------------------------------------------------------------------- |
| `--app APP`      | App name or UUID (reads from config if omitted)                                                                       |
| `--services SVC` | Target specific services (repeatable). Cannot combine with `--all`.                                                   |
| `--all`          | Import env vars for all services using their configured `env_file` paths. Cannot combine with `FILE` or `--services`. |
| `--env ENV`      | Environment: `dev` (default) or `prod`                                                                                |

### Examples

```bash theme={null}
# Import from a specific .env file
floo env import .env --app my-app

# Import for specific services
floo env import .env --app my-app --services api --services worker

# Import for all services using their configured env_file paths
floo env import --all --app my-app

# Agent workflow: import and verify
floo env import .env --app my-app --json 2>/dev/null | jq '.data'
```

### JSON output

```json theme={null}
{
  "success": true,
  "data": {
    "created": 3,
    "updated": 2,
    "env_vars": [
      { "key": "DATABASE_URL", "masked_value": "postgres://us...***" },
      { "key": "REDIS_URL", "masked_value": "redis://...***" }
    ]
  }
}
```

***

## Errors

| Code                | Meaning                             |
| ------------------- | ----------------------------------- |
| `NOT_AUTHENTICATED` | Run `floo auth login` first         |
| `APP_NOT_FOUND`     | No app with that name or ID         |
| `INVALID_FORMAT`    | Missing `=` in `KEY=VALUE` argument |
