envshed 0.10.0 → 0.11.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.
Files changed (79) hide show
  1. package/dist/commands/completions.d.ts +3 -0
  2. package/dist/commands/completions.d.ts.map +1 -0
  3. package/dist/commands/completions.js +329 -0
  4. package/dist/commands/completions.js.map +1 -0
  5. package/dist/commands/completions.test.d.ts +2 -0
  6. package/dist/commands/completions.test.d.ts.map +1 -0
  7. package/dist/commands/completions.test.js +158 -0
  8. package/dist/commands/completions.test.js.map +1 -0
  9. package/dist/commands/diff.d.ts +3 -0
  10. package/dist/commands/diff.d.ts.map +1 -0
  11. package/dist/commands/diff.js +53 -0
  12. package/dist/commands/diff.js.map +1 -0
  13. package/dist/commands/import.d.ts +3 -0
  14. package/dist/commands/import.d.ts.map +1 -0
  15. package/dist/commands/import.js +137 -0
  16. package/dist/commands/import.js.map +1 -0
  17. package/dist/commands/import.test.d.ts +2 -0
  18. package/dist/commands/import.test.d.ts.map +1 -0
  19. package/dist/commands/import.test.js +385 -0
  20. package/dist/commands/import.test.js.map +1 -0
  21. package/dist/commands/run.d.ts.map +1 -1
  22. package/dist/commands/run.js +102 -5
  23. package/dist/commands/run.js.map +1 -1
  24. package/dist/commands/run.test.js +334 -1
  25. package/dist/commands/run.test.js.map +1 -1
  26. package/dist/index.js +6 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/lib/diff-renderer.d.ts +17 -0
  29. package/dist/lib/diff-renderer.d.ts.map +1 -0
  30. package/dist/lib/diff-renderer.js +82 -0
  31. package/dist/lib/diff-renderer.js.map +1 -0
  32. package/dist/lib/diff-renderer.test.d.ts +2 -0
  33. package/dist/lib/diff-renderer.test.d.ts.map +1 -0
  34. package/dist/lib/diff-renderer.test.js +214 -0
  35. package/dist/lib/diff-renderer.test.js.map +1 -0
  36. package/dist/lib/importers/csv.d.ts +8 -0
  37. package/dist/lib/importers/csv.d.ts.map +1 -0
  38. package/dist/lib/importers/csv.js +26 -0
  39. package/dist/lib/importers/csv.js.map +1 -0
  40. package/dist/lib/importers/csv.test.d.ts +2 -0
  41. package/dist/lib/importers/csv.test.d.ts.map +1 -0
  42. package/dist/lib/importers/csv.test.js +25 -0
  43. package/dist/lib/importers/csv.test.js.map +1 -0
  44. package/dist/lib/importers/dotenv.d.ts +7 -0
  45. package/dist/lib/importers/dotenv.d.ts.map +1 -0
  46. package/dist/lib/importers/dotenv.js +13 -0
  47. package/dist/lib/importers/dotenv.js.map +1 -0
  48. package/dist/lib/importers/dotenv.test.d.ts +2 -0
  49. package/dist/lib/importers/dotenv.test.d.ts.map +1 -0
  50. package/dist/lib/importers/dotenv.test.js +30 -0
  51. package/dist/lib/importers/dotenv.test.js.map +1 -0
  52. package/dist/lib/importers/index.d.ts +17 -0
  53. package/dist/lib/importers/index.d.ts.map +1 -0
  54. package/dist/lib/importers/index.js +42 -0
  55. package/dist/lib/importers/index.js.map +1 -0
  56. package/dist/lib/importers/index.test.d.ts +2 -0
  57. package/dist/lib/importers/index.test.d.ts.map +1 -0
  58. package/dist/lib/importers/index.test.js +23 -0
  59. package/dist/lib/importers/index.test.js.map +1 -0
  60. package/dist/lib/importers/json.d.ts +9 -0
  61. package/dist/lib/importers/json.d.ts.map +1 -0
  62. package/dist/lib/importers/json.js +30 -0
  63. package/dist/lib/importers/json.js.map +1 -0
  64. package/dist/lib/importers/json.test.d.ts +2 -0
  65. package/dist/lib/importers/json.test.d.ts.map +1 -0
  66. package/dist/lib/importers/json.test.js +47 -0
  67. package/dist/lib/importers/json.test.js.map +1 -0
  68. package/dist/lib/importers/yaml.d.ts +8 -0
  69. package/dist/lib/importers/yaml.d.ts.map +1 -0
  70. package/dist/lib/importers/yaml.js +18 -0
  71. package/dist/lib/importers/yaml.js.map +1 -0
  72. package/dist/lib/importers/yaml.test.d.ts +2 -0
  73. package/dist/lib/importers/yaml.test.d.ts.map +1 -0
  74. package/dist/lib/importers/yaml.test.js +38 -0
  75. package/dist/lib/importers/yaml.test.js.map +1 -0
  76. package/dist/locales/en.json +45 -1
  77. package/dist/locales/es.json +111 -67
  78. package/dist/locales/pt-BR.json +144 -100
  79. package/package.json +5 -2
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const completionsCommand: Command;
3
+ //# sourceMappingURL=completions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/commands/completions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiUpC,eAAO,MAAM,kBAAkB,SAW3B,CAAC"}
@@ -0,0 +1,329 @@
1
+ import { Command } from "commander";
2
+ import { t } from "../i18n.js";
3
+ function generateBashScript() {
4
+ return `_envshed() {
5
+ local cur="\${COMP_WORDS[COMP_CWORD]}"
6
+ local commands="login pull push diff import run orgs projects envs token init env branch whoami workspace link unlink env-version versions rollback snapshot rename-env completions"
7
+ if [ $COMP_CWORD -eq 1 ]; then
8
+ COMPREPLY=( $(compgen -W "$commands" -- "$cur") )
9
+ else
10
+ case "\${COMP_WORDS[1]}" in
11
+ login)
12
+ COMPREPLY=( $(compgen -W "--token --locale --workspace --all" -- "$cur") ) ;;
13
+ pull)
14
+ COMPREPLY=( $(compgen -W "--org --project --env --file --stdout --force --format --locale --workspace --all" -- "$cur") ) ;;
15
+ push)
16
+ COMPREPLY=( $(compgen -W "--org --project --env --file --force --locale --workspace --all" -- "$cur") ) ;;
17
+ diff)
18
+ COMPREPLY=( $(compgen -W "--org --project --show-values --locale --workspace --all" -- "$cur") ) ;;
19
+ import)
20
+ COMPREPLY=( $(compgen -W "--org --project --env --format --force --locale --workspace --all" -- "$cur") ) ;;
21
+ run)
22
+ COMPREPLY=( $(compgen -W "--org --project --env --watch --interval --locale --workspace --all" -- "$cur") ) ;;
23
+ orgs)
24
+ COMPREPLY=( $(compgen -W "--locale --workspace --all" -- "$cur") ) ;;
25
+ projects)
26
+ COMPREPLY=( $(compgen -W "--org --locale --workspace --all" -- "$cur") ) ;;
27
+ envs)
28
+ COMPREPLY=( $(compgen -W "--org --project --locale --workspace --all" -- "$cur") ) ;;
29
+ token)
30
+ COMPREPLY=( $(compgen -W "set clear show create-service list-service revoke-service" -- "$cur") ) ;;
31
+ init)
32
+ COMPREPLY=( $(compgen -W "--workspace --locale --all" -- "$cur") ) ;;
33
+ env)
34
+ COMPREPLY=( $(compgen -W "--org --project --locale --workspace --all" -- "$cur") ) ;;
35
+ branch)
36
+ COMPREPLY=( $(compgen -W "--locale --workspace --all" -- "$cur") ) ;;
37
+ whoami)
38
+ COMPREPLY=( $(compgen -W "--locale --workspace --all" -- "$cur") ) ;;
39
+ workspace)
40
+ COMPREPLY=( $(compgen -W "add remove list" -- "$cur") ) ;;
41
+ link)
42
+ COMPREPLY=( $(compgen -W "--org --project --env --to-project --to-env --locale --workspace --all" -- "$cur") ) ;;
43
+ unlink)
44
+ COMPREPLY=( $(compgen -W "--org --project --env --locale --workspace --all" -- "$cur") ) ;;
45
+ env-version)
46
+ COMPREPLY=( $(compgen -W "--org --project --env --locale --workspace --all" -- "$cur") ) ;;
47
+ versions)
48
+ COMPREPLY=( $(compgen -W "--org --project --env --limit --locale --workspace --all" -- "$cur") ) ;;
49
+ rollback)
50
+ COMPREPLY=( $(compgen -W "--org --project --env --version --locale --workspace --all" -- "$cur") ) ;;
51
+ snapshot)
52
+ COMPREPLY=( $(compgen -W "create list restore" -- "$cur") ) ;;
53
+ rename-env)
54
+ COMPREPLY=( $(compgen -W "--org --project --name --slug --locale --workspace --all" -- "$cur") ) ;;
55
+ completions)
56
+ COMPREPLY=( $(compgen -W "bash zsh fish" -- "$cur") ) ;;
57
+ *)
58
+ COMPREPLY=() ;;
59
+ esac
60
+ fi
61
+ }
62
+ complete -F _envshed envshed`;
63
+ }
64
+ function generateZshScript() {
65
+ return `#compdef envshed
66
+
67
+ _envshed() {
68
+ local -a commands
69
+ commands=(
70
+ 'login:Authenticate with Envshed'
71
+ 'pull:Pull secrets as .env file'
72
+ 'push:Push secrets from a .env file'
73
+ 'diff:Compare secrets between two environments'
74
+ 'import:Import secrets from a file (.env, JSON, YAML, CSV)'
75
+ 'run:Run a command with secrets injected as env vars'
76
+ 'orgs:List organizations'
77
+ 'projects:List projects in an organization'
78
+ 'envs:List environments in a project'
79
+ 'token:Manage authentication token'
80
+ 'init:Create a .envshed.json project config'
81
+ 'env:Switch the active environment'
82
+ 'branch:Show the current environment context'
83
+ 'whoami:Show the currently logged-in user'
84
+ 'workspace:Manage monorepo workspaces'
85
+ 'link:Link a secret to another project'
86
+ 'unlink:Unlink a secret from its cross-project link'
87
+ 'env-version:Check the current environment version'
88
+ 'versions:List version history for a secret'
89
+ 'rollback:Rollback a secret to a specific version'
90
+ 'snapshot:Manage environment snapshots'
91
+ 'rename-env:Rename an environment'
92
+ 'completions:Generate shell completion scripts'
93
+ )
94
+ if (( CURRENT == 2 )); then
95
+ _describe 'command' commands
96
+ else
97
+ case $words[2] in
98
+ login)
99
+ _arguments '--token[Login with an existing API token]' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target a specific workspace by path]:path:_files' '--workspace[Target a specific workspace by path]:path:_files' '-a[Run for all workspaces]' '--all[Run for all workspaces]' ;;
100
+ pull)
101
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--file[Output file path]:file:_files' '--stdout[Print to stdout]' '--force[Overwrite without checking]' '--format[Output format]:format:(env json)' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
102
+ push)
103
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--file[Input file path]:file:_files' '--force[Overwrite without checking]' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
104
+ diff)
105
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--show-values[Show actual secret values]' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
106
+ import)
107
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--format[File format]:format:(env json yaml csv)' '--force[Overwrite without confirmation]' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
108
+ run)
109
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--watch[Auto-restart on secret changes]' '--interval[Poll interval in seconds]:seconds:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
110
+ orgs)
111
+ _arguments '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
112
+ projects)
113
+ _arguments '--org[Organization slug]:slug:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
114
+ envs)
115
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
116
+ token)
117
+ local -a token_cmds
118
+ token_cmds=('set:Set API token' 'clear:Clear saved token' 'show:Show current token' 'create-service:Create a service token' 'list-service:List service tokens' 'revoke-service:Revoke a service token')
119
+ _describe 'token command' token_cmds ;;
120
+ init)
121
+ _arguments '--workspace[Set up a workspace at the given path]:path:_files' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-a[All workspaces]' '--all[All workspaces]' ;;
122
+ env)
123
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
124
+ branch)
125
+ _arguments '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
126
+ whoami)
127
+ _arguments '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
128
+ workspace)
129
+ local -a ws_cmds
130
+ ws_cmds=('add:Add a workspace' 'remove:Remove a workspace' 'list:List workspaces')
131
+ _describe 'workspace command' ws_cmds ;;
132
+ link)
133
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--to-project[Target project slug]:slug:' '--to-env[Target environment slug]:slug:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
134
+ unlink)
135
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
136
+ env-version)
137
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
138
+ versions)
139
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--limit[Maximum number of versions]:number:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
140
+ rollback)
141
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--env[Environment slug]:slug:' '--version[Target version number]:version:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
142
+ snapshot)
143
+ local -a snap_cmds
144
+ snap_cmds=('create:Create a snapshot' 'list:List snapshots' 'restore:Restore from a snapshot')
145
+ _describe 'snapshot command' snap_cmds ;;
146
+ rename-env)
147
+ _arguments '--org[Organization slug]:slug:' '--project[Project slug]:slug:' '--name[New name]:name:' '--slug[New slug]:slug:' '--locale[Locale for CLI output]:locale:(en es pt-BR)' '-w[Target workspace]:path:_files' '--workspace[Target workspace]:path:_files' '-a[All workspaces]' '--all[All workspaces]' ;;
148
+ completions)
149
+ local -a shells
150
+ shells=('bash:Bash completion script' 'zsh:Zsh completion script' 'fish:Fish completion script')
151
+ _describe 'shell' shells ;;
152
+ esac
153
+ fi
154
+ }
155
+
156
+ _envshed "$@"`;
157
+ }
158
+ function generateFishScript() {
159
+ return `# envshed completions for Fish shell
160
+ complete -c envshed -f
161
+
162
+ # Subcommands
163
+ complete -c envshed -n '__fish_use_subcommand' -a login -d 'Authenticate with Envshed'
164
+ complete -c envshed -n '__fish_use_subcommand' -a pull -d 'Pull secrets as .env file'
165
+ complete -c envshed -n '__fish_use_subcommand' -a push -d 'Push secrets from a .env file'
166
+ complete -c envshed -n '__fish_use_subcommand' -a diff -d 'Compare secrets between two environments'
167
+ complete -c envshed -n '__fish_use_subcommand' -a import -d 'Import secrets from a file (.env, JSON, YAML, CSV)'
168
+ complete -c envshed -n '__fish_use_subcommand' -a run -d 'Run a command with secrets injected as env vars'
169
+ complete -c envshed -n '__fish_use_subcommand' -a orgs -d 'List organizations'
170
+ complete -c envshed -n '__fish_use_subcommand' -a projects -d 'List projects in an organization'
171
+ complete -c envshed -n '__fish_use_subcommand' -a envs -d 'List environments in a project'
172
+ complete -c envshed -n '__fish_use_subcommand' -a token -d 'Manage authentication token'
173
+ complete -c envshed -n '__fish_use_subcommand' -a init -d 'Create a .envshed.json project config'
174
+ complete -c envshed -n '__fish_use_subcommand' -a env -d 'Switch the active environment'
175
+ complete -c envshed -n '__fish_use_subcommand' -a branch -d 'Show the current environment context'
176
+ complete -c envshed -n '__fish_use_subcommand' -a whoami -d 'Show the currently logged-in user'
177
+ complete -c envshed -n '__fish_use_subcommand' -a workspace -d 'Manage monorepo workspaces'
178
+ complete -c envshed -n '__fish_use_subcommand' -a link -d 'Link a secret to another project'
179
+ complete -c envshed -n '__fish_use_subcommand' -a unlink -d 'Unlink a secret from its cross-project link'
180
+ complete -c envshed -n '__fish_use_subcommand' -a env-version -d 'Check the current environment version'
181
+ complete -c envshed -n '__fish_use_subcommand' -a versions -d 'List version history for a secret'
182
+ complete -c envshed -n '__fish_use_subcommand' -a rollback -d 'Rollback a secret to a specific version'
183
+ complete -c envshed -n '__fish_use_subcommand' -a snapshot -d 'Manage environment snapshots'
184
+ complete -c envshed -n '__fish_use_subcommand' -a rename-env -d 'Rename an environment'
185
+ complete -c envshed -n '__fish_use_subcommand' -a completions -d 'Generate shell completion scripts'
186
+
187
+ # Global flags
188
+ complete -c envshed -l locale -d 'Locale for CLI output' -r -a 'en es pt-BR'
189
+ complete -c envshed -s w -l workspace -d 'Target a specific workspace by path' -r -F
190
+ complete -c envshed -s a -l all -d 'Run for all workspaces'
191
+
192
+ # Flags per command: login
193
+ complete -c envshed -n '__fish_seen_subcommand_from login' -l token -d 'Login with an existing API token' -r
194
+
195
+ # Flags per command: pull
196
+ complete -c envshed -n '__fish_seen_subcommand_from pull' -l org -d 'Organization slug' -r
197
+ complete -c envshed -n '__fish_seen_subcommand_from pull' -l project -d 'Project slug' -r
198
+ complete -c envshed -n '__fish_seen_subcommand_from pull' -l env -d 'Environment slug' -r
199
+ complete -c envshed -n '__fish_seen_subcommand_from pull' -l file -d 'Output file path' -r -F
200
+ complete -c envshed -n '__fish_seen_subcommand_from pull' -l stdout -d 'Print to stdout instead of file'
201
+ complete -c envshed -n '__fish_seen_subcommand_from pull' -l force -d 'Overwrite without checking for changes'
202
+ complete -c envshed -n '__fish_seen_subcommand_from pull' -l format -d 'Output format' -r -a 'env json'
203
+
204
+ # Flags per command: push
205
+ complete -c envshed -n '__fish_seen_subcommand_from push' -l org -d 'Organization slug' -r
206
+ complete -c envshed -n '__fish_seen_subcommand_from push' -l project -d 'Project slug' -r
207
+ complete -c envshed -n '__fish_seen_subcommand_from push' -l env -d 'Environment slug' -r
208
+ complete -c envshed -n '__fish_seen_subcommand_from push' -l file -d 'Input file path' -r -F
209
+ complete -c envshed -n '__fish_seen_subcommand_from push' -l force -d 'Overwrite without checking for changes'
210
+
211
+ # Flags per command: diff
212
+ complete -c envshed -n '__fish_seen_subcommand_from diff' -l org -d 'Organization slug' -r
213
+ complete -c envshed -n '__fish_seen_subcommand_from diff' -l project -d 'Project slug' -r
214
+ complete -c envshed -n '__fish_seen_subcommand_from diff' -l show-values -d 'Show actual secret values'
215
+
216
+ # Flags per command: import
217
+ complete -c envshed -n '__fish_seen_subcommand_from import' -l org -d 'Organization slug' -r
218
+ complete -c envshed -n '__fish_seen_subcommand_from import' -l project -d 'Project slug' -r
219
+ complete -c envshed -n '__fish_seen_subcommand_from import' -l env -d 'Environment slug' -r
220
+ complete -c envshed -n '__fish_seen_subcommand_from import' -l format -d 'File format' -r -a 'env json yaml csv'
221
+ complete -c envshed -n '__fish_seen_subcommand_from import' -l force -d 'Overwrite without confirmation'
222
+
223
+ # Flags per command: run
224
+ complete -c envshed -n '__fish_seen_subcommand_from run' -l org -d 'Organization slug' -r
225
+ complete -c envshed -n '__fish_seen_subcommand_from run' -l project -d 'Project slug' -r
226
+ complete -c envshed -n '__fish_seen_subcommand_from run' -l env -d 'Environment slug' -r
227
+ complete -c envshed -n '__fish_seen_subcommand_from run' -l watch -d 'Auto-restart on secret changes'
228
+ complete -c envshed -n '__fish_seen_subcommand_from run' -l interval -d 'Poll interval in seconds' -r
229
+
230
+ # Flags per command: orgs
231
+ # (global flags only)
232
+
233
+ # Flags per command: projects
234
+ complete -c envshed -n '__fish_seen_subcommand_from projects' -l org -d 'Organization slug' -r
235
+
236
+ # Flags per command: envs
237
+ complete -c envshed -n '__fish_seen_subcommand_from envs' -l org -d 'Organization slug' -r
238
+ complete -c envshed -n '__fish_seen_subcommand_from envs' -l project -d 'Project slug' -r
239
+
240
+ # Flags per command: token (subcommands)
241
+ complete -c envshed -n '__fish_seen_subcommand_from token' -a set -d 'Set API token'
242
+ complete -c envshed -n '__fish_seen_subcommand_from token' -a clear -d 'Clear saved token'
243
+ complete -c envshed -n '__fish_seen_subcommand_from token' -a show -d 'Show current token'
244
+ complete -c envshed -n '__fish_seen_subcommand_from token' -a create-service -d 'Create a service token'
245
+ complete -c envshed -n '__fish_seen_subcommand_from token' -a list-service -d 'List service tokens'
246
+ complete -c envshed -n '__fish_seen_subcommand_from token' -a revoke-service -d 'Revoke a service token'
247
+
248
+ # Flags per command: init
249
+ complete -c envshed -n '__fish_seen_subcommand_from init' -l workspace -d 'Set up a workspace at the given path' -r -F
250
+
251
+ # Flags per command: env
252
+ complete -c envshed -n '__fish_seen_subcommand_from env' -l org -d 'Organization slug' -r
253
+ complete -c envshed -n '__fish_seen_subcommand_from env' -l project -d 'Project slug' -r
254
+
255
+ # Flags per command: workspace (subcommands)
256
+ complete -c envshed -n '__fish_seen_subcommand_from workspace' -a add -d 'Add a workspace'
257
+ complete -c envshed -n '__fish_seen_subcommand_from workspace' -a remove -d 'Remove a workspace'
258
+ complete -c envshed -n '__fish_seen_subcommand_from workspace' -a list -d 'List workspaces'
259
+
260
+ # Flags per command: link
261
+ complete -c envshed -n '__fish_seen_subcommand_from link' -l org -d 'Organization slug' -r
262
+ complete -c envshed -n '__fish_seen_subcommand_from link' -l project -d 'Project slug' -r
263
+ complete -c envshed -n '__fish_seen_subcommand_from link' -l env -d 'Environment slug' -r
264
+ complete -c envshed -n '__fish_seen_subcommand_from link' -l to-project -d 'Target project slug' -r
265
+ complete -c envshed -n '__fish_seen_subcommand_from link' -l to-env -d 'Target environment slug' -r
266
+
267
+ # Flags per command: unlink
268
+ complete -c envshed -n '__fish_seen_subcommand_from unlink' -l org -d 'Organization slug' -r
269
+ complete -c envshed -n '__fish_seen_subcommand_from unlink' -l project -d 'Project slug' -r
270
+ complete -c envshed -n '__fish_seen_subcommand_from unlink' -l env -d 'Environment slug' -r
271
+
272
+ # Flags per command: env-version
273
+ complete -c envshed -n '__fish_seen_subcommand_from env-version' -l org -d 'Organization slug' -r
274
+ complete -c envshed -n '__fish_seen_subcommand_from env-version' -l project -d 'Project slug' -r
275
+ complete -c envshed -n '__fish_seen_subcommand_from env-version' -l env -d 'Environment slug' -r
276
+
277
+ # Flags per command: versions
278
+ complete -c envshed -n '__fish_seen_subcommand_from versions' -l org -d 'Organization slug' -r
279
+ complete -c envshed -n '__fish_seen_subcommand_from versions' -l project -d 'Project slug' -r
280
+ complete -c envshed -n '__fish_seen_subcommand_from versions' -l env -d 'Environment slug' -r
281
+ complete -c envshed -n '__fish_seen_subcommand_from versions' -l limit -d 'Maximum number of versions to show' -r
282
+
283
+ # Flags per command: rollback
284
+ complete -c envshed -n '__fish_seen_subcommand_from rollback' -l org -d 'Organization slug' -r
285
+ complete -c envshed -n '__fish_seen_subcommand_from rollback' -l project -d 'Project slug' -r
286
+ complete -c envshed -n '__fish_seen_subcommand_from rollback' -l env -d 'Environment slug' -r
287
+ complete -c envshed -n '__fish_seen_subcommand_from rollback' -l version -d 'Target version number' -r
288
+
289
+ # Flags per command: snapshot (subcommands)
290
+ complete -c envshed -n '__fish_seen_subcommand_from snapshot' -a create -d 'Create a snapshot'
291
+ complete -c envshed -n '__fish_seen_subcommand_from snapshot' -a list -d 'List snapshots'
292
+ complete -c envshed -n '__fish_seen_subcommand_from snapshot' -a restore -d 'Restore from a snapshot'
293
+
294
+ # Flags per command: rename-env
295
+ complete -c envshed -n '__fish_seen_subcommand_from rename-env' -l org -d 'Organization slug' -r
296
+ complete -c envshed -n '__fish_seen_subcommand_from rename-env' -l project -d 'Project slug' -r
297
+ complete -c envshed -n '__fish_seen_subcommand_from rename-env' -l name -d 'New name' -r
298
+ complete -c envshed -n '__fish_seen_subcommand_from rename-env' -l slug -d 'New slug' -r
299
+
300
+ # Flags per command: completions
301
+ complete -c envshed -n '__fish_seen_subcommand_from completions' -a bash -d 'Bash completion script'
302
+ complete -c envshed -n '__fish_seen_subcommand_from completions' -a zsh -d 'Zsh completion script'
303
+ complete -c envshed -n '__fish_seen_subcommand_from completions' -a fish -d 'Fish completion script'`;
304
+ }
305
+ function generateCompletionScript(shell) {
306
+ switch (shell.toLowerCase()) {
307
+ case "bash":
308
+ return generateBashScript();
309
+ case "zsh":
310
+ return generateZshScript();
311
+ case "fish":
312
+ return generateFishScript();
313
+ default:
314
+ return null;
315
+ }
316
+ }
317
+ export const completionsCommand = new Command("completions")
318
+ .description(t("completions.description"))
319
+ .argument("<shell>", t("completions.shellArg"))
320
+ .action((shell) => {
321
+ const script = generateCompletionScript(shell);
322
+ if (!script) {
323
+ console.error(t("completions.unknownShell", { shell }));
324
+ console.error(t("completions.supported"));
325
+ process.exit(1);
326
+ }
327
+ console.log(script);
328
+ });
329
+ //# sourceMappingURL=completions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completions.js","sourceRoot":"","sources":["../../src/commands/completions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,SAAS,kBAAkB;IACzB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0DoB,CA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B,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=completions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completions.test.d.ts","sourceRoot":"","sources":["../../src/commands/completions.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,158 @@
1
+ import { describe, it, expect, vi, beforeEach } from "vitest";
2
+ vi.mock("../i18n.js", () => ({
3
+ t: (key, opts) => (opts ? `${key}:${JSON.stringify(opts)}` : key),
4
+ }));
5
+ describe("completions command — bash", () => {
6
+ beforeEach(() => {
7
+ vi.spyOn(console, "log").mockImplementation(() => { });
8
+ vi.spyOn(console, "error").mockImplementation(() => { });
9
+ vi.spyOn(process, "exit").mockImplementation(() => {
10
+ throw new Error("process.exit");
11
+ });
12
+ });
13
+ async function runCompletions(shell) {
14
+ const { completionsCommand } = await import("./completions.js");
15
+ const { Command } = await import("commander");
16
+ const program = new Command();
17
+ program.exitOverride();
18
+ program.addCommand(completionsCommand);
19
+ await program.parseAsync(["node", "test", "completions", shell], {
20
+ from: "node",
21
+ });
22
+ return vi.mocked(console.log).mock.calls.map((c) => String(c[0]));
23
+ }
24
+ it("outputs the _envshed() function definition", async () => {
25
+ const lines = await runCompletions("bash");
26
+ const output = lines.join("\n");
27
+ expect(output).toContain("_envshed()");
28
+ });
29
+ it("registers completion with 'complete -F _envshed envshed'", async () => {
30
+ const lines = await runCompletions("bash");
31
+ const output = lines.join("\n");
32
+ expect(output).toContain("complete -F _envshed envshed");
33
+ });
34
+ it("includes all major commands in the bash completions list", async () => {
35
+ const lines = await runCompletions("bash");
36
+ const output = lines.join("\n");
37
+ for (const cmd of ["push", "pull", "run", "diff", "import", "completions", "env", "init", "login"]) {
38
+ expect(output).toContain(cmd);
39
+ }
40
+ });
41
+ it("outputs to stdout (console.log), not stderr", async () => {
42
+ await runCompletions("bash");
43
+ expect(console.log).toHaveBeenCalled();
44
+ expect(console.error).not.toHaveBeenCalled();
45
+ });
46
+ });
47
+ describe("completions command — zsh", () => {
48
+ beforeEach(() => {
49
+ vi.spyOn(console, "log").mockImplementation(() => { });
50
+ vi.spyOn(console, "error").mockImplementation(() => { });
51
+ vi.spyOn(process, "exit").mockImplementation(() => {
52
+ throw new Error("process.exit");
53
+ });
54
+ });
55
+ async function runCompletions(shell) {
56
+ const { completionsCommand } = await import("./completions.js");
57
+ const { Command } = await import("commander");
58
+ const program = new Command();
59
+ program.exitOverride();
60
+ program.addCommand(completionsCommand);
61
+ await program.parseAsync(["node", "test", "completions", shell], {
62
+ from: "node",
63
+ });
64
+ return vi.mocked(console.log).mock.calls.map((c) => String(c[0]));
65
+ }
66
+ it("outputs the '#compdef envshed' header", async () => {
67
+ const lines = await runCompletions("zsh");
68
+ const output = lines.join("\n");
69
+ expect(output).toContain("#compdef envshed");
70
+ });
71
+ it("uses _describe to list subcommand descriptions", async () => {
72
+ const lines = await runCompletions("zsh");
73
+ const output = lines.join("\n");
74
+ expect(output).toContain("_describe");
75
+ });
76
+ it("includes all major commands with their descriptions", async () => {
77
+ const lines = await runCompletions("zsh");
78
+ const output = lines.join("\n");
79
+ for (const cmd of ["push", "pull", "run", "diff", "import", "completions", "env", "init", "login"]) {
80
+ expect(output).toContain(cmd);
81
+ }
82
+ });
83
+ it("outputs to stdout (console.log), not stderr", async () => {
84
+ await runCompletions("zsh");
85
+ expect(console.log).toHaveBeenCalled();
86
+ expect(console.error).not.toHaveBeenCalled();
87
+ });
88
+ });
89
+ describe("completions command — fish", () => {
90
+ beforeEach(() => {
91
+ vi.spyOn(console, "log").mockImplementation(() => { });
92
+ vi.spyOn(console, "error").mockImplementation(() => { });
93
+ vi.spyOn(process, "exit").mockImplementation(() => {
94
+ throw new Error("process.exit");
95
+ });
96
+ });
97
+ async function runCompletions(shell) {
98
+ const { completionsCommand } = await import("./completions.js");
99
+ const { Command } = await import("commander");
100
+ const program = new Command();
101
+ program.exitOverride();
102
+ program.addCommand(completionsCommand);
103
+ await program.parseAsync(["node", "test", "completions", shell], {
104
+ from: "node",
105
+ });
106
+ return vi.mocked(console.log).mock.calls.map((c) => String(c[0]));
107
+ }
108
+ it("outputs 'complete -c envshed' lines", async () => {
109
+ const lines = await runCompletions("fish");
110
+ const output = lines.join("\n");
111
+ expect(output).toContain("complete -c envshed");
112
+ });
113
+ it("includes all major commands in the fish completions", async () => {
114
+ const lines = await runCompletions("fish");
115
+ const output = lines.join("\n");
116
+ for (const cmd of ["push", "pull", "run", "diff", "import", "completions", "env", "init", "login"]) {
117
+ expect(output).toContain(`-a ${cmd}`);
118
+ }
119
+ });
120
+ it("outputs to stdout (console.log), not stderr", async () => {
121
+ await runCompletions("fish");
122
+ expect(console.log).toHaveBeenCalled();
123
+ expect(console.error).not.toHaveBeenCalled();
124
+ });
125
+ });
126
+ describe("completions command — unknown shell", () => {
127
+ beforeEach(() => {
128
+ vi.spyOn(console, "log").mockImplementation(() => { });
129
+ vi.spyOn(console, "error").mockImplementation(() => { });
130
+ vi.spyOn(process, "exit").mockImplementation(() => {
131
+ throw new Error("process.exit");
132
+ });
133
+ });
134
+ it("exits with code 1 for an unknown shell", async () => {
135
+ const { completionsCommand } = await import("./completions.js");
136
+ const { Command } = await import("commander");
137
+ const program = new Command();
138
+ program.exitOverride();
139
+ program.addCommand(completionsCommand);
140
+ await expect(program.parseAsync(["node", "test", "completions", "powershell"], {
141
+ from: "node",
142
+ })).rejects.toThrow("process.exit");
143
+ expect(process.exit).toHaveBeenCalledWith(1);
144
+ });
145
+ it("prints an error to stderr (console.error) for an unknown shell", async () => {
146
+ const { completionsCommand } = await import("./completions.js");
147
+ const { Command } = await import("commander");
148
+ const program = new Command();
149
+ program.exitOverride();
150
+ program.addCommand(completionsCommand);
151
+ await expect(program.parseAsync(["node", "test", "completions", "nushell"], {
152
+ from: "node",
153
+ })).rejects.toThrow("process.exit");
154
+ expect(console.error).toHaveBeenCalled();
155
+ expect(console.log).not.toHaveBeenCalled();
156
+ });
157
+ });
158
+ //# sourceMappingURL=completions.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completions.test.js","sourceRoot":"","sources":["../../src/commands/completions.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE9D,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,CAAC,GAAW,EAAE,IAAU,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;CAChF,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACtD,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACxD,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE;YAChD,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,KAAK,UAAU,cAAc,CAAC,KAAa;QACzC,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAChE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;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E,KAAK,IAAI,EAAE;QAC9E,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAChE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;QAEvC,MAAM,MAAM,CACV,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE;YAC7D,IAAI,EAAE,MAAM;SACb,CAAC,CACH,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAElC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACzC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const diffCommand: Command;
3
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,eAAO,MAAM,WAAW,SAiDpB,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { Command } from "commander";
2
+ import chalk from "chalk";
3
+ import ora from "ora";
4
+ import { apiGet } from "../api.js";
5
+ import { resolveOpts, logContext, hasProjectConfig } from "../config.js";
6
+ import { t } from "../i18n.js";
7
+ import { renderDiffTable } from "../lib/diff-renderer.js";
8
+ export const diffCommand = new Command("diff")
9
+ .description(t("diff.description"))
10
+ .argument("<env1>", t("diff.env1Arg"))
11
+ .argument("<env2>", t("diff.env2Arg"))
12
+ .option("-o, --org <slug>", t("common.orgOption"))
13
+ .option("-p, --project <slug>", t("common.projectOption"))
14
+ .option("--show-values", t("diff.showValuesOption"))
15
+ .action(async (env1, env2, opts) => {
16
+ const { org, project } = resolveOpts(opts);
17
+ if (!org || !project) {
18
+ if (!hasProjectConfig() && (!opts.org || !opts.project)) {
19
+ console.error(chalk.red(t("common.noProjectConfig")));
20
+ }
21
+ else {
22
+ console.error(chalk.red(t("common.missingOrgProject")));
23
+ }
24
+ process.exit(1);
25
+ }
26
+ logContext({ org, project });
27
+ if (opts.showValues) {
28
+ console.error(chalk.yellow(t("diff.showValuesWarning")));
29
+ }
30
+ const spinner = ora(t("diff.fetching")).start();
31
+ let secretsA;
32
+ let secretsB;
33
+ try {
34
+ // Fetch both environments in parallel; abort entirely if either fails
35
+ const [resA, resB] = await Promise.all([
36
+ apiGet(`/secrets/${org}/${project}/${env1}`),
37
+ apiGet(`/secrets/${org}/${project}/${env2}`),
38
+ ]);
39
+ const [dataA, dataB] = await Promise.all([
40
+ resA.json(),
41
+ resB.json(),
42
+ ]);
43
+ secretsA = dataA.secrets;
44
+ secretsB = dataB.secrets;
45
+ }
46
+ catch (err) {
47
+ spinner.fail(t("diff.fetchFailed", { env: `${env1}/${env2}`, message: err.message }));
48
+ process.exit(1);
49
+ }
50
+ spinner.stop();
51
+ renderDiffTable(env1, env2, secretsA, secretsB, opts.showValues ?? false);
52
+ });
53
+ //# sourceMappingURL=diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,UAA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AC5E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const importCommand: Command;
3
+ //# sourceMappingURL=import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/commands/import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,eAAO,MAAM,aAAa,SAyItB,CAAC"}