# ocloud secret

Source: https://olef.dev/docs/reference/ocloud/secret

Generated from **ocloud 3.17.3**. [All ocloud commands](https://olef.dev/docs/reference/ocloud) · [Olef Cloud overview](https://olef.dev/docs/cloud/overview) · [`olef` commands](https://olef.dev/docs/reference/commands)

Manage KMS-encrypted secrets for workspaces, projects, orgs, and agents

Global options (`--org`, `--project-root`, `--quiet`, `--redact`) apply across commands; see the [`ocloud` command catalog](https://olef.dev/docs/reference/ocloud#global-options).

## ocloud secret list

Names, kinds, hosts and expiry of the stored secrets (never values)

```bash
ocloud secret list --help
```

| Argument | Description |
| --- | --- |
| `--workspace` / `-w` | A workspace (name or id; default: the one linked here) |
| `--project` | A project (id or slug): every workspace of it, or those `--scope` says |
| `--agent` | An agent (`team/name`, a unique name, or its id): loaded in every run of that agent |
| `--personal` | With `--agent`: your own, loaded only in runs for you |

## ocloud secret rm

Delete a stored secret

```bash
ocloud secret rm --help
```

| Argument | Description |
| --- | --- |
| `<name>` | **Required.** Positional argument. |
| `--workspace` / `-w` | A workspace (name or id; default: the one linked here) |
| `--project` | A project (id or slug): every workspace of it, or those `--scope` says |
| `--agent` | An agent (`team/name`, a unique name, or its id): loaded in every run of that agent |
| `--personal` | With `--agent`: your own, loaded only in runs for you |

## ocloud secret set

Store a secret, its value read from stdin: an env value (NAME is the variable), or with `--credential` a token for some hosts. Write-only

```bash
ocloud secret set --help
```

| Argument | Description |
| --- | --- |
| `<name>` | **Required.** The env variable (`MAPS_API_KEY`), or a credential's store name |
| `--credential` | Store a credential (a token for `--host`s, sent with `--header`) instead of an env value |
| `--host` | A host the credential is for (repeat it) |
| `--header` | How it's sent: `Name: template` with `{}` for the value, like 'Authorization: Bearer {}' |
| `--user` | The user of a user and token pair |
| `--env` | An env variable runs get the value in (repeat it), like GH_TOKEN |
| `--expires` | When it expires: a date (2027-02-01) or an RFC 3339 time |
| `--preset` | Fill in the hosts, header and env of a known service: `github` (api.github.com, uploads.github.com and github.com, a bearer token, GH_TOKEN for gh). Flags given as well are added to it |
| `--workspace` / `-w` | A workspace (name or id; default: the one linked here) |
| `--project` | A project (id or slug): every workspace of it, or those `--scope` says |
| `--agent` | An agent (`team/name`, a unique name, or its id): loaded in every run of that agent |
| `--personal` | With `--agent`: your own, loaded only in runs for you |
| `--scope` | With `--project`: which of its workspaces get it (default: all) |
| `--workspaces` | With `--project`: these workspaces only (names or ids; implies `--scope workspaces`) |
