Skip to content

Commit b8f4afc

Browse files
amannirala13claude
andcommitted
docs(node): fix incorrect CLI examples in documentation
Fixed all instances where documentation incorrectly showed CLI usage with a non-existent service parameter (e.g., 'envguard set my-app KEY value'). Changes: - Updated README.md with correct CLI syntax (envguard set KEY value) - Updated BEST-PRACTICES.md with correct CLI syntax - Clarified that package name is auto-detected from package.json - Clarified that --env flag should be used for environment specification - Noted that ENVGUARD_ENV is for Node.js runtime, not CLI The correct usage is: envguard set API_KEY value # default environment envguard set API_KEY value --env production # specific environment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5d01012 commit b8f4afc

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

packages/node/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ pnpm add @envguard/node
5656
npx envguard init
5757

5858
# Set your secrets
59-
npx envguard set my-app API_KEY your_secret_key_here
60-
npx envguard set my-app DATABASE_URL postgres://localhost/mydb
59+
npx envguard set API_KEY your_secret_key_here
60+
npx envguard set DATABASE_URL postgres://localhost/mydb
6161
```
6262

6363
### 3. Use in your app
@@ -305,7 +305,7 @@ npx envguard init
305305

306306
```bash
307307
# For each secret in .env
308-
npx envguard set my-app SECRET_NAME secret_value
308+
npx envguard set SECRET_NAME secret_value
309309
```
310310

311311
**Option B: Automated script**
@@ -314,7 +314,7 @@ npx envguard set my-app SECRET_NAME secret_value
314314
# Read from .env and store in keychain
315315
cat .env | while IFS='=' read -r key value; do
316316
[ -n "$key" ] && [ -n "$value" ] && \
317-
npx envguard set my-app "$key" "$value"
317+
npx envguard set "$key" "$value"
318318
done
319319
```
320320

@@ -365,14 +365,14 @@ ENVGUARD_ENV > NODE_ENV > 'development'
365365
### Multi-Environment Setup
366366

367367
```bash
368-
# Development secrets
369-
ENVGUARD_ENV=development npx envguard set my-app API_KEY dev_key_123
368+
# Development secrets (default environment)
369+
npx envguard set API_KEY dev_key_123
370370

371371
# Staging secrets
372-
ENVGUARD_ENV=staging npx envguard set my-app API_KEY staging_key_456
372+
npx envguard set API_KEY staging_key_456 --env staging
373373

374374
# Production secrets
375-
ENVGUARD_ENV=production npx envguard set my-app API_KEY prod_key_789
375+
npx envguard set API_KEY prod_key_789 --env production
376376
```
377377

378378
### Load Specific Environment
@@ -628,7 +628,7 @@ Yes! `process.env` variables take precedence (unless `override: true`).
628628
export API_KEY=shell_value
629629

630630
// EnvGuard secret
631-
envguard set my-app API_KEY keychain_value
631+
envguard set API_KEY keychain_value
632632

633633
// Load
634634
await load({ override: false });
@@ -675,7 +675,7 @@ See [Migration Guide](#migration-from-dotenv) above. TL;DR:
675675
676676
1. `npm install @envguard/node`
677677
2. `envguard init`
678-
3. Migrate secrets: `envguard set my-app KEY value`
678+
3. Migrate secrets: `envguard set KEY value`
679679
4. Change: `require('dotenv')` → `require('@envguard/node')`
680680
5. Delete `.env` file
681681

packages/node/docs/BEST-PRACTICES.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ DATABASE_URL=postgres://user:pass@host/db
4343
```typescript
4444
// ✅ Good - Separate secrets per environment
4545
// Development
46-
envguard set my-app API_KEY dev_key_123 --env development
46+
envguard set API_KEY dev_key_123 --env development
4747

4848
// Production
49-
envguard set my-app API_KEY prod_key_456 --env production
49+
envguard set API_KEY prod_key_456 --env production
5050

5151
// Load correct environment
5252
import { load } from '@envguard/node';
@@ -96,7 +96,7 @@ try {
9696

9797
```bash
9898
# Update secret in keychain
99-
envguard set my-app API_KEY new_rotated_key
99+
envguard set API_KEY new_rotated_key
100100

101101
# Restart application to pick up new value
102102
pm2 restart my-app
@@ -199,13 +199,13 @@ await load(); // Uses 'staging'
199199

200200
```bash
201201
# Development
202-
envguard set my-app DATABASE_URL postgres://localhost/dev_db --env development
202+
envguard set DATABASE_URL postgres://localhost/dev_db --env development
203203

204204
# Staging
205-
envguard set my-app DATABASE_URL postgres://staging.example.com/db --env staging
205+
envguard set DATABASE_URL postgres://staging.example.com/db --env staging
206206

207207
# Production
208-
envguard set my-app DATABASE_URL postgres://prod.example.com/db --env production
208+
envguard set DATABASE_URL postgres://prod.example.com/db --env production
209209
```
210210

211211
### 3. Local Overrides
@@ -441,7 +441,7 @@ npx envguard init
441441
```bash
442442
# Read from .env file
443443
cat .env | while IFS='=' read -r key value; do
444-
envguard set my-app "$key" "$value"
444+
envguard set "$key" "$value"
445445
done
446446
```
447447

0 commit comments

Comments
 (0)