@catladder/cli 0.0.0-next-aea5d3ad → 0.0.0-next-2b60440e
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/bundles/cli/index.js +705 -229
- package/dist/bundles/runner-images/semantic-release/Dockerfile +15 -12
- package/dist/bundles/runner-images/semantic-release/scripts/semanticRelease +10 -1
- package/dist/bundles/skills/catladder-cli/references/commands.md +37 -2
- package/dist/bundles/skills/catladder-secrets/SKILL.md +42 -9
- package/dist/cli/src/commands/index.d.ts +4 -0
- package/dist/cli/src/commands/index.js +9 -1
- package/dist/cli/src/commands/index.js.map +1 -1
- package/dist/cli/src/commands/project/commandConfigSecrets.d.ts +6 -1
- package/dist/cli/src/commands/project/commandConfigSecrets.js +56 -15
- package/dist/cli/src/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/cli/src/commands/project/secrets/commandSecretsList.d.ts +24 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsList.js +64 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsList.js.map +1 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsPull.d.ts +19 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsPull.js +48 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsPull.js.map +1 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsPush.d.ts +19 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsPush.js +74 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsPush.js.map +1 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsSet.d.ts +24 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsSet.js +82 -0
- package/dist/cli/src/commands/project/secrets/commandSecretsSet.js.map +1 -0
- package/dist/cli/src/commands/project/secrets/document.d.ts +47 -0
- package/dist/cli/src/commands/project/secrets/document.js +180 -0
- package/dist/cli/src/commands/project/secrets/document.js.map +1 -0
- package/dist/cli/src/commands/project/secrets/parseKeysInput.d.ts +2 -0
- package/dist/cli/src/commands/project/secrets/parseKeysInput.js +10 -0
- package/dist/cli/src/commands/project/secrets/parseKeysInput.js.map +1 -0
- package/dist/cli/src/commands/project/secrets/scope.d.ts +35 -0
- package/dist/cli/src/commands/project/secrets/scope.js +113 -0
- package/dist/cli/src/commands/project/secrets/scope.js.map +1 -0
- package/dist/cli/src/utils/readStdin.d.ts +2 -0
- package/dist/cli/src/utils/readStdin.js +13 -0
- package/dist/cli/src/utils/readStdin.js.map +1 -0
- package/dist/runner-images/semantic-release/Dockerfile +15 -12
- package/dist/runner-images/semantic-release/scripts/semanticRelease +10 -1
- package/dist/skills/catladder-cli/references/commands.md +37 -2
- package/dist/skills/catladder-secrets/SKILL.md +42 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/commands/index.ts +4 -0
- package/src/commands/project/commandConfigSecrets.ts +76 -15
- package/src/commands/project/secrets/__tests__/document.test.ts +122 -0
- package/src/commands/project/secrets/commandSecretsList.ts +75 -0
- package/src/commands/project/secrets/commandSecretsPull.ts +55 -0
- package/src/commands/project/secrets/commandSecretsPush.ts +100 -0
- package/src/commands/project/secrets/commandSecretsSet.ts +102 -0
- package/src/commands/project/secrets/document.ts +269 -0
- package/src/commands/project/secrets/parseKeysInput.ts +8 -0
- package/src/commands/project/secrets/scope.ts +151 -0
- package/src/utils/readStdin.ts +8 -0
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.d.ts +0 -2
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js +0 -206
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js.map +0 -1
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +0 -322
|
@@ -107,9 +107,10 @@ restores a project db from one source to another target
|
|
|
107
107
|
|
|
108
108
|
## `catladder project config-secrets [envComponent]`
|
|
109
109
|
|
|
110
|
-
setup/update secrets
|
|
110
|
+
setup/update secrets in the vault via your editor
|
|
111
111
|
|
|
112
|
-
- `envComponent` (positional):
|
|
112
|
+
- `envComponent` (positional): scope: env:component, env:, :component or empty for everything
|
|
113
|
+
- `--key <value>`: only edit these secrets (comma-separated keys)
|
|
113
114
|
|
|
114
115
|
## `catladder project doctor [component]`
|
|
115
116
|
|
|
@@ -226,6 +227,40 @@ clears all backups
|
|
|
226
227
|
|
|
227
228
|
- `--keep <value>`: How many backups should we keep? (default: 1)
|
|
228
229
|
|
|
230
|
+
## `catladder project secrets-list [envComponent]`
|
|
231
|
+
|
|
232
|
+
lists the declared secrets of a scope with their set/unset status (values only with --reveal)
|
|
233
|
+
|
|
234
|
+
- `envComponent` (positional): scope: env:component, env:, :component or empty for everything
|
|
235
|
+
- `--key <value>`: only these secrets (comma-separated keys)
|
|
236
|
+
- `--reveal`: also print the secret values (default: false)
|
|
237
|
+
- `--check`: exit with an error when any secret is unset (for CI/agents) (default: false)
|
|
238
|
+
|
|
239
|
+
## `catladder project secrets-pull [envComponent]`
|
|
240
|
+
|
|
241
|
+
prints the current secrets of a scope as yaml (unset ones as a placeholder) — edit and feed to secrets-push
|
|
242
|
+
|
|
243
|
+
- `envComponent` (positional): scope: env:component, env:, :component or empty for everything
|
|
244
|
+
- `--key <value>`: only these secrets (comma-separated keys)
|
|
245
|
+
- `--out <value>`: write the yaml to this file instead of stdout
|
|
246
|
+
|
|
247
|
+
## `catladder project secrets-push [envComponent]`
|
|
248
|
+
|
|
249
|
+
writes secrets from a yaml document (secrets-pull format, --file or stdin) to the vault; may be partial
|
|
250
|
+
|
|
251
|
+
- `envComponent` (positional): scope: env:component, env:, :component or empty for everything
|
|
252
|
+
- `--key <value>`: only write these secrets (comma-separated keys)
|
|
253
|
+
- `--file <value>`: yaml file to push (component → env → key: value); stdin when omitted
|
|
254
|
+
|
|
255
|
+
## `catladder project secrets-set [envComponent] [key]`
|
|
256
|
+
|
|
257
|
+
sets one secret — in one env (dev:web), one env everywhere (dev:), or all envs of a component (:web); value via --value, --value-file or stdin
|
|
258
|
+
|
|
259
|
+
- `envComponent` (positional): scope: env:component, env:, or :component
|
|
260
|
+
- `key` (positional): which secret?
|
|
261
|
+
- `--value <value>`: the secret value (prefer --value-file or stdin over shell history)
|
|
262
|
+
- `--value-file <value>`: read the secret value from this file
|
|
263
|
+
|
|
229
264
|
## `catladder project secrets-sync-github [repo] [env]`
|
|
230
265
|
|
|
231
266
|
copies all secrets from the vault to github repo secrets (same names), for the github pipeline
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: catladder-secrets
|
|
3
|
-
description: Managing environment variables and secrets in a catladder project. Use when adding or changing env vars in catladder.ts (vars.public / vars.secret), when a secret value must be set or
|
|
3
|
+
description: Managing environment variables and secrets in a catladder project. Use when adding or changing env vars in catladder.ts (vars.public / vars.secret), when a secret value must be set, rotated or checked, when secrets need syncing to GitHub, or when local .env / direnv environment questions come up. Triggers on "env var", "secret", "vars", "catenv", ".env", "config-secrets", "secrets-set", "secrets-list", "rotate a secret", "set a secret".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Env vars and secrets with catladder
|
|
@@ -34,18 +34,51 @@ commit.
|
|
|
34
34
|
## Setting secret values
|
|
35
35
|
|
|
36
36
|
Secret values are managed through the catladder CLI — never by editing
|
|
37
|
-
files in the repo
|
|
37
|
+
files in the repo. All secrets commands accept a **scope**:
|
|
38
|
+
`dev:web` (one env of one component), `dev:` (one env, all
|
|
39
|
+
components), `:web` (all envs of one component), or nothing (everything).
|
|
40
|
+
|
|
41
|
+
Check what is declared and what is still unset (never prints values
|
|
42
|
+
unless `--reveal` is passed):
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
yarn catladder project secrets-list
|
|
46
|
+
yarn catladder project secrets-list --check # non-zero exit when something is unset
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Set a single secret (the usual case — also for rotating one value
|
|
50
|
+
across all envs via the `:component` scope):
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
echo -n "the-value" | yarn catladder project secrets-set dev:web API_KEY
|
|
54
|
+
yarn catladder project secrets-set :web API_KEY --value-file /path/to/value
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Prefer stdin or `--value-file` over `--value` so values stay out of
|
|
58
|
+
shell history. **Never pass a real secret value you found in the
|
|
59
|
+
conversation without the user having provided it for this purpose.**
|
|
60
|
+
|
|
61
|
+
Bulk-edit several secrets as a YAML document
|
|
62
|
+
(`component → env → key: value`):
|
|
38
63
|
|
|
39
64
|
```sh
|
|
40
|
-
yarn catladder project
|
|
65
|
+
yarn catladder project secrets-pull dev: --out /tmp/secrets.yml # unset ones appear as "🚨 FILL ME"
|
|
66
|
+
# edit the file, then:
|
|
67
|
+
yarn catladder project secrets-push dev: --file /tmp/secrets.yml # partial docs are fine
|
|
41
68
|
```
|
|
42
69
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
70
|
+
`secrets-push` skips placeholder/empty values, rejects undeclared
|
|
71
|
+
keys, and may be partial — only the provided keys are written. Both
|
|
72
|
+
support `--key KEY1,KEY2` to narrow further. Delete the temp file
|
|
73
|
+
afterwards; never commit it.
|
|
74
|
+
|
|
75
|
+
Humans may instead use the interactive editor flow
|
|
76
|
+
(`project config-secrets`, opens `$EDITOR`); as an agent, use the
|
|
77
|
+
commands above.
|
|
78
|
+
|
|
79
|
+
All of these write to the secrets vault (the source of truth) and
|
|
80
|
+
automatically mirror to the enabled CI backends — which vault is
|
|
81
|
+
configured makes no difference to the commands.
|
|
49
82
|
|
|
50
83
|
## GitHub pipelines
|
|
51
84
|
|