@catladder/cli 0.0.0-next-aea5d3ad → 0.0.0-next-1c65899f

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.
Files changed (52) hide show
  1. package/dist/bundles/cli/index.js +705 -229
  2. package/dist/bundles/skills/catladder-cli/references/commands.md +37 -2
  3. package/dist/bundles/skills/catladder-secrets/SKILL.md +42 -9
  4. package/dist/cli/src/commands/index.d.ts +4 -0
  5. package/dist/cli/src/commands/index.js +9 -1
  6. package/dist/cli/src/commands/index.js.map +1 -1
  7. package/dist/cli/src/commands/project/commandConfigSecrets.d.ts +6 -1
  8. package/dist/cli/src/commands/project/commandConfigSecrets.js +56 -15
  9. package/dist/cli/src/commands/project/commandConfigSecrets.js.map +1 -1
  10. package/dist/cli/src/commands/project/secrets/commandSecretsList.d.ts +24 -0
  11. package/dist/cli/src/commands/project/secrets/commandSecretsList.js +64 -0
  12. package/dist/cli/src/commands/project/secrets/commandSecretsList.js.map +1 -0
  13. package/dist/cli/src/commands/project/secrets/commandSecretsPull.d.ts +19 -0
  14. package/dist/cli/src/commands/project/secrets/commandSecretsPull.js +48 -0
  15. package/dist/cli/src/commands/project/secrets/commandSecretsPull.js.map +1 -0
  16. package/dist/cli/src/commands/project/secrets/commandSecretsPush.d.ts +19 -0
  17. package/dist/cli/src/commands/project/secrets/commandSecretsPush.js +74 -0
  18. package/dist/cli/src/commands/project/secrets/commandSecretsPush.js.map +1 -0
  19. package/dist/cli/src/commands/project/secrets/commandSecretsSet.d.ts +24 -0
  20. package/dist/cli/src/commands/project/secrets/commandSecretsSet.js +82 -0
  21. package/dist/cli/src/commands/project/secrets/commandSecretsSet.js.map +1 -0
  22. package/dist/cli/src/commands/project/secrets/document.d.ts +47 -0
  23. package/dist/cli/src/commands/project/secrets/document.js +180 -0
  24. package/dist/cli/src/commands/project/secrets/document.js.map +1 -0
  25. package/dist/cli/src/commands/project/secrets/parseKeysInput.d.ts +2 -0
  26. package/dist/cli/src/commands/project/secrets/parseKeysInput.js +10 -0
  27. package/dist/cli/src/commands/project/secrets/parseKeysInput.js.map +1 -0
  28. package/dist/cli/src/commands/project/secrets/scope.d.ts +35 -0
  29. package/dist/cli/src/commands/project/secrets/scope.js +113 -0
  30. package/dist/cli/src/commands/project/secrets/scope.js.map +1 -0
  31. package/dist/cli/src/utils/readStdin.d.ts +2 -0
  32. package/dist/cli/src/utils/readStdin.js +13 -0
  33. package/dist/cli/src/utils/readStdin.js.map +1 -0
  34. package/dist/skills/catladder-cli/references/commands.md +37 -2
  35. package/dist/skills/catladder-secrets/SKILL.md +42 -9
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +1 -1
  38. package/src/commands/index.ts +4 -0
  39. package/src/commands/project/commandConfigSecrets.ts +76 -15
  40. package/src/commands/project/secrets/__tests__/document.test.ts +122 -0
  41. package/src/commands/project/secrets/commandSecretsList.ts +75 -0
  42. package/src/commands/project/secrets/commandSecretsPull.ts +55 -0
  43. package/src/commands/project/secrets/commandSecretsPush.ts +100 -0
  44. package/src/commands/project/secrets/commandSecretsSet.ts +102 -0
  45. package/src/commands/project/secrets/document.ts +269 -0
  46. package/src/commands/project/secrets/parseKeysInput.ts +8 -0
  47. package/src/commands/project/secrets/scope.ts +151 -0
  48. package/src/utils/readStdin.ts +8 -0
  49. package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.d.ts +0 -2
  50. package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js +0 -206
  51. package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js.map +0 -1
  52. package/src/apps/cli/commands/project/commandConfigSecrets.ts +0 -322
@@ -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 rotated, 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".
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 config-secrets
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
- This opens all env vars as YAML in `$EDITOR` (use e.g.
44
- `EDITOR="code --wait"`); on save, catladder upserts the changed values
45
- into the secrets vault. **An agent cannot drive this interactive
46
- editor** — when a new secret *value* is needed, add the name to
47
- `vars.secret`, regenerate, and ask the user to run
48
- `project config-secrets` themselves.
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