You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/stack/README.md
+38-18Lines changed: 38 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,19 +44,29 @@ pnpm add @cipherstash/stack
44
44
45
45
## Quick Start
46
46
47
+
### 1. Initialize and authenticate your project
48
+
49
+
```bash
50
+
npx stash init
51
+
```
52
+
53
+
The wizard will authenticate you, walk you through choosing a database connection method, build an encryption schema, and install the required dependencies.
The `stash` CLI is bundled with the package and available after install.
432
442
443
+
### `stash auth`
444
+
445
+
Authenticate with CipherStash.
446
+
447
+
```bash
448
+
npx stash auth login
449
+
```
450
+
451
+
This runs the device code flow: it opens your browser, you confirm the code, and a token is saved to `~/.cipherstash/auth.json`. No environment variables or credentials files are needed for local development.
452
+
433
453
### `stash init`
434
454
435
455
Initialize CipherStash for your project with an interactive wizard.
@@ -440,11 +460,13 @@ npx stash init --supabase
440
460
```
441
461
442
462
The wizard will:
443
-
1. Choose your database connection method (Drizzle ORM, Supabase JS, Prisma, or Raw SQL)
444
-
2. Build an encryption schema interactively or use a placeholder, then generate the encryption client file
445
-
3. Install `@cipherstash/stack-forge` as a dev dependency for database tooling
463
+
1. Authenticate with CipherStash (device code flow)
464
+
2. Bind your device to the default Keyset
465
+
3. Choose your database connection method (Drizzle ORM, Supabase JS, Prisma, or Raw SQL)
466
+
4. Build an encryption schema interactively or use a placeholder, then generate the encryption client file
467
+
5. Install `@cipherstash/stack-forge` as a dev dependency for database tooling
446
468
447
-
After `stash init`, create a CipherStash account at [dashboard.cipherstash.com/sign-up](https://dashboard.cipherstash.com/sign-up) to get your credentials, then run `npx stash-forge setup` to configure your database connection.
469
+
After `stash init`, run `npx stash-forge setup` to configure your database.
|`stash secrets list`|`-environment`|`-e`| List all secret names in an environment |
469
491
|`stash secrets delete`|`-name`, `-environment`, `-yes`|`-n`, `-e`, `-y`| Delete a secret (prompts for confirmation unless `-yes`) |
470
492
471
-
The CLI reads credentials from the same `CS_*` environment variables described in [Configuration](#configuration).
472
-
473
493
## Configuration
474
494
475
-
### Environment Variables
495
+
### Local Development
496
+
497
+
No environment variables or credentials are needed for local development. Run `npx @cipherstash/stack auth login` to authenticate via the device code flow, and the SDK and CLI will use the token saved to `~/.cipherstash/auth.json`.
498
+
499
+
### Going to Production
500
+
501
+
For production, CI/CD, and deployed environments, you'll need to set up machine credentials via environment variables:
476
502
477
503
| Variable | Description |
478
504
|-----|-------|
@@ -481,13 +507,7 @@ The CLI reads credentials from the same `CS_*` environment variables described i
481
507
|`CS_CLIENT_KEY`| Client key material used with ZeroKMS for encryption |
482
508
|`CS_CLIENT_ACCESS_KEY`| API key for authenticating with the CipherStash API |
483
509
484
-
Store these in a `.env` file or set them in your hosting platform.
485
-
486
-
Sign up at [cipherstash.com/signup](https://cipherstash.com/signup) and follow the onboarding to generate credentials.
487
-
488
-
### TOML Config
489
-
490
-
You can also configure credentials via `cipherstash.toml` and `cipherstash.secret.toml` files in your project root. See the [CipherStash docs](https://cipherstash.com/docs) for format details.
510
+
See the [Going to Production](https://cipherstash.com/docs/stack/going-to-production) guide for full details on creating machine clients, setting up access keys, and configuring CI/CD pipelines.
Copy file name to clipboardExpand all lines: packages/stack/src/bin/commands/init/providers/base.ts
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,7 @@ export function createBaseProvider(): InitProvider {
11
11
{value: 'raw-sql',label: 'Raw SQL / pg'},
12
12
],
13
13
getNextSteps(state: InitState): string[]{
14
-
conststeps=[
15
-
'Create a CipherStash account and get your credentials:\n https://dashboard.cipherstash.com/sign-up\n Then set: CS_WORKSPACE_CRN, CS_CLIENT_ID, CS_CLIENT_KEY, CS_CLIENT_ACCESS_KEY',
16
-
'Set up your database: npx stash-forge setup',
17
-
]
14
+
conststeps=['Set up your database: npx stash-forge setup']
18
15
19
16
if(state.clientFilePath){
20
17
steps.push(`Edit your encryption schema: ${state.clientFilePath}`)
Copy file name to clipboardExpand all lines: packages/stack/src/bin/commands/init/providers/supabase.ts
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,7 @@ export function createSupabaseProvider(): InitProvider {
15
15
{value: 'raw-sql',label: 'Raw SQL / pg'},
16
16
],
17
17
getNextSteps(state: InitState): string[]{
18
-
conststeps=[
19
-
'Create a CipherStash account and get your credentials:\n https://dashboard.cipherstash.com/sign-up\n Then set: CS_WORKSPACE_CRN, CS_CLIENT_ID, CS_CLIENT_KEY, CS_CLIENT_ACCESS_KEY',
20
-
'Set up your database: npx stash-forge setup',
21
-
]
18
+
conststeps=['Set up your database: npx stash-forge setup']
22
19
23
20
if(state.clientFilePath){
24
21
steps.push(`Edit your encryption schema: ${state.clientFilePath}`)
0 commit comments