aliasmate 1.6.1 → 2.0.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 (203) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +61 -876
  3. package/dist/cli/completion.d.ts +5 -0
  4. package/dist/cli/completion.d.ts.map +1 -0
  5. package/dist/cli/completion.js +144 -0
  6. package/dist/cli/completion.js.map +1 -0
  7. package/dist/cli/manage.d.ts +20 -0
  8. package/dist/cli/manage.d.ts.map +1 -0
  9. package/dist/cli/manage.js +213 -0
  10. package/dist/cli/manage.js.map +1 -0
  11. package/dist/cli/run.d.ts +6 -0
  12. package/dist/cli/run.d.ts.map +1 -0
  13. package/dist/cli/run.js +46 -0
  14. package/dist/cli/run.js.map +1 -0
  15. package/dist/cli/save.d.ts +9 -0
  16. package/dist/cli/save.d.ts.map +1 -0
  17. package/dist/cli/save.js +52 -0
  18. package/dist/cli/save.js.map +1 -0
  19. package/dist/cli/transfer.d.ts +5 -0
  20. package/dist/cli/transfer.d.ts.map +1 -0
  21. package/dist/cli/transfer.js +118 -0
  22. package/dist/cli/transfer.js.map +1 -0
  23. package/dist/core/commands.d.ts +27 -0
  24. package/dist/core/commands.d.ts.map +1 -0
  25. package/dist/core/commands.js +194 -0
  26. package/dist/core/commands.js.map +1 -0
  27. package/dist/core/env.d.ts +9 -0
  28. package/dist/core/env.d.ts.map +1 -0
  29. package/dist/core/env.js +45 -0
  30. package/dist/core/env.js.map +1 -0
  31. package/dist/core/executor.d.ts +7 -0
  32. package/dist/core/executor.d.ts.map +1 -0
  33. package/dist/{utils → core}/executor.js +10 -46
  34. package/dist/core/executor.js.map +1 -0
  35. package/dist/core/history.d.ts +11 -0
  36. package/dist/core/history.d.ts.map +1 -0
  37. package/dist/core/history.js +117 -0
  38. package/dist/core/history.js.map +1 -0
  39. package/dist/core/recent.d.ts +14 -0
  40. package/dist/core/recent.d.ts.map +1 -0
  41. package/dist/core/recent.js +54 -0
  42. package/dist/core/recent.js.map +1 -0
  43. package/dist/core/runner.d.ts +13 -0
  44. package/dist/core/runner.d.ts.map +1 -0
  45. package/dist/core/runner.js +83 -0
  46. package/dist/core/runner.js.map +1 -0
  47. package/dist/core/store.d.ts +29 -0
  48. package/dist/core/store.d.ts.map +1 -0
  49. package/dist/core/store.js +131 -0
  50. package/dist/core/store.js.map +1 -0
  51. package/dist/core/types.d.ts +29 -0
  52. package/dist/core/types.d.ts.map +1 -0
  53. package/dist/core/types.js +3 -0
  54. package/dist/core/types.js.map +1 -0
  55. package/dist/core/validate.d.ts +6 -0
  56. package/dist/core/validate.d.ts.map +1 -0
  57. package/dist/core/validate.js +139 -0
  58. package/dist/core/validate.js.map +1 -0
  59. package/dist/index.d.ts +3 -0
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.js +169 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/ui/format.d.ts +16 -0
  64. package/dist/ui/format.d.ts.map +1 -0
  65. package/dist/ui/format.js +112 -0
  66. package/dist/ui/format.js.map +1 -0
  67. package/dist/ui/interactive.d.ts +6 -0
  68. package/dist/ui/interactive.d.ts.map +1 -0
  69. package/dist/ui/interactive.js +147 -0
  70. package/dist/ui/interactive.js.map +1 -0
  71. package/dist/ui/onboarding.d.ts +3 -0
  72. package/dist/ui/onboarding.d.ts.map +1 -0
  73. package/dist/ui/onboarding.js +82 -0
  74. package/dist/ui/onboarding.js.map +1 -0
  75. package/dist/ui/prompts.d.ts +14 -0
  76. package/dist/ui/prompts.d.ts.map +1 -0
  77. package/dist/ui/prompts.js +96 -0
  78. package/dist/ui/prompts.js.map +1 -0
  79. package/dist/ui/theme.d.ts +28 -0
  80. package/dist/ui/theme.d.ts.map +1 -0
  81. package/dist/ui/theme.js +43 -0
  82. package/dist/ui/theme.js.map +1 -0
  83. package/package.json +4 -5
  84. package/dist/cli.d.ts +0 -3
  85. package/dist/cli.d.ts.map +0 -1
  86. package/dist/cli.js +0 -252
  87. package/dist/cli.js.map +0 -1
  88. package/dist/commands/alias.d.ts +0 -30
  89. package/dist/commands/alias.d.ts.map +0 -1
  90. package/dist/commands/alias.js +0 -213
  91. package/dist/commands/alias.js.map +0 -1
  92. package/dist/commands/changelog.d.ts +0 -9
  93. package/dist/commands/changelog.d.ts.map +0 -1
  94. package/dist/commands/changelog.js +0 -72
  95. package/dist/commands/changelog.js.map +0 -1
  96. package/dist/commands/completion.d.ts +0 -17
  97. package/dist/commands/completion.d.ts.map +0 -1
  98. package/dist/commands/completion.js +0 -363
  99. package/dist/commands/completion.js.map +0 -1
  100. package/dist/commands/delete.d.ts +0 -14
  101. package/dist/commands/delete.d.ts.map +0 -1
  102. package/dist/commands/delete.js +0 -54
  103. package/dist/commands/delete.js.map +0 -1
  104. package/dist/commands/edit.d.ts +0 -16
  105. package/dist/commands/edit.d.ts.map +0 -1
  106. package/dist/commands/edit.js +0 -231
  107. package/dist/commands/edit.js.map +0 -1
  108. package/dist/commands/export.d.ts +0 -23
  109. package/dist/commands/export.d.ts.map +0 -1
  110. package/dist/commands/export.js +0 -122
  111. package/dist/commands/export.js.map +0 -1
  112. package/dist/commands/import.d.ts +0 -23
  113. package/dist/commands/import.d.ts.map +0 -1
  114. package/dist/commands/import.js +0 -235
  115. package/dist/commands/import.js.map +0 -1
  116. package/dist/commands/list.d.ts +0 -25
  117. package/dist/commands/list.d.ts.map +0 -1
  118. package/dist/commands/list.js +0 -58
  119. package/dist/commands/list.js.map +0 -1
  120. package/dist/commands/prev.d.ts +0 -15
  121. package/dist/commands/prev.d.ts.map +0 -1
  122. package/dist/commands/prev.js +0 -138
  123. package/dist/commands/prev.js.map +0 -1
  124. package/dist/commands/recent.d.ts +0 -24
  125. package/dist/commands/recent.d.ts.map +0 -1
  126. package/dist/commands/recent.js +0 -132
  127. package/dist/commands/recent.js.map +0 -1
  128. package/dist/commands/run.d.ts +0 -22
  129. package/dist/commands/run.d.ts.map +0 -1
  130. package/dist/commands/run.js +0 -217
  131. package/dist/commands/run.js.map +0 -1
  132. package/dist/commands/save.d.ts +0 -17
  133. package/dist/commands/save.d.ts.map +0 -1
  134. package/dist/commands/save.js +0 -232
  135. package/dist/commands/save.js.map +0 -1
  136. package/dist/commands/search.d.ts +0 -19
  137. package/dist/commands/search.d.ts.map +0 -1
  138. package/dist/commands/search.js +0 -113
  139. package/dist/commands/search.js.map +0 -1
  140. package/dist/commands/validate.d.ts +0 -10
  141. package/dist/commands/validate.d.ts.map +0 -1
  142. package/dist/commands/validate.js +0 -162
  143. package/dist/commands/validate.js.map +0 -1
  144. package/dist/storage/index.d.ts +0 -117
  145. package/dist/storage/index.d.ts.map +0 -1
  146. package/dist/storage/index.js +0 -262
  147. package/dist/storage/index.js.map +0 -1
  148. package/dist/utils/changelog.d.ts +0 -41
  149. package/dist/utils/changelog.d.ts.map +0 -1
  150. package/dist/utils/changelog.js +0 -192
  151. package/dist/utils/changelog.js.map +0 -1
  152. package/dist/utils/constants.d.ts +0 -48
  153. package/dist/utils/constants.d.ts.map +0 -1
  154. package/dist/utils/constants.js +0 -51
  155. package/dist/utils/constants.js.map +0 -1
  156. package/dist/utils/env.d.ts +0 -64
  157. package/dist/utils/env.d.ts.map +0 -1
  158. package/dist/utils/env.js +0 -199
  159. package/dist/utils/env.js.map +0 -1
  160. package/dist/utils/errors.d.ts +0 -30
  161. package/dist/utils/errors.d.ts.map +0 -1
  162. package/dist/utils/errors.js +0 -62
  163. package/dist/utils/errors.js.map +0 -1
  164. package/dist/utils/executor.d.ts +0 -33
  165. package/dist/utils/executor.d.ts.map +0 -1
  166. package/dist/utils/executor.js.map +0 -1
  167. package/dist/utils/formatters.d.ts +0 -30
  168. package/dist/utils/formatters.d.ts.map +0 -1
  169. package/dist/utils/formatters.js +0 -188
  170. package/dist/utils/formatters.js.map +0 -1
  171. package/dist/utils/history.d.ts +0 -37
  172. package/dist/utils/history.d.ts.map +0 -1
  173. package/dist/utils/history.js +0 -179
  174. package/dist/utils/history.js.map +0 -1
  175. package/dist/utils/llm-generator.d.ts +0 -21
  176. package/dist/utils/llm-generator.d.ts.map +0 -1
  177. package/dist/utils/llm-generator.js +0 -915
  178. package/dist/utils/llm-generator.js.map +0 -1
  179. package/dist/utils/onboarding.d.ts +0 -10
  180. package/dist/utils/onboarding.d.ts.map +0 -1
  181. package/dist/utils/onboarding.js +0 -316
  182. package/dist/utils/onboarding.js.map +0 -1
  183. package/dist/utils/paths.d.ts +0 -44
  184. package/dist/utils/paths.d.ts.map +0 -1
  185. package/dist/utils/paths.js +0 -115
  186. package/dist/utils/paths.js.map +0 -1
  187. package/dist/utils/prompts.d.ts +0 -66
  188. package/dist/utils/prompts.d.ts.map +0 -1
  189. package/dist/utils/prompts.js +0 -51
  190. package/dist/utils/prompts.js.map +0 -1
  191. package/dist/utils/recent.d.ts +0 -55
  192. package/dist/utils/recent.d.ts.map +0 -1
  193. package/dist/utils/recent.js +0 -102
  194. package/dist/utils/recent.js.map +0 -1
  195. package/dist/utils/validator.d.ts +0 -56
  196. package/dist/utils/validator.d.ts.map +0 -1
  197. package/dist/utils/validator.js +0 -413
  198. package/dist/utils/validator.js.map +0 -1
  199. package/dist/utils/version-checker.d.ts +0 -29
  200. package/dist/utils/version-checker.d.ts.map +0 -1
  201. package/dist/utils/version-checker.js +0 -191
  202. package/dist/utils/version-checker.js.map +0 -1
  203. package/whats-new.json +0 -202
@@ -1,363 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.generateBashCompletion = generateBashCompletion;
7
- exports.generateZshCompletion = generateZshCompletion;
8
- exports.generateFishCompletion = generateFishCompletion;
9
- exports.completionCommand = completionCommand;
10
- const chalk_1 = __importDefault(require("chalk"));
11
- const storage_1 = require("../storage");
12
- /**
13
- * Generate bash completion script
14
- */
15
- function generateBashCompletion() {
16
- const aliases = (0, storage_1.loadAliases)();
17
- const commandNames = Object.keys(aliases);
18
- const commandList = commandNames.join(' ');
19
- return `# Bash completion for aliasmate
20
- # Source this file or add it to your ~/.bashrc:
21
- # source <(aliasmate completion bash)
22
-
23
- _aliasmate_completion() {
24
- local cur prev opts base
25
- COMPREPLY=()
26
- cur="\${COMP_WORDS[COMP_CWORD]}"
27
- prev="\${COMP_WORDS[COMP_CWORD-1]}"
28
-
29
- # Main commands
30
- local commands="prev run save list ls search find recent delete rm edit export import changelog alias validate config completion"
31
-
32
- # Saved command names
33
- local saved_commands="${commandList}"
34
-
35
- # Options for specific commands
36
- case "\${COMP_WORDS[1]}" in
37
- run)
38
- case "\${prev}" in
39
- run)
40
- COMPREPLY=( $(compgen -W "\${saved_commands}" -- \${cur}) )
41
- return 0
42
- ;;
43
- --format)
44
- COMPREPLY=( $(compgen -W "table json yaml compact" -- \${cur}) )
45
- return 0
46
- ;;
47
- *)
48
- if [[ \${cur} == -* ]] ; then
49
- COMPREPLY=( $(compgen -W "--dry-run --verbose" -- \${cur}) )
50
- return 0
51
- else
52
- COMPREPLY=( $(compgen -d -- \${cur}) )
53
- return 0
54
- fi
55
- ;;
56
- esac
57
- ;;
58
- list|ls)
59
- case "\${prev}" in
60
- --format)
61
- COMPREPLY=( $(compgen -W "table json yaml compact" -- \${cur}) )
62
- return 0
63
- ;;
64
- *)
65
- if [[ \${cur} == -* ]] ; then
66
- COMPREPLY=( $(compgen -W "--format" -- \${cur}) )
67
- return 0
68
- fi
69
- ;;
70
- esac
71
- ;;
72
- export)
73
- case "\${prev}" in
74
- --format)
75
- COMPREPLY=( $(compgen -W "json yaml" -- \${cur}) )
76
- return 0
77
- ;;
78
- export)
79
- COMPREPLY=( $(compgen -f -- \${cur}) )
80
- return 0
81
- ;;
82
- *)
83
- if [[ \${cur} == -* ]] ; then
84
- COMPREPLY=( $(compgen -W "--format" -- \${cur}) )
85
- return 0
86
- fi
87
- ;;
88
- esac
89
- ;;
90
- import)
91
- case "\${prev}" in
92
- import)
93
- COMPREPLY=( $(compgen -f -- \${cur}) )
94
- return 0
95
- ;;
96
- esac
97
- ;;
98
- delete|rm|edit|validate|prev)
99
- case "\${prev}" in
100
- delete|rm|edit|validate|prev)
101
- COMPREPLY=( $(compgen -W "\${saved_commands}" -- \${cur}) )
102
- return 0
103
- ;;
104
- esac
105
- ;;
106
- alias)
107
- case "\${prev}" in
108
- alias)
109
- if [[ \${cur} == -* ]] ; then
110
- COMPREPLY=( $(compgen -W "--list --remove" -- \${cur}) )
111
- return 0
112
- fi
113
- ;;
114
- --remove)
115
- # Get aliases from storage
116
- COMPREPLY=( $(compgen -W "\${saved_commands}" -- \${cur}) )
117
- return 0
118
- ;;
119
- esac
120
- ;;
121
- recent)
122
- case "\${prev}" in
123
- --limit)
124
- return 0
125
- ;;
126
- *)
127
- if [[ \${cur} == -* ]] ; then
128
- COMPREPLY=( $(compgen -W "--limit --clear" -- \${cur}) )
129
- return 0
130
- fi
131
- ;;
132
- esac
133
- ;;
134
- save)
135
- if [[ \${cur} == -* ]] ; then
136
- COMPREPLY=( $(compgen -W "--no-validate" -- \${cur}) )
137
- return 0
138
- fi
139
- ;;
140
- completion)
141
- case "\${prev}" in
142
- completion)
143
- COMPREPLY=( $(compgen -W "bash zsh fish" -- \${cur}) )
144
- return 0
145
- ;;
146
- esac
147
- ;;
148
- *)
149
- COMPREPLY=( $(compgen -W "\${commands}" -- \${cur}) )
150
- return 0
151
- ;;
152
- esac
153
- }
154
-
155
- complete -F _aliasmate_completion aliasmate
156
- `;
157
- }
158
- /**
159
- * Generate zsh completion script
160
- */
161
- function generateZshCompletion() {
162
- const aliases = (0, storage_1.loadAliases)();
163
- const commandNames = Object.keys(aliases);
164
- const commandList = commandNames.map((name) => `'${name}'`).join(' ');
165
- return `#compdef aliasmate
166
- # Zsh completion for aliasmate
167
- # Add this file to your fpath or add to ~/.zshrc:
168
- # source <(aliasmate completion zsh)
169
-
170
- _aliasmate() {
171
- local line state
172
-
173
- _arguments -C \\
174
- "1: :->cmds" \\
175
- "*::arg:->args"
176
-
177
- case "$state" in
178
- cmds)
179
- _values 'commands' \\
180
- 'prev[Save previous command from history]' \\
181
- 'run[Run a saved command]' \\
182
- 'save[Interactively save a command]' \\
183
- 'list[List all saved commands]' \\
184
- 'ls[List all saved commands]' \\
185
- 'search[Search for commands]' \\
186
- 'find[Search for commands]' \\
187
- 'recent[Show recently executed commands]' \\
188
- 'delete[Delete a saved command]' \\
189
- 'rm[Delete a saved command]' \\
190
- 'edit[Edit a saved command]' \\
191
- 'export[Export commands to file]' \\
192
- 'import[Import commands from file]' \\
193
- 'changelog[View version changelog]' \\
194
- 'alias[Create, list, or remove aliases]' \\
195
- 'validate[Validate command(s)]' \\
196
- 'config[Show config file location]' \\
197
- 'completion[Generate shell completion script]'
198
- ;;
199
- args)
200
- case "$line[1]" in
201
- run)
202
- _arguments \\
203
- '1:command name:(${commandList})' \\
204
- '2:path:_files -/' \\
205
- '--dry-run[Preview without executing]' \\
206
- '--verbose[Show detailed information]'
207
- ;;
208
- list|ls)
209
- _arguments \\
210
- '--format[Output format]:format:(table json yaml compact)'
211
- ;;
212
- export)
213
- _arguments \\
214
- '1:file:_files' \\
215
- '--format[Output format]:format:(json yaml)'
216
- ;;
217
- import)
218
- _arguments \\
219
- '1:file:_files'
220
- ;;
221
- delete|rm|edit|validate|prev)
222
- _arguments \\
223
- "1:command name:(${commandList})"
224
- ;;
225
- search|find)
226
- _arguments \\
227
- '1:query:'
228
- ;;
229
- alias)
230
- _arguments \\
231
- '1:alias name:' \\
232
- '2:command name:(${commandList})' \\
233
- '--list[List all aliases]' \\
234
- '--remove[Remove an alias]:alias:(${commandList})'
235
- ;;
236
- recent)
237
- _arguments \\
238
- '--limit[Maximum number to display]:limit:' \\
239
- '--clear[Clear execution history]'
240
- ;;
241
- save)
242
- _arguments \\
243
- '--no-validate[Skip validation checks]'
244
- ;;
245
- completion)
246
- _arguments \\
247
- '1:shell:(bash zsh fish)'
248
- ;;
249
- esac
250
- ;;
251
- esac
252
- }
253
-
254
- compdef _aliasmate aliasmate
255
- `;
256
- }
257
- /**
258
- * Generate fish completion script
259
- */
260
- function generateFishCompletion() {
261
- const aliases = (0, storage_1.loadAliases)();
262
- const commandNames = Object.keys(aliases);
263
- const commandCompletions = commandNames
264
- .map((name) => `complete -c aliasmate -n "__fish_seen_subcommand_from run delete rm edit validate prev" -a "${name}"`)
265
- .join('\n');
266
- return `# Fish completion for aliasmate
267
- # Save this to ~/.config/fish/completions/aliasmate.fish or add to your config:
268
- # aliasmate completion fish > ~/.config/fish/completions/aliasmate.fish
269
-
270
- # Disable file completion by default
271
- complete -c aliasmate -f
272
-
273
- # Main commands
274
- complete -c aliasmate -n "__fish_use_subcommand" -a "prev" -d "Save previous command from history"
275
- complete -c aliasmate -n "__fish_use_subcommand" -a "run" -d "Run a saved command"
276
- complete -c aliasmate -n "__fish_use_subcommand" -a "save" -d "Interactively save a command"
277
- complete -c aliasmate -n "__fish_use_subcommand" -a "list" -d "List all saved commands"
278
- complete -c aliasmate -n "__fish_use_subcommand" -a "ls" -d "List all saved commands"
279
- complete -c aliasmate -n "__fish_use_subcommand" -a "search" -d "Search for commands"
280
- complete -c aliasmate -n "__fish_use_subcommand" -a "find" -d "Search for commands"
281
- complete -c aliasmate -n "__fish_use_subcommand" -a "recent" -d "Show recently executed commands"
282
- complete -c aliasmate -n "__fish_use_subcommand" -a "delete" -d "Delete a saved command"
283
- complete -c aliasmate -n "__fish_use_subcommand" -a "rm" -d "Delete a saved command"
284
- complete -c aliasmate -n "__fish_use_subcommand" -a "edit" -d "Edit a saved command"
285
- complete -c aliasmate -n "__fish_use_subcommand" -a "export" -d "Export commands to file"
286
- complete -c aliasmate -n "__fish_use_subcommand" -a "import" -d "Import commands from file"
287
- complete -c aliasmate -n "__fish_use_subcommand" -a "changelog" -d "View version changelog"
288
- complete -c aliasmate -n "__fish_use_subcommand" -a "alias" -d "Create, list, or remove aliases"
289
- complete -c aliasmate -n "__fish_use_subcommand" -a "validate" -d "Validate command(s)"
290
- complete -c aliasmate -n "__fish_use_subcommand" -a "config" -d "Show config file location"
291
- complete -c aliasmate -n "__fish_use_subcommand" -a "completion" -d "Generate shell completion script"
292
-
293
- # Saved command completions
294
- ${commandCompletions}
295
-
296
- # run command options
297
- complete -c aliasmate -n "__fish_seen_subcommand_from run" -l dry-run -d "Preview without executing"
298
- complete -c aliasmate -n "__fish_seen_subcommand_from run" -l verbose -d "Show detailed information"
299
-
300
- # list/ls command options
301
- complete -c aliasmate -n "__fish_seen_subcommand_from list ls" -l format -d "Output format" -a "table json yaml compact"
302
-
303
- # export command options
304
- complete -c aliasmate -n "__fish_seen_subcommand_from export" -l format -d "Output format" -a "json yaml"
305
-
306
- # alias command options
307
- complete -c aliasmate -n "__fish_seen_subcommand_from alias" -l list -d "List all aliases"
308
- complete -c aliasmate -n "__fish_seen_subcommand_from alias" -l remove -d "Remove an alias"
309
-
310
- # recent command options
311
- complete -c aliasmate -n "__fish_seen_subcommand_from recent" -l limit -d "Maximum number to display"
312
- complete -c aliasmate -n "__fish_seen_subcommand_from recent" -l clear -d "Clear execution history"
313
-
314
- # save command options
315
- complete -c aliasmate -n "__fish_seen_subcommand_from save" -l no-validate -d "Skip validation checks"
316
-
317
- # validate command options
318
- complete -c aliasmate -n "__fish_seen_subcommand_from validate" -l all -d "Validate all saved commands"
319
-
320
- # completion command shell types
321
- complete -c aliasmate -n "__fish_seen_subcommand_from completion" -a "bash zsh fish" -d "Shell type"
322
-
323
- # File completions for import/export
324
- complete -c aliasmate -n "__fish_seen_subcommand_from import export" -F
325
- `;
326
- }
327
- /**
328
- * Display completion script for specified shell
329
- */
330
- function completionCommand(shell) {
331
- if (!shell) {
332
- console.log(chalk_1.default.yellow('Usage: aliasmate completion <shell>'));
333
- console.log(chalk_1.default.gray('\nAvailable shells:'));
334
- console.log(chalk_1.default.gray(' bash - Generate bash completion script'));
335
- console.log(chalk_1.default.gray(' zsh - Generate zsh completion script'));
336
- console.log(chalk_1.default.gray(' fish - Generate fish completion script'));
337
- console.log(chalk_1.default.gray('\nExamples:'));
338
- console.log(chalk_1.default.cyan(' # Bash'));
339
- console.log(chalk_1.default.gray(' source <(aliasmate completion bash)'));
340
- console.log(chalk_1.default.cyan('\n # Zsh'));
341
- console.log(chalk_1.default.gray(' source <(aliasmate completion zsh)'));
342
- console.log(chalk_1.default.cyan('\n # Fish'));
343
- console.log(chalk_1.default.gray(' aliasmate completion fish > ~/.config/fish/completions/aliasmate.fish'));
344
- return;
345
- }
346
- const normalizedShell = shell.toLowerCase();
347
- switch (normalizedShell) {
348
- case 'bash':
349
- console.log(generateBashCompletion());
350
- break;
351
- case 'zsh':
352
- console.log(generateZshCompletion());
353
- break;
354
- case 'fish':
355
- console.log(generateFishCompletion());
356
- break;
357
- default:
358
- console.error(chalk_1.default.red(`Error: Unsupported shell "${shell}"`));
359
- console.log(chalk_1.default.yellow('Supported shells: bash, zsh, fish'));
360
- process.exit(1);
361
- }
362
- }
363
- //# sourceMappingURL=completion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":";;;;;AAMA,wDA+IC;AAKD,sDAgGC;AAKD,wDAsEC;AAKD,8CAoCC;AA9WD,kDAA0B;AAC1B,wCAAyC;AAEzC;;GAEG;AACH,SAAgB,sBAAsB;IACpC,MAAM,OAAO,GAAG,IAAA,qBAAW,GAAE,CAAC;IAC9B,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE3C,OAAO;;;;;;;;;;;;;;4BAcmB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2HtC,CAAC;AACF,CAAC;AAED;;GAEG;AACH,SAAgB,qBAAqB;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,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Delete a saved command by name
3
- *
4
- * @param name - The name of the command to delete
5
- *
6
- * @example
7
- * ```
8
- * // Delete a command
9
- * deleteCommand('old-build');
10
- * // Output: ✓ Deleted command "old-build"
11
- * ```
12
- */
13
- export declare function deleteCommand(name: string): void;
14
- //# sourceMappingURL=delete.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAgChD"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deleteCommand = deleteCommand;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const storage_1 = require("../storage");
9
- const errors_1 = require("../utils/errors");
10
- const constants_1 = require("../utils/constants");
11
- /**
12
- * Delete a saved command by name
13
- *
14
- * @param name - The name of the command to delete
15
- *
16
- * @example
17
- * ```
18
- * // Delete a command
19
- * deleteCommand('old-build');
20
- * // Output: ✓ Deleted command "old-build"
21
- * ```
22
- */
23
- function deleteCommand(name) {
24
- try {
25
- // Validate command name
26
- if (!name || !name.trim()) {
27
- (0, errors_1.exitWithError)('Command name cannot be empty', errors_1.ExitCode.InvalidInput);
28
- }
29
- // Check if alias exists
30
- const alias = (0, storage_1.getAlias)(name);
31
- if (!alias) {
32
- console.error(chalk_1.default.red(`Error: ${constants_1.ERROR_MESSAGES.commandNotFound(name)}`));
33
- console.log(chalk_1.default.yellow(constants_1.HELP_MESSAGES.useList));
34
- process.exit(errors_1.ExitCode.InvalidInput);
35
- }
36
- // Show what will be deleted
37
- console.log(chalk_1.default.yellow(`About to delete:`));
38
- console.log(chalk_1.default.gray(` Name: ${name}`));
39
- console.log(chalk_1.default.gray(` Command: ${alias.command}`));
40
- console.log(chalk_1.default.gray(` Directory: ${alias.directory}\n`));
41
- // Delete the alias
42
- const success = (0, storage_1.deleteAlias)(name);
43
- if (success) {
44
- console.log(chalk_1.default.green(`✓ ${constants_1.SUCCESS_MESSAGES.deleted(name)}`));
45
- }
46
- else {
47
- (0, errors_1.exitWithError)(constants_1.ERROR_MESSAGES.couldNotDelete);
48
- }
49
- }
50
- catch (error) {
51
- (0, errors_1.handleError)(error, 'Failed to delete command');
52
- }
53
- }
54
- //# sourceMappingURL=delete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":";;;;;AAiBA,sCAgCC;AAjDD,kDAA0B;AAC1B,wCAAmD;AACnD,4CAAuE;AACvE,kDAAqF;AAErF;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,IAAI,CAAC;QACH,wBAAwB;QACxB,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YAC1B,IAAA,sBAAa,EAAC,8BAA8B,EAAE,iBAAQ,CAAC,YAAY,CAAC,CAAC;QACvE,CAAC;QAED,wBAAwB;QACxB,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,UAAU,0BAAc,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3E,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,yBAAa,CAAC,OAAO,CAAC,CAAC,CAAC;YACjD,OAAO,CAAC,IAAI,CAAC,iBAAQ,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC;QAED,4BAA4B;QAC5B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,cAAc,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC;QAE7D,mBAAmB;QACnB,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,IAAI,CAAC,CAAC;QAElC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,4BAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAClE,CAAC;aAAM,CAAC;YACN,IAAA,sBAAa,EAAC,0BAAc,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAA,oBAAW,EAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Edit an existing command interactively
3
- *
4
- * @param name - The name of the command to edit
5
- * @param shouldValidate - Whether to validate the command (defaults to true)
6
- *
7
- * @example
8
- * ```
9
- * // User is prompted to update:
10
- * // - Command (pre-filled with current value)
11
- * // - Working directory (pre-filled with current value)
12
- * await editCommand('build-prod');
13
- * ```
14
- */
15
- export declare function editCommand(name: string, shouldValidate?: boolean): Promise<void>;
16
- //# sourceMappingURL=edit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/commands/edit.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,GAAE,OAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAgP7F"}