# ccp env



{/* Generated by scripts/sync-cli-reference.ts */}

Manage per-VM environment variables

```text
Usage: ccp env [OPTIONS] <COMMAND>
```

| Argument   | Type or values | Default | Parser environment variable | Description |
| ---------- | -------------- | ------- | --------------------------- | ----------- |
| --help, -h | flag           | —       | —                           | Print help  |

## `ccp env list` [#ccp-env-list]

List a VM's user-set environment variables

```text
Usage: ccp env list [OPTIONS]
```

Aliases: `ls`.

| Argument   | Type or values | Default | Parser environment variable | Description                                     |
| ---------- | -------------- | ------- | --------------------------- | ----------------------------------------------- |
| --vm       | text           | —       | —                           | Target VM ID (required; no project default yet) |
| --json     | flag           | false   | —                           | Output the variables as a JSON object           |
| --help, -h | flag           | —       | —                           | Print help                                      |

## `ccp env get` [#ccp-env-get]

Reveal a single variable's value (errors on write-only secrets)

```text
Usage: ccp env get [OPTIONS] <KEY>
```

| Argument   | Type or values | Default | Parser environment variable | Description                                     |
| ---------- | -------------- | ------- | --------------------------- | ----------------------------------------------- |
| --json     | flag           | false   | —                           | Emit structured JSON on stdout                  |
| key        | text           | —       | —                           | Variable name                                   |
| --vm       | text           | —       | —                           | Target VM ID (required; no project default yet) |
| --help, -h | flag           | —       | —                           | Print help                                      |

## `ccp env set` [#ccp-env-set]

Set one or more variables (KEY=VALUE); upserts, leaving others intact

```text
Usage: ccp env set [OPTIONS] <PAIRS>...
```

| Argument    | Type or values | Default | Parser environment variable | Description                                               |
| ----------- | -------------- | ------- | --------------------------- | --------------------------------------------------------- |
| pairs       | text           | —       | —                           | KEY=VALUE pairs                                           |
| --vm        | text           | —       | —                           | Target VM ID (required; no project default yet)           |
| --plaintext | flag           | false   | —                           | Readable in `env list` (config, not a secret)             |
| --sensitive | flag           | false   | —                           | Masked in `env list`, revealable with `env get` (default) |
| --secret    | flag           | false   | —                           | Write-only — never returned after being set               |
| --help, -h  | flag           | —       | —                           | Print help                                                |

## `ccp env unset` [#ccp-env-unset]

Remove one variable

```text
Usage: ccp env unset [OPTIONS] <KEY>
```

| Argument   | Type or values | Default | Parser environment variable | Description                                     |
| ---------- | -------------- | ------- | --------------------------- | ----------------------------------------------- |
| --yes, -y  | flag           | false   | —                           | Confirm this destructive operation              |
| key        | text           | —       | —                           | Variable name to remove                         |
| --vm       | text           | —       | —                           | Target VM ID (required; no project default yet) |
| --help, -h | flag           | —       | —                           | Print help                                      |

## `ccp env refresh-system` [#ccp-env-refresh-system]

Re-apply server-injected system credentials (GitHub auth on dev VMs)

```text
Usage: ccp env refresh-system [OPTIONS]
```

| Argument   | Type or values | Default | Parser environment variable | Description                                     |
| ---------- | -------------- | ------- | --------------------------- | ----------------------------------------------- |
| --vm       | text           | —       | —                           | Target VM ID (required; no project default yet) |
| --help, -h | flag           | —       | —                           | Print help                                      |

## Example [#example]

```bash
ccp env list --vm "$VM_ID"
```

## Global options [#global-options]

Set `CCP_CONTEXT` to choose a named context. An explicit `--context` takes precedence. See [organization selection](/docs/ccp/organizations) for organization defaults.

| Argument  | Type or values | Default | Parser environment variable | Description                                         |
| --------- | -------------- | ------- | --------------------------- | --------------------------------------------------- |
| --context | text           | —       | —                           | Select a developer context from \~/.ccp/config.toml |
