Skip to content

Commit f154c80

Browse files
mia303kodster28
andauthored
Add wrangler store commands to secrets-store docs (#21564)
* Update src/content/docs/workers/wrangler/commands.mdx Co-authored-by: Kody Jackson <[email protected]> * added to workers integration doc and wranglers command doc * added to workers integration doc and wranglers command doc pt 2 * added store list * Update commands.mdx --------- Co-authored-by: Kody Jackson <[email protected]>
1 parent 360f0bc commit f154c80

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed

src/content/docs/secrets-store/integrations/workers.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ If [using the Dashboard](#via-dashboard), make sure you already have a Workers a
2222

2323
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.
2424

25+
You can also use the [Wrangler command](/workers/wrangler/commands/#secrets-store-store) `secrets-store store create <name>` to create your default store.
26+
2527
## 1. Set up account secrets in Secrets Store
2628

2729
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.
@@ -57,7 +59,7 @@ npx wrangler secrets-store secret create <STORE_ID> --name MY_SECRETS_STORE_SECR
5759

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

60-
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.
62+
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.
6163

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

src/content/docs/workers/wrangler/commands.mdx

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Wrangler offers a number of commands to manage your Cloudflare Workers.
3434
- [`secret`](#secret) - Manage the secret variables for a Worker.
3535
- [`secret bulk`](#secret-bulk) - Manage multiple secret variables for a Worker.
3636
- [`secrets-store secret`](#secrets-store-secret) - Manage account secrets within a secrets store.
37+
- [`secrets-store store`](#secrets-store-store) - Manage your store within secrets store.
3738
- [`workflows`](#workflows) - Manage and configure Workflows.
3839
- [`tail`](#tail) - Start a session to livestream logs from a deployed Worker.
3940
- [`pages`](#pages) - Configure Cloudflare Pages.
@@ -731,6 +732,81 @@ Finished processing secrets JSON file:
731732
🚨 1 secrets failed to upload
732733
```
733734

735+
## `secrets-store store`
736+
737+
You can use the following commands to manage your store.
738+
739+
:::note[Store limitation]
740+
Each account only supports one store in beta.
741+
:::
742+
743+
### create
744+
745+
Create a store within Secrets Store.
746+
747+
```txt
748+
wrangler secerets-store store create <name>
749+
```
750+
751+
- `name` <Type text="string" /> <MetaInfo text="required" />
752+
- A descriptive name for the account-level secret. Cannot contain spaces.
753+
754+
The following is an example of using the `create` command to create a store.
755+
756+
```txt
757+
wrangler secrets-store store create default --remote
758+
```
759+
760+
```sh output
761+
🔐 Creating store... (Name: default)
762+
✅ Created store! (Name: default, ID: 2e2a82d317134506b58defbe16982d54)
763+
```
764+
765+
### delete
766+
767+
Delete a store within Secrets Store.
768+
769+
```txt
770+
wrangler secerets-store store delete <STORE_ID>
771+
```
772+
773+
- `STORE_ID` <Type text="string" /> <MetaInfo text="required" />
774+
- 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.
775+
776+
The following is an example of using the `delete` command to delete a store.
777+
778+
```sh
779+
npx wrangler secrets-store store delete d2dafaeac9434de2b6d08b292ce08211
780+
```
781+
782+
```sh output
783+
🔐 Deleting store... (Name: d2dafaeac9434de2b6d08b292ce08211)
784+
✅ Deleted store! (ID: d2dafaeac9434de2b6d08b292ce08211)
785+
```
786+
787+
### list
788+
789+
List the stores within an account.
790+
791+
```txt
792+
wrangler secrets-store store list
793+
```
794+
795+
The following is an example of using the `list` command to list stores.
796+
797+
```sh
798+
npx wrangler secrets-store store list
799+
```
800+
801+
```sh output
802+
🔐 Listing stores...
803+
┌─────────┬──────────────────────────────────┬──────────────────────────────────┬──────────────────────┬──────────────────────┐
804+
│ Name │ ID │ AccountID │ Created │ Modified │
805+
├─────────┼──────────────────────────────────┼──────────────────────────────────┼──────────────────────┼──────────────────────┤
806+
│ default │ 8876bad33f164462bf0743fe8adf98f4 │ REDACTED │ 4/9/2025, 1:11:48 PM │ 4/9/2025, 1:11:48 PM │
807+
└─────────┴──────────────────────────────────┴──────────────────────────────────┴──────────────────────┴──────────────────────┘
808+
```
809+
734810
## `secrets-store secret`
735811

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

0 commit comments

Comments
 (0)