envpkt 0.14.1 → 0.16.0
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/README.md +27 -1
- package/dist/cli.js +398 -99
- package/dist/index.d.ts +69 -5
- package/dist/index.js +221 -54
- package/package.json +10 -10
- package/schemas/envpkt.schema.json +29 -0
package/README.md
CHANGED
|
@@ -478,7 +478,7 @@ envpkt copy API_KEY --to b.toml --force # overwrite if it already exist
|
|
|
478
478
|
envpkt copy API_KEY --to b.toml --dry-run # preview without writing
|
|
479
479
|
```
|
|
480
480
|
|
|
481
|
-
`--from`/`--to` default to the config resolved for the current directory (and must already exist).
|
|
481
|
+
`--from`/`--to` default to the config resolved for the current directory (and must already exist). A copy into a new key gets today's `created`. With `--force` onto an existing entry, the entry is replaced in place and keeps the destination's `created`. Either way, `last_rotated_at` is dropped (it's the source's rotation history). Copying a sealed secret needs the source key to unseal and the destination's `identity.recipient` to reseal.
|
|
482
482
|
|
|
483
483
|
### `envpkt exec`
|
|
484
484
|
|
|
@@ -499,6 +499,8 @@ Encrypt secret values into `envpkt.toml` using [age](https://age-encryption.org/
|
|
|
499
499
|
envpkt seal # Seal all secrets in envpkt.toml
|
|
500
500
|
envpkt seal -c path/to/envpkt.toml # Specify config path
|
|
501
501
|
envpkt seal --profile staging # Use a specific fnox profile for value resolution
|
|
502
|
+
envpkt seal --edit OPENAI_API_KEY # Re-seal one key with a new value (prompts in a terminal)
|
|
503
|
+
pbpaste | envpkt seal --edit OPENAI_API_KEY # No terminal (agent, CI): read the value from stdin
|
|
502
504
|
```
|
|
503
505
|
|
|
504
506
|
Requires `identity.recipient` (age public key) in your config. Values are resolved via cascade:
|
|
@@ -507,6 +509,15 @@ Requires `identity.recipient` (age public key) in your config. Values are resolv
|
|
|
507
509
|
2. **Environment variables** (e.g. `OPENAI_API_KEY` in your shell)
|
|
508
510
|
3. **Interactive prompt** (asks you to paste each value)
|
|
509
511
|
|
|
512
|
+
Plain `envpkt seal` skips keys that are already sealed, so it only covers a first seal. `OPENAI_API_KEY=... envpkt seal` works for that.
|
|
513
|
+
|
|
514
|
+
To rotate one sealed value, use `--edit <key>`. In a terminal it prompts, and asks before replacing a sealed value. Without a terminal (an agent shell, CI, Claude Code's `!` prompt), it reads the value from stdin instead and replaces it without asking. Pass `--stdin` to read stdin on purpose, even in a terminal. Stdin rules:
|
|
515
|
+
|
|
516
|
+
- It carries one value, so `--edit` takes exactly one key.
|
|
517
|
+
- One trailing newline is stripped (`\n` or `\r\n`).
|
|
518
|
+
- Empty or whitespace-only stdin is an error, and the file is left unchanged.
|
|
519
|
+
- envpkt never prints the value.
|
|
520
|
+
|
|
510
521
|
After sealing, each secret gets an `encrypted_value` field. At boot time, `envpkt exec` or `boot()` automatically decrypts sealed values using the `identity.key_file` path (or the default `~/.envpkt/age-key.txt`).
|
|
511
522
|
|
|
512
523
|
See [`examples/sealed-agent.toml`](./examples/sealed-agent.toml) for a complete example.
|
|
@@ -584,6 +595,21 @@ Inject resolved secrets into a GitHub Actions job. Emits `::add-mask::` for each
|
|
|
584
595
|
npx envpkt env github --strict
|
|
585
596
|
```
|
|
586
597
|
|
|
598
|
+
### `envpkt headers`
|
|
599
|
+
|
|
600
|
+
Print the HTTP headers for one MCP server as JSON, for Claude Code's `headersHelper`. Bind a secret to a server with `mcp = [{ server = "civala-github" }]` (optional `header`, default `"Authorization"`; `scheme`, default `"Bearer"`, `""` for the raw value).
|
|
601
|
+
|
|
602
|
+
```bash
|
|
603
|
+
envpkt headers civala-github # {"Authorization":"Bearer ..."}
|
|
604
|
+
envpkt headers # server from $CLAUDE_CODE_MCP_SERVER_NAME
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
```json
|
|
608
|
+
{ "type": "http", "url": "https://github.civala.ai/mcp", "headersHelper": "envpkt headers" }
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
stdout holds only the JSON; warnings and errors go to stderr. It decrypts sealed values through `identity.key_file`, so it works when Claude was launched with a stripped environment and `${VAR}` refs in `.mcp.json` would expand empty. Exits non-zero, naming the server, when nothing matches or a value does not resolve. Without `-c`, it finds `envpkt.toml` like every other command, falling back to the global package when the project has none.
|
|
612
|
+
|
|
587
613
|
### `envpkt mcp`
|
|
588
614
|
|
|
589
615
|
Start the envpkt MCP server (stdio transport) for AI agent integration.
|