Skip to content

Add wrangler store commands to secrets-store docs #21564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/content/docs/secrets-store/integrations/workers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ If [using the Dashboard](#via-dashboard), make sure you already have a Workers a

You should also have a store created under the Secrets Store tab on the Dashboard. The default store in your account is automatically created when a user with [Super Administrator or Secrets Store Admin role](/secrets-store/access-control/) interacts with it.

You can also use the [Wrangler command](/workers/wrangler/commands/#secrets-store-store) `secrets-store store create <name>` to create your default store.

## 1. Set up account secrets in Secrets Store

If there are no account secrets yet, follow the steps below. You must have a [Super Administrator or a Secrets Store Admin role](/secrets-store/access-control/) within your Cloudflare account.
Expand Down Expand Up @@ -57,7 +59,7 @@ npx wrangler secrets-store secret create <STORE_ID> --name MY_SECRETS_STORE_SECR

</TabItem> <TabItem label="API">

You can find and copy the store ID from the [Secrets Store tab](https://dash.cloudflare.com/?to=/:account/secrets-store/) on the dashboard. Also, make sure your secret `name` does not contain spaces.
You can find and copy the store ID from the [Secrets Store tab](https://dash.cloudflare.com/?to=/:account/secrets-store/) on the dashboard or use the [Wrangler command](/workers/wrangler/commands/#secrets-store-store). Also, make sure your secret `name` does not contain spaces.

Refer to [Secrets Store API](/api/resources/secrets_store/) for the full API documentation.

Expand Down
76 changes: 76 additions & 0 deletions src/content/docs/workers/wrangler/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Wrangler offers a number of commands to manage your Cloudflare Workers.
- [`secret`](#secret) - Manage the secret variables for a Worker.
- [`secret bulk`](#secret-bulk) - Manage multiple secret variables for a Worker.
- [`secrets-store secret`](#secrets-store-secret) - Manage account secrets within a secrets store.
- [`secrets-store store`](#secrets-store-store) - Manage your store within secrets store.
- [`workflows`](#workflows) - Manage and configure Workflows.
- [`tail`](#tail) - Start a session to livestream logs from a deployed Worker.
- [`pages`](#pages) - Configure Cloudflare Pages.
Expand Down Expand Up @@ -730,6 +731,81 @@ Finished processing secrets JSON file:
🚨 1 secrets failed to upload
```

## `secrets-store store`

You can use the following commands to manage your store.

:::note[Store limitation]
Each account only supports one store in beta.
:::

### create

Create a store within Secrets Store.

```txt
wrangler secerets-store store create <name>
```

- `name` <Type text="string" /> <MetaInfo text="required" />
- A descriptive name for the account-level secret. Cannot contain spaces.

The following is an example of using the `create` command to create a store.

```txt
wrangler secrets-store store create default --remote
```

```sh output
🔐 Creating store... (Name: default)
✅ Created store! (Name: default, ID: 2e2a82d317134506b58defbe16982d54)
```

### delete

Delete a store within Secrets Store.

```txt
wrangler secerets-store store delete <STORE_ID>
```

- `STORE_ID` <Type text="string" /> <MetaInfo text="required" />
- The secret store public ID. You can find it and copy from the [Secrets Store tab](https://dash.cloudflare.com/?to=/:account/secrets-store/) on the dashboard.

The following is an example of using the `delete` command to delete a store.

```sh
npx wrangler secrets-store store delete d2dafaeac9434de2b6d08b292ce08211
```

```sh output
🔐 Deleting store... (Name: d2dafaeac9434de2b6d08b292ce08211)
✅ Deleted store! (ID: d2dafaeac9434de2b6d08b292ce08211)
```

### list

List the stores within an account.

```txt
wrangler secrets-store store list
```

The following is an example of using the `list` command to list stores.

```sh
npx wrangler secrets-store store list
```

```sh output
🔐 Listing stores...
┌─────────┬──────────────────────────────────┬──────────────────────────────────┬──────────────────────┬──────────────────────┐
│ Name │ ID │ AccountID │ Created │ Modified │
├─────────┼──────────────────────────────────┼──────────────────────────────────┼──────────────────────┼──────────────────────┤
│ default │ 8876bad33f164462bf0743fe8adf98f4 │ REDACTED │ 4/9/2025, 1:11:48 PM │ 4/9/2025, 1:11:48 PM │
└─────────┴──────────────────────────────────┴──────────────────────────────────┴──────────────────────┴──────────────────────┘
```

## `secrets-store secret`

With the release of [Secrets Store](/secrets-store/) in open beta, you can use the following commands to manage your account secrets.
Expand Down
Loading