killer-skills 1.6.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/CHANGELOG.md +156 -0
- package/LICENSE +21 -0
- package/README.md +360 -0
- package/dist/commands/completion.d.ts +8 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +242 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config.d.ts +24 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +132 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/create.d.ts +9 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +361 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/deps.d.ts +8 -0
- package/dist/commands/deps.d.ts.map +1 -0
- package/dist/commands/deps.js +144 -0
- package/dist/commands/deps.js.map +1 -0
- package/dist/commands/do.d.ts +13 -0
- package/dist/commands/do.d.ts.map +1 -0
- package/dist/commands/do.js +223 -0
- package/dist/commands/do.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +191 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/install.d.ts +13 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +234 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/list.d.ts +9 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +103 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/manage.d.ts +9 -0
- package/dist/commands/manage.d.ts.map +1 -0
- package/dist/commands/manage.js +132 -0
- package/dist/commands/manage.js.map +1 -0
- package/dist/commands/outdated.d.ts +9 -0
- package/dist/commands/outdated.d.ts.map +1 -0
- package/dist/commands/outdated.js +168 -0
- package/dist/commands/outdated.js.map +1 -0
- package/dist/commands/plugin.d.ts +8 -0
- package/dist/commands/plugin.d.ts.map +1 -0
- package/dist/commands/plugin.js +98 -0
- package/dist/commands/plugin.js.map +1 -0
- package/dist/commands/publish.d.ts +8 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +199 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/read.d.ts +9 -0
- package/dist/commands/read.d.ts.map +1 -0
- package/dist/commands/read.js +69 -0
- package/dist/commands/read.js.map +1 -0
- package/dist/commands/search.d.ts +8 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +105 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/stats.d.ts +16 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +137 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/submit.d.ts +9 -0
- package/dist/commands/submit.d.ts.map +1 -0
- package/dist/commands/submit.js +245 -0
- package/dist/commands/submit.js.map +1 -0
- package/dist/commands/sync.d.ts +11 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +134 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/update.d.ts +9 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +175 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/config/claude.d.ts +2 -0
- package/dist/config/claude.d.ts.map +1 -0
- package/dist/config/claude.js +19 -0
- package/dist/config/claude.js.map +1 -0
- package/dist/config/cursor.d.ts +2 -0
- package/dist/config/cursor.d.ts.map +1 -0
- package/dist/config/cursor.js +18 -0
- package/dist/config/cursor.js.map +1 -0
- package/dist/config/ides.d.ts +19 -0
- package/dist/config/ides.d.ts.map +1 -0
- package/dist/config/ides.js +221 -0
- package/dist/config/ides.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server.d.ts +11 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +264 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/registry.d.ts +8 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +34 -0
- package/dist/registry.js.map +1 -0
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/agents-md.d.ts +33 -0
- package/dist/utils/agents-md.d.ts.map +1 -0
- package/dist/utils/agents-md.js +137 -0
- package/dist/utils/agents-md.js.map +1 -0
- package/dist/utils/dependencies.d.ts +49 -0
- package/dist/utils/dependencies.d.ts.map +1 -0
- package/dist/utils/dependencies.js +141 -0
- package/dist/utils/dependencies.js.map +1 -0
- package/dist/utils/github.d.ts +58 -0
- package/dist/utils/github.d.ts.map +1 -0
- package/dist/utils/github.js +198 -0
- package/dist/utils/github.js.map +1 -0
- package/dist/utils/platform.d.ts +54 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +154 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/plugins.d.ts +50 -0
- package/dist/utils/plugins.d.ts.map +1 -0
- package/dist/utils/plugins.js +115 -0
- package/dist/utils/plugins.js.map +1 -0
- package/dist/utils/prompt-templates.d.ts +47 -0
- package/dist/utils/prompt-templates.d.ts.map +1 -0
- package/dist/utils/prompt-templates.js +160 -0
- package/dist/utils/prompt-templates.js.map +1 -0
- package/dist/utils/skill-metadata.d.ts +55 -0
- package/dist/utils/skill-metadata.d.ts.map +1 -0
- package/dist/utils/skill-metadata.js +82 -0
- package/dist/utils/skill-metadata.js.map +1 -0
- package/dist/utils/skills.d.ts +27 -0
- package/dist/utils/skills.d.ts.map +1 -0
- package/dist/utils/skills.js +163 -0
- package/dist/utils/skills.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion Command
|
|
3
|
+
*
|
|
4
|
+
* Generate shell completion scripts for bash, zsh, and fish.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
export const completionCommand = new Command('completion')
|
|
9
|
+
.description('Generate shell completion scripts')
|
|
10
|
+
.argument('<shell>', 'Shell type: bash, zsh, fish')
|
|
11
|
+
.action(async (shell) => {
|
|
12
|
+
const scripts = {
|
|
13
|
+
bash: generateBashCompletion(),
|
|
14
|
+
zsh: generateZshCompletion(),
|
|
15
|
+
fish: generateFishCompletion()
|
|
16
|
+
};
|
|
17
|
+
if (!scripts[shell]) {
|
|
18
|
+
console.error(chalk.red(`Unknown shell: ${shell}`));
|
|
19
|
+
console.log(chalk.dim('Supported shells: bash, zsh, fish'));
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
console.log(scripts[shell]);
|
|
23
|
+
});
|
|
24
|
+
function generateBashCompletion() {
|
|
25
|
+
return `# Killer-Skills bash completion
|
|
26
|
+
# Add to ~/.bashrc:
|
|
27
|
+
# source <(killer completion bash)
|
|
28
|
+
# Or save to:
|
|
29
|
+
# killer completion bash > /etc/bash_completion.d/killer
|
|
30
|
+
|
|
31
|
+
_killer_completions() {
|
|
32
|
+
local cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
33
|
+
local prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
34
|
+
|
|
35
|
+
# Main commands
|
|
36
|
+
local commands="install list create sync read update manage search publish init config completion help"
|
|
37
|
+
|
|
38
|
+
# IDE options
|
|
39
|
+
local ides="cursor windsurf vscode claude antigravity aider codex goose cline roo kiro"
|
|
40
|
+
|
|
41
|
+
case "\${prev}" in
|
|
42
|
+
killer)
|
|
43
|
+
COMPREPLY=($(compgen -W "\${commands}" -- "\${cur}"))
|
|
44
|
+
return 0
|
|
45
|
+
;;
|
|
46
|
+
install)
|
|
47
|
+
# Could add skill name completion here
|
|
48
|
+
return 0
|
|
49
|
+
;;
|
|
50
|
+
-i|--ide)
|
|
51
|
+
COMPREPLY=($(compgen -W "\${ides}" -- "\${cur}"))
|
|
52
|
+
return 0
|
|
53
|
+
;;
|
|
54
|
+
-s|--scope)
|
|
55
|
+
COMPREPLY=($(compgen -W "project global" -- "\${cur}"))
|
|
56
|
+
return 0
|
|
57
|
+
;;
|
|
58
|
+
-t|--template)
|
|
59
|
+
COMPREPLY=($(compgen -W "minimal standard full" -- "\${cur}"))
|
|
60
|
+
return 0
|
|
61
|
+
;;
|
|
62
|
+
completion)
|
|
63
|
+
COMPREPLY=($(compgen -W "bash zsh fish" -- "\${cur}"))
|
|
64
|
+
return 0
|
|
65
|
+
;;
|
|
66
|
+
*)
|
|
67
|
+
;;
|
|
68
|
+
esac
|
|
69
|
+
|
|
70
|
+
# Handle options
|
|
71
|
+
case "\${cur}" in
|
|
72
|
+
-*)
|
|
73
|
+
local opts="--help --version --ide --scope --yes --verbose"
|
|
74
|
+
COMPREPLY=($(compgen -W "\${opts}" -- "\${cur}"))
|
|
75
|
+
return 0
|
|
76
|
+
;;
|
|
77
|
+
esac
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
complete -F _killer_completions killer
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
function generateZshCompletion() {
|
|
84
|
+
return `#compdef killer
|
|
85
|
+
|
|
86
|
+
# Killer-Skills zsh completion
|
|
87
|
+
# Add to ~/.zshrc:
|
|
88
|
+
# source <(killer completion zsh)
|
|
89
|
+
# Or save to:
|
|
90
|
+
# killer completion zsh > ~/.zsh/completions/_killer
|
|
91
|
+
|
|
92
|
+
_killer() {
|
|
93
|
+
local -a commands
|
|
94
|
+
commands=(
|
|
95
|
+
'install:Install a skill from registry, GitHub, or local path'
|
|
96
|
+
'list:List all installed skills'
|
|
97
|
+
'create:Create a new skill from template'
|
|
98
|
+
'sync:Sync installed skills to AGENTS.md'
|
|
99
|
+
'read:Read skill content to stdout'
|
|
100
|
+
'update:Update installed skills from their source'
|
|
101
|
+
'manage:Interactively manage installed skills'
|
|
102
|
+
'search:Search for skills on GitHub and registry'
|
|
103
|
+
'publish:Publish a skill to GitHub or registry'
|
|
104
|
+
'init:Initialize skills configuration'
|
|
105
|
+
'config:Manage CLI configuration'
|
|
106
|
+
'completion:Generate shell completion scripts'
|
|
107
|
+
'help:Display help for command'
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
local -a ides
|
|
111
|
+
ides=(cursor windsurf vscode claude antigravity aider codex goose cline roo kiro)
|
|
112
|
+
|
|
113
|
+
local -a scopes
|
|
114
|
+
scopes=(project global)
|
|
115
|
+
|
|
116
|
+
local -a templates
|
|
117
|
+
templates=(minimal standard full)
|
|
118
|
+
|
|
119
|
+
local -a shells
|
|
120
|
+
shells=(bash zsh fish)
|
|
121
|
+
|
|
122
|
+
_arguments -C \\
|
|
123
|
+
'1: :->command' \\
|
|
124
|
+
'*: :->args' \\
|
|
125
|
+
&& return 0
|
|
126
|
+
|
|
127
|
+
case $state in
|
|
128
|
+
command)
|
|
129
|
+
_describe -t commands 'killer commands' commands
|
|
130
|
+
;;
|
|
131
|
+
args)
|
|
132
|
+
case $words[2] in
|
|
133
|
+
install)
|
|
134
|
+
_arguments \\
|
|
135
|
+
'-i[Target IDE]:ide:($ides)' \\
|
|
136
|
+
'--ide[Target IDE]:ide:($ides)' \\
|
|
137
|
+
'-s[Installation scope]:scope:($scopes)' \\
|
|
138
|
+
'--scope[Installation scope]:scope:($scopes)' \\
|
|
139
|
+
'--all[Install to all IDEs]' \\
|
|
140
|
+
'-y[Skip prompts]' \\
|
|
141
|
+
'--yes[Skip prompts]' \\
|
|
142
|
+
'*:source:_files'
|
|
143
|
+
;;
|
|
144
|
+
create)
|
|
145
|
+
_arguments \\
|
|
146
|
+
'-t[Template type]:template:($templates)' \\
|
|
147
|
+
'--template[Template type]:template:($templates)' \\
|
|
148
|
+
'-d[Description]:description:' \\
|
|
149
|
+
'--description[Description]:description:' \\
|
|
150
|
+
'-p[Path]:path:_files -/' \\
|
|
151
|
+
'--path[Path]:path:_files -/' \\
|
|
152
|
+
'--from[Clone from skill]:skill:' \\
|
|
153
|
+
'-y[Skip prompts]' \\
|
|
154
|
+
'*:name:'
|
|
155
|
+
;;
|
|
156
|
+
list)
|
|
157
|
+
_arguments \\
|
|
158
|
+
'-i[Target IDE]:ide:($ides)' \\
|
|
159
|
+
'--ide[Target IDE]:ide:($ides)' \\
|
|
160
|
+
'-v[Show verbose output]' \\
|
|
161
|
+
'--verbose[Show verbose output]'
|
|
162
|
+
;;
|
|
163
|
+
sync)
|
|
164
|
+
_arguments \\
|
|
165
|
+
'-i[Target IDE]:ide:($ides)' \\
|
|
166
|
+
'--ide[Target IDE]:ide:($ides)' \\
|
|
167
|
+
'-o[Output path]:path:_files' \\
|
|
168
|
+
'--output[Output path]:path:_files' \\
|
|
169
|
+
'-y[Skip prompts]' \\
|
|
170
|
+
'--remove[Remove skills section]'
|
|
171
|
+
;;
|
|
172
|
+
completion)
|
|
173
|
+
_describe -t shells 'shell' shells
|
|
174
|
+
;;
|
|
175
|
+
*)
|
|
176
|
+
;;
|
|
177
|
+
esac
|
|
178
|
+
;;
|
|
179
|
+
esac
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
_killer "$@"
|
|
183
|
+
`;
|
|
184
|
+
}
|
|
185
|
+
function generateFishCompletion() {
|
|
186
|
+
return `# Killer-Skills fish completion
|
|
187
|
+
# Save to: ~/.config/fish/completions/killer.fish
|
|
188
|
+
|
|
189
|
+
# Disable file completion by default
|
|
190
|
+
complete -c killer -f
|
|
191
|
+
|
|
192
|
+
# Commands
|
|
193
|
+
complete -c killer -n __fish_use_subcommand -a install -d 'Install a skill'
|
|
194
|
+
complete -c killer -n __fish_use_subcommand -a list -d 'List installed skills'
|
|
195
|
+
complete -c killer -n __fish_use_subcommand -a create -d 'Create a new skill'
|
|
196
|
+
complete -c killer -n __fish_use_subcommand -a sync -d 'Sync skills to AGENTS.md'
|
|
197
|
+
complete -c killer -n __fish_use_subcommand -a read -d 'Read skill content'
|
|
198
|
+
complete -c killer -n __fish_use_subcommand -a update -d 'Update skills'
|
|
199
|
+
complete -c killer -n __fish_use_subcommand -a manage -d 'Manage skills'
|
|
200
|
+
complete -c killer -n __fish_use_subcommand -a search -d 'Search for skills'
|
|
201
|
+
complete -c killer -n __fish_use_subcommand -a publish -d 'Publish a skill'
|
|
202
|
+
complete -c killer -n __fish_use_subcommand -a init -d 'Initialize project'
|
|
203
|
+
complete -c killer -n __fish_use_subcommand -a config -d 'Manage configuration'
|
|
204
|
+
complete -c killer -n __fish_use_subcommand -a completion -d 'Generate shell completion'
|
|
205
|
+
complete -c killer -n __fish_use_subcommand -a help -d 'Display help'
|
|
206
|
+
|
|
207
|
+
# IDEs
|
|
208
|
+
set -l ides cursor windsurf vscode claude antigravity aider codex goose cline roo kiro
|
|
209
|
+
|
|
210
|
+
# install options
|
|
211
|
+
complete -c killer -n '__fish_seen_subcommand_from install' -s i -l ide -xa "$ides" -d 'Target IDE'
|
|
212
|
+
complete -c killer -n '__fish_seen_subcommand_from install' -s s -l scope -xa 'project global' -d 'Scope'
|
|
213
|
+
complete -c killer -n '__fish_seen_subcommand_from install' -l all -d 'Install to all IDEs'
|
|
214
|
+
complete -c killer -n '__fish_seen_subcommand_from install' -s y -l yes -d 'Skip prompts'
|
|
215
|
+
|
|
216
|
+
# create options
|
|
217
|
+
complete -c killer -n '__fish_seen_subcommand_from create' -s t -l template -xa 'minimal standard full' -d 'Template'
|
|
218
|
+
complete -c killer -n '__fish_seen_subcommand_from create' -s d -l description -d 'Description'
|
|
219
|
+
complete -c killer -n '__fish_seen_subcommand_from create' -s p -l path -rF -d 'Path'
|
|
220
|
+
complete -c killer -n '__fish_seen_subcommand_from create' -l from -d 'Clone from skill'
|
|
221
|
+
complete -c killer -n '__fish_seen_subcommand_from create' -s y -l yes -d 'Skip prompts'
|
|
222
|
+
|
|
223
|
+
# list options
|
|
224
|
+
complete -c killer -n '__fish_seen_subcommand_from list' -s i -l ide -xa "$ides" -d 'Filter by IDE'
|
|
225
|
+
complete -c killer -n '__fish_seen_subcommand_from list' -s v -l verbose -d 'Verbose output'
|
|
226
|
+
|
|
227
|
+
# sync options
|
|
228
|
+
complete -c killer -n '__fish_seen_subcommand_from sync' -s i -l ide -xa "$ides" -d 'Target IDE'
|
|
229
|
+
complete -c killer -n '__fish_seen_subcommand_from sync' -s o -l output -rF -d 'Output file'
|
|
230
|
+
complete -c killer -n '__fish_seen_subcommand_from sync' -s y -l yes -d 'Skip prompts'
|
|
231
|
+
complete -c killer -n '__fish_seen_subcommand_from sync' -l remove -d 'Remove section'
|
|
232
|
+
|
|
233
|
+
# completion shell options
|
|
234
|
+
complete -c killer -n '__fish_seen_subcommand_from completion' -xa 'bash zsh fish' -d 'Shell'
|
|
235
|
+
|
|
236
|
+
# config options
|
|
237
|
+
complete -c killer -n '__fish_seen_subcommand_from config' -l list -d 'List all config'
|
|
238
|
+
complete -c killer -n '__fish_seen_subcommand_from config' -l reset -d 'Reset config'
|
|
239
|
+
complete -c killer -n '__fish_seen_subcommand_from config' -l path -d 'Show config path'
|
|
240
|
+
`;
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC;KACrD,WAAW,CAAC,mCAAmC,CAAC;KAChD,QAAQ,CAAC,SAAS,EAAE,6BAA6B,CAAC;KAClD,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;IAC5B,MAAM,OAAO,GAA2B;QACpC,IAAI,EAAE,sBAAsB,EAAE;QAC9B,GAAG,EAAE,qBAAqB,EAAE;QAC5B,IAAI,EAAE,sBAAsB,EAAE;KACjC,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,KAAK,EAAE,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC;AAEP,SAAS,sBAAsB;IAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDV,CAAC;AACF,CAAC;AAED,SAAS,qBAAqB;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGV,CAAC;AACF,CAAC;AAED,SAAS,sBAAsB;IAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDV,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config Command
|
|
3
|
+
*
|
|
4
|
+
* Manage CLI configuration settings.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
interface Config {
|
|
8
|
+
defaultIDE: string;
|
|
9
|
+
defaultScope: 'project' | 'global';
|
|
10
|
+
githubToken?: string;
|
|
11
|
+
registryUrl: string;
|
|
12
|
+
autoSync: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const configCommand: Command;
|
|
15
|
+
/**
|
|
16
|
+
* Load configuration
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadConfig(): Promise<Config>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a specific config value
|
|
21
|
+
*/
|
|
22
|
+
export declare function getConfigValue<K extends keyof Config>(key: K): Promise<Config[K]>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AASD,eAAO,MAAM,aAAa,SAsGpB,CAAC;AAEP;;GAEG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CASlD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAGvF"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config Command
|
|
3
|
+
*
|
|
4
|
+
* Manage CLI configuration settings.
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
import fs from 'fs-extra';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import os from 'os';
|
|
11
|
+
const CONFIG_DIR = path.join(os.homedir(), '.killer-skills');
|
|
12
|
+
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
13
|
+
const DEFAULT_CONFIG = {
|
|
14
|
+
defaultIDE: 'claude',
|
|
15
|
+
defaultScope: 'global',
|
|
16
|
+
registryUrl: 'https://raw.githubusercontent.com/anthropics/killer-skills/main/registry/skills.json',
|
|
17
|
+
autoSync: false
|
|
18
|
+
};
|
|
19
|
+
export const configCommand = new Command('config')
|
|
20
|
+
.description('Manage CLI configuration')
|
|
21
|
+
.argument('[key]', 'Configuration key to get/set')
|
|
22
|
+
.argument('[value]', 'Value to set')
|
|
23
|
+
.option('--list', 'List all configuration values')
|
|
24
|
+
.option('--reset', 'Reset configuration to defaults')
|
|
25
|
+
.option('--path', 'Show configuration file path')
|
|
26
|
+
.action(async (key, value, options) => {
|
|
27
|
+
try {
|
|
28
|
+
// Ensure config directory exists
|
|
29
|
+
await fs.ensureDir(CONFIG_DIR);
|
|
30
|
+
// Show path
|
|
31
|
+
if (options.path) {
|
|
32
|
+
console.log(CONFIG_FILE);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// Reset config
|
|
36
|
+
if (options.reset) {
|
|
37
|
+
await fs.writeJson(CONFIG_FILE, DEFAULT_CONFIG, { spaces: 2 });
|
|
38
|
+
console.log(chalk.green('✅ Configuration reset to defaults'));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// Load current config
|
|
42
|
+
let config;
|
|
43
|
+
if (await fs.pathExists(CONFIG_FILE)) {
|
|
44
|
+
config = { ...DEFAULT_CONFIG, ...await fs.readJson(CONFIG_FILE) };
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
config = { ...DEFAULT_CONFIG };
|
|
48
|
+
}
|
|
49
|
+
// List all
|
|
50
|
+
if (options.list || (!key && !value)) {
|
|
51
|
+
console.log(chalk.bold('\n⚙️ Killer-Skills Configuration\n'));
|
|
52
|
+
console.log(chalk.dim('─'.repeat(50)));
|
|
53
|
+
const displayConfig = {
|
|
54
|
+
'defaultIDE': config.defaultIDE,
|
|
55
|
+
'defaultScope': config.defaultScope,
|
|
56
|
+
'registryUrl': config.registryUrl,
|
|
57
|
+
'autoSync': String(config.autoSync),
|
|
58
|
+
'githubToken': config.githubToken ? '***' + config.githubToken.slice(-4) : '(not set)'
|
|
59
|
+
};
|
|
60
|
+
for (const [k, v] of Object.entries(displayConfig)) {
|
|
61
|
+
console.log(` ${chalk.cyan(k.padEnd(15))} ${v}`);
|
|
62
|
+
}
|
|
63
|
+
console.log(chalk.dim('─'.repeat(50)));
|
|
64
|
+
console.log(chalk.dim(`\nConfig file: ${CONFIG_FILE}`));
|
|
65
|
+
console.log(chalk.dim('\nUsage:'));
|
|
66
|
+
console.log(chalk.dim(' killer config <key> <value> Set a value'));
|
|
67
|
+
console.log(chalk.dim(' killer config <key> Get a value'));
|
|
68
|
+
console.log(chalk.dim(' killer config --reset Reset to defaults'));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// Get value
|
|
72
|
+
if (key && !value) {
|
|
73
|
+
const configValue = config[key];
|
|
74
|
+
if (configValue === undefined) {
|
|
75
|
+
console.log(chalk.yellow(`Unknown config key: ${key}`));
|
|
76
|
+
console.log(chalk.dim(`Available keys: ${Object.keys(DEFAULT_CONFIG).join(', ')}`));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
if (key === 'githubToken' && configValue) {
|
|
80
|
+
console.log('***' + String(configValue).slice(-4));
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
console.log(String(configValue));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
// Set value
|
|
89
|
+
if (key && value) {
|
|
90
|
+
if (!(key in DEFAULT_CONFIG)) {
|
|
91
|
+
console.log(chalk.yellow(`Unknown config key: ${key}`));
|
|
92
|
+
console.log(chalk.dim(`Available keys: ${Object.keys(DEFAULT_CONFIG).join(', ')}`));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// Type conversion
|
|
96
|
+
let typedValue = value;
|
|
97
|
+
if (value === 'true')
|
|
98
|
+
typedValue = true;
|
|
99
|
+
else if (value === 'false')
|
|
100
|
+
typedValue = false;
|
|
101
|
+
config[key] = typedValue;
|
|
102
|
+
await fs.writeJson(CONFIG_FILE, config, { spaces: 2 });
|
|
103
|
+
console.log(chalk.green(`✅ Set ${key} = ${value}`));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
console.error(chalk.red(`Error: ${error.message}`));
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* Load configuration
|
|
113
|
+
*/
|
|
114
|
+
export async function loadConfig() {
|
|
115
|
+
try {
|
|
116
|
+
if (await fs.pathExists(CONFIG_FILE)) {
|
|
117
|
+
return { ...DEFAULT_CONFIG, ...await fs.readJson(CONFIG_FILE) };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
// Ignore errors
|
|
122
|
+
}
|
|
123
|
+
return { ...DEFAULT_CONFIG };
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get a specific config value
|
|
127
|
+
*/
|
|
128
|
+
export async function getConfigValue(key) {
|
|
129
|
+
const config = await loadConfig();
|
|
130
|
+
return config[key];
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAC7D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAUzD,MAAM,cAAc,GAAW;IAC3B,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,QAAQ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,MAAM,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Command
|
|
3
|
+
*
|
|
4
|
+
* Create a new skill from template or clone from existing.
|
|
5
|
+
* Supports multiple template types for different use cases.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
export declare const createCommand: Command;
|
|
9
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4NpC,eAAO,MAAM,aAAa,SAuGpB,CAAC"}
|