@chriscode/hush 5.0.2 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -36,7 +36,7 @@ ${pc.bold('Commands:')}
36
36
  init Initialize hush.yaml config
37
37
  encrypt Encrypt source .hush files
38
38
  run -- <cmd> Run command with secrets in memory (AI-safe)
39
- set [VALUE] <KEY> Set a single secret (AI-safe, prompts if no value)
39
+ set <KEY> [VALUE] Set a single secret (AI-safe, prompts if no value)
40
40
  edit [file] Edit all secrets in $EDITOR
41
41
  list List all variables (shows values)
42
42
  inspect List all variables (masked values, AI-safe)
@@ -114,7 +114,8 @@ ${pc.bold('Examples:')}
114
114
  hush run -t api -- wrangler dev Run filtered for 'api' target (root secrets only)
115
115
  cd apps/mobile && hush run -- expo start Run from subdirectory (applies template + target filters)
116
116
  hush set DATABASE_URL Set a secret interactively (prompts for value)
117
- hush set "myvalue" API_KEY Set a secret inline (no prompt)
117
+ hush set API_KEY "myvalue" Set a secret inline (no prompt)
118
+ echo "val" | hush set KEY Set a secret from piped input
118
119
  hush set API_KEY --gui Set secret via GUI dialog (for AI agents)
119
120
  hush set API_KEY -e prod Set a production secret
120
121
  hush keys setup Pull key from 1Password or verify local
@@ -281,10 +282,9 @@ function parseArgs(args) {
281
282
  key = arg;
282
283
  }
283
284
  else if (!value) {
284
- // Second positional arg: shift key to value, this arg is the key
285
- // Syntax: hush set <VALUE> <KEY>
286
- value = key;
287
- key = arg;
285
+ // Second positional arg is the value
286
+ // Syntax: hush set <KEY> <VALUE>
287
+ value = arg;
288
288
  }
289
289
  continue;
290
290
  }
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAmC,WAAW,EAAE,MAAM,aAAa,CAAC;AAkD5F,wBAAsB,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA8GrF"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAmC,WAAW,EAAE,MAAM,aAAa,CAAC;AAkD5F,wBAAsB,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA6GrF"}
@@ -121,7 +121,6 @@ export async function runCommand(ctx, options) {
121
121
  const result = ctx.exec.spawnSync(cmd, args, {
122
122
  stdio: 'inherit',
123
123
  env: childEnv,
124
- shell: true,
125
124
  cwd: contextDir,
126
125
  });
127
126
  if (result.error) {
@@ -70,7 +70,7 @@ npx hush inspect # See what secrets exist
70
70
  ### Scenario 4: Need to Add/Modify Secrets
71
71
 
72
72
  \`\`\`bash
73
- npx hush set <VALUE> <KEY> # Add inline (value and key provided)
73
+ npx hush set <KEY> <VALUE> # Add inline (key and value provided)
74
74
  npx hush set <KEY> # Add interactively (prompts for value)
75
75
  npx hush edit # Edit all secrets in $EDITOR
76
76
  npx hush inspect # Verify changes
@@ -220,7 +220,7 @@ LOG_LEVEL=\${LOG_LEVEL:-info}
220
220
  | \`npx hush status\` | **Full diagnostic** | First step, always |
221
221
  | \`npx hush inspect\` | See variables (masked) | Check what's configured |
222
222
  | \`npx hush has <KEY>\` | Check specific variable | Verify a secret exists |
223
- | \`npx hush set [VALUE] <KEY>\` | Add secret (prompts if no value) | User needs to set a value |
223
+ | \`npx hush set <KEY> [VALUE]\` | Add secret (prompts if no value) | User needs to set a value |
224
224
  | \`npx hush edit\` | Edit all secrets | Bulk editing |
225
225
  | \`npx hush run -- <cmd>\` | Run with secrets in memory | Actually use the secrets |
226
226
  | \`npx hush init\` | Initialize Hush | First-time setup |
@@ -317,8 +317,8 @@ npx hush has API_KEY -q # Quiet: exit code only (0=set, 1=missing)
317
317
 
318
318
  **Method 1: Inline value (recommended for AI agents)**
319
319
  \`\`\`bash
320
- npx hush set "postgres://user:pass@host/db" DATABASE_URL
321
- npx hush set "sk_live_xxx" STRIPE_KEY -e production
320
+ npx hush set DATABASE_URL "postgres://user:pass@host/db"
321
+ npx hush set STRIPE_KEY "sk_live_xxx" -e production
322
322
  \`\`\`
323
323
 
324
324
  **Method 2: Interactive prompt (for users)**
@@ -700,19 +700,19 @@ hush run -t api -- wrangler dev # Run filtered for 'api' target
700
700
 
701
701
  ---
702
702
 
703
- ### hush set [VALUE] <KEY>
703
+ ### hush set <KEY> [VALUE] ⭐
704
704
 
705
705
  Add or update a single secret. Prompts for value if not provided inline.
706
706
 
707
707
  \`\`\`bash
708
708
  hush set DATABASE_URL # Prompts for value interactively
709
- hush set "postgres://..." DATABASE_URL # Inline value (no prompt)
709
+ hush set DATABASE_URL "postgres://..." # Inline value (no prompt)
710
710
  hush set API_KEY -e production # Set in production secrets
711
711
  hush set DEBUG --local # Set personal local override
712
712
  \`\`\`
713
713
 
714
714
  **Input methods (in priority order):**
715
- 1. **Inline value**: \`hush set "myvalue" KEY\` - value provided directly
715
+ 1. **Inline value**: \`hush set KEY "myvalue"\` - value provided directly
716
716
  2. **Piped input**: \`echo "myvalue" | hush set KEY\` - reads from stdin
717
717
  3. **Interactive prompt**: Opens dialog/prompt for user input
718
718
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chriscode/hush",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "description": "SOPS-based secrets management for monorepos. Encrypt once, decrypt everywhere.",
5
5
  "type": "module",
6
6
  "bin": {