@codemcp/agentskills-cli 0.0.5

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 (46) hide show
  1. package/LICENSE +19 -0
  2. package/dist/__tests__/cli.test.d.ts +2 -0
  3. package/dist/__tests__/cli.test.d.ts.map +1 -0
  4. package/dist/__tests__/cli.test.js +210 -0
  5. package/dist/__tests__/cli.test.js.map +1 -0
  6. package/dist/cli.d.ts +6 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +66 -0
  9. package/dist/cli.js.map +1 -0
  10. package/dist/commands/__tests__/add.test.d.ts +2 -0
  11. package/dist/commands/__tests__/add.test.d.ts.map +1 -0
  12. package/dist/commands/__tests__/add.test.js +363 -0
  13. package/dist/commands/__tests__/add.test.js.map +1 -0
  14. package/dist/commands/__tests__/install.test.d.ts +2 -0
  15. package/dist/commands/__tests__/install.test.d.ts.map +1 -0
  16. package/dist/commands/__tests__/install.test.js +587 -0
  17. package/dist/commands/__tests__/install.test.js.map +1 -0
  18. package/dist/commands/__tests__/list.test.d.ts +2 -0
  19. package/dist/commands/__tests__/list.test.d.ts.map +1 -0
  20. package/dist/commands/__tests__/list.test.js +69 -0
  21. package/dist/commands/__tests__/list.test.js.map +1 -0
  22. package/dist/commands/__tests__/validate.test.d.ts +2 -0
  23. package/dist/commands/__tests__/validate.test.d.ts.map +1 -0
  24. package/dist/commands/__tests__/validate.test.js +858 -0
  25. package/dist/commands/__tests__/validate.test.js.map +1 -0
  26. package/dist/commands/add.d.ts +28 -0
  27. package/dist/commands/add.d.ts.map +1 -0
  28. package/dist/commands/add.js +65 -0
  29. package/dist/commands/add.js.map +1 -0
  30. package/dist/commands/install.d.ts +16 -0
  31. package/dist/commands/install.d.ts.map +1 -0
  32. package/dist/commands/install.js +125 -0
  33. package/dist/commands/install.js.map +1 -0
  34. package/dist/commands/list.d.ts +4 -0
  35. package/dist/commands/list.d.ts.map +1 -0
  36. package/dist/commands/list.js +41 -0
  37. package/dist/commands/list.js.map +1 -0
  38. package/dist/commands/validate.d.ts +26 -0
  39. package/dist/commands/validate.d.ts.map +1 -0
  40. package/dist/commands/validate.js +244 -0
  41. package/dist/commands/validate.js.map +1 -0
  42. package/dist/index.d.ts +2 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +10 -0
  45. package/dist/index.js.map +1 -0
  46. package/package.json +57 -0
package/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cli.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/cli.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,210 @@
1
+ import { describe, it, expect, beforeEach, vi, afterEach } from "vitest";
2
+ import { Command } from "commander";
3
+ import { createCLI } from "../cli.js";
4
+ describe("CLI Framework", () => {
5
+ let program;
6
+ let consoleErrorSpy;
7
+ let processExitSpy;
8
+ beforeEach(() => {
9
+ program = createCLI();
10
+ consoleErrorSpy = vi.spyOn(console, "error").mockImplementation(() => { });
11
+ processExitSpy = vi
12
+ .spyOn(process, "exit")
13
+ .mockImplementation((() => { }));
14
+ });
15
+ afterEach(() => {
16
+ consoleErrorSpy.mockRestore();
17
+ processExitSpy.mockRestore();
18
+ });
19
+ describe("Program Initialization", () => {
20
+ it("should create a Commander program instance", () => {
21
+ expect(program).toBeInstanceOf(Command);
22
+ });
23
+ it('should set program name to "agentskills"', () => {
24
+ expect(program.name()).toBe("agentskills");
25
+ });
26
+ it("should set program version from package.json", () => {
27
+ const version = program.version();
28
+ expect(version).toBeDefined();
29
+ expect(version).toMatch(/^\d+\.\d+\.\d+/); // Semantic versioning pattern
30
+ });
31
+ it("should have a description", () => {
32
+ const description = program.description();
33
+ expect(description).toBeDefined();
34
+ expect(description.length).toBeGreaterThan(0);
35
+ });
36
+ });
37
+ describe("Command Registration", () => {
38
+ it('should register "list" command', () => {
39
+ const commands = program.commands;
40
+ const listCommand = commands.find((cmd) => cmd.name() === "list");
41
+ expect(listCommand).toBeDefined();
42
+ });
43
+ it('should register "install" command', () => {
44
+ const commands = program.commands;
45
+ const installCommand = commands.find((cmd) => cmd.name() === "install");
46
+ expect(installCommand).toBeDefined();
47
+ });
48
+ it('should register "add" command', () => {
49
+ const commands = program.commands;
50
+ const addCommand = commands.find((cmd) => cmd.name() === "add");
51
+ expect(addCommand).toBeDefined();
52
+ });
53
+ it("should have exactly 3 commands registered", () => {
54
+ expect(program.commands).toHaveLength(3);
55
+ });
56
+ });
57
+ describe("List Command", () => {
58
+ let listCommand;
59
+ beforeEach(() => {
60
+ listCommand = program.commands.find((cmd) => cmd.name() === "list");
61
+ });
62
+ it("should have description", () => {
63
+ expect(listCommand.description()).toBeDefined();
64
+ expect(listCommand.description().length).toBeGreaterThan(0);
65
+ });
66
+ });
67
+ describe("Help Output", () => {
68
+ it("should display help when --help flag is used", () => {
69
+ const helpText = program.helpInformation();
70
+ expect(helpText).toContain("agentskills");
71
+ expect(helpText).toContain("list");
72
+ expect(helpText).toContain("install");
73
+ expect(helpText).toContain("add");
74
+ });
75
+ it("should show version in help output", () => {
76
+ const helpText = program.helpInformation();
77
+ expect(helpText).toContain("--version");
78
+ });
79
+ it("should show help option in help output", () => {
80
+ const helpText = program.helpInformation();
81
+ expect(helpText).toContain("--help");
82
+ });
83
+ it("should include command descriptions in help", () => {
84
+ const helpText = program.helpInformation();
85
+ const commands = program.commands;
86
+ commands.forEach((cmd) => {
87
+ if (cmd.description()) {
88
+ expect(helpText).toContain(cmd.name());
89
+ }
90
+ });
91
+ });
92
+ });
93
+ describe("Command-Specific Help", () => {
94
+ it("should provide help for list command", () => {
95
+ const listCommand = program.commands.find((cmd) => cmd.name() === "list");
96
+ const helpText = listCommand.helpInformation();
97
+ expect(helpText).toContain("list");
98
+ });
99
+ it("should provide help for install command", () => {
100
+ const installCommand = program.commands.find((cmd) => cmd.name() === "install");
101
+ const helpText = installCommand.helpInformation();
102
+ expect(helpText).toContain("install");
103
+ });
104
+ it("should provide help for add command", () => {
105
+ const addCommand = program.commands.find((cmd) => cmd.name() === "add");
106
+ const helpText = addCommand.helpInformation();
107
+ expect(helpText).toContain("add");
108
+ });
109
+ });
110
+ describe("Version Command", () => {
111
+ it("should output version with --version flag", () => {
112
+ const version = program.version();
113
+ expect(version).toBeDefined();
114
+ expect(typeof version).toBe("string");
115
+ });
116
+ it("should match semantic versioning format", () => {
117
+ const version = program.version();
118
+ expect(version).toMatch(/^\d+\.\d+\.\d+/);
119
+ });
120
+ });
121
+ describe("Error Handling", () => {
122
+ it("should handle unknown command gracefully", async () => {
123
+ // Commander will handle unknown commands by default
124
+ // We just need to ensure the program is configured properly
125
+ const commands = program.commands.map((cmd) => cmd.name());
126
+ expect(commands).not.toContain("unknown-command");
127
+ });
128
+ it("should have error handling configured", () => {
129
+ // Check that program has exitOverride disabled (default behavior)
130
+ // This allows proper error handling
131
+ expect(program.configureOutput).toBeDefined();
132
+ });
133
+ it("should allow custom error handlers to be registered", () => {
134
+ const errorHandler = vi.fn();
135
+ program.exitOverride(errorHandler);
136
+ expect(program.exitOverride).toBeDefined();
137
+ });
138
+ });
139
+ describe("Global Options", () => {
140
+ it("should support --help option", () => {
141
+ const options = program.options;
142
+ const helpOption = options.find((opt) => opt.long === "--help" || opt.short === "-h");
143
+ expect(helpOption).toBeDefined();
144
+ });
145
+ it("should support --version option", () => {
146
+ const options = program.options;
147
+ const versionOption = options.find((opt) => opt.long === "--version" || opt.short === "-V");
148
+ expect(versionOption).toBeDefined();
149
+ });
150
+ });
151
+ describe("Command Parsing", () => {
152
+ it("should parse list command", async () => {
153
+ const mockAction = vi.fn();
154
+ const listCommand = program.commands.find((cmd) => cmd.name() === "list");
155
+ listCommand.action(mockAction);
156
+ await program.parseAsync(["node", "agentskills", "list"]);
157
+ expect(mockAction).toHaveBeenCalled();
158
+ });
159
+ });
160
+ describe("Option Parsing", () => {
161
+ // All option parsing tests for implemented commands are in their respective command test files
162
+ it("should have options configured for commands", () => {
163
+ program.commands.forEach((cmd) => {
164
+ expect(cmd.options).toBeDefined();
165
+ });
166
+ });
167
+ });
168
+ describe("Exit Codes", () => {
169
+ it("should configure proper exit behavior", () => {
170
+ // Commander handles exit codes by default
171
+ // We verify the program is properly configured
172
+ expect(program.exitOverride).toBeDefined();
173
+ });
174
+ it("should allow overriding exit behavior for testing", () => {
175
+ const mockExit = vi.fn();
176
+ program.exitOverride(mockExit);
177
+ // This configuration allows us to test exit codes without actually exiting
178
+ expect(mockExit).toBeDefined();
179
+ });
180
+ });
181
+ describe("Integration Tests", () => {
182
+ it("should handle complete list command flow", async () => {
183
+ const mockAction = vi.fn();
184
+ const listCommand = program.commands.find((cmd) => cmd.name() === "list");
185
+ listCommand.action(mockAction);
186
+ await program.parseAsync(["node", "agentskills", "list"]);
187
+ expect(mockAction).toHaveBeenCalled();
188
+ });
189
+ });
190
+ describe("Command Aliases", () => {
191
+ it("should support aliases if configured", () => {
192
+ // Check if any commands have aliases
193
+ program.commands.forEach((cmd) => {
194
+ // Aliases are optional, just verify the API is available
195
+ expect(cmd.aliases).toBeDefined();
196
+ });
197
+ });
198
+ });
199
+ describe("Output Configuration", () => {
200
+ it("should allow custom output configuration", () => {
201
+ expect(program.configureOutput).toBeDefined();
202
+ // Test that we can configure output
203
+ program.configureOutput({
204
+ writeOut: (str) => console.log(str),
205
+ writeErr: (str) => console.error(str)
206
+ });
207
+ });
208
+ });
209
+ });
210
+ //# sourceMappingURL=cli.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.test.js","sourceRoot":"","sources":["../../src/__tests__/cli.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,OAAgB,CAAC;IACrB,IAAI,eAA4C,CAAC;IACjD,IAAI,cAAmB,CAAC;IAExB,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,GAAG,SAAS,EAAE,CAAC;QACtB,eAAe,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC1E,cAAc,GAAG,EAAE;aAChB,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;aACtB,kBAAkB,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAQ,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,CAAC,WAAW,EAAE,CAA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AC,UAAU,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;YAE1D,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,qCAAqC;YACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC/B,yDAAyD;gBACzD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,CAAC;YAE9C,oCAAoC;YACpC,OAAO,CAAC,eAAe,CAAC;gBACtB,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;gBACnC,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;aACtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * Creates the main CLI program
4
+ */
5
+ export declare function createCLI(): Command;
6
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAmEnC"}
package/dist/cli.js ADDED
@@ -0,0 +1,66 @@
1
+ import { Command } from "commander";
2
+ import { installCommand } from "./commands/install.js";
3
+ import { addCommand } from "./commands/add.js";
4
+ import { listCommand } from "./commands/list.js";
5
+ /**
6
+ * Creates the main CLI program
7
+ */
8
+ export function createCLI() {
9
+ // Create main program
10
+ const program = new Command();
11
+ // Set program metadata
12
+ program
13
+ .name("agentskills")
14
+ .version("0.1.0")
15
+ .description("Agent Skills CLI for managing skills")
16
+ .option("-h, --help", "Display help for command");
17
+ // Create "list" command
18
+ const listCommandDef = new Command("list")
19
+ .description("List all configured skills")
20
+ .action(async () => {
21
+ try {
22
+ const output = await listCommand();
23
+ console.log(output);
24
+ }
25
+ catch (error) {
26
+ console.error(error instanceof Error ? error.message : String(error));
27
+ process.exit(1);
28
+ }
29
+ });
30
+ // Create "install" command
31
+ const installCommandDef = new Command("install")
32
+ .description("Install skills from package.json")
33
+ .action(async () => {
34
+ try {
35
+ await installCommand({ cwd: process.cwd() });
36
+ }
37
+ catch (error) {
38
+ console.error(error instanceof Error ? error.message : String(error));
39
+ process.exit(1);
40
+ }
41
+ });
42
+ // Create "add" command
43
+ const addCommandDef = new Command("add")
44
+ .description("Add a skill to package.json and install it")
45
+ .argument("<name>", "Skill name")
46
+ .argument("<spec>", "Skill spec (github:user/repo, git+https://..., file:...)")
47
+ .option("--skip-install", "Only update package.json without installing", false)
48
+ .action(async (name, spec, options) => {
49
+ try {
50
+ await addCommand(name, spec, {
51
+ cwd: process.cwd(),
52
+ skipInstall: options.skipInstall
53
+ });
54
+ }
55
+ catch (error) {
56
+ console.error(error instanceof Error ? error.message : String(error));
57
+ process.exit(1);
58
+ }
59
+ });
60
+ // Register all commands
61
+ program.addCommand(listCommandDef);
62
+ program.addCommand(installCommandDef);
63
+ program.addCommand(addCommandDef);
64
+ return program;
65
+ }
66
+ //# sourceMappingURL=cli.js.map
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Aa,CAAC,CAAC;IAElC,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=add.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.test.d.ts","sourceRoot":"","sources":["../../../src/commands/__tests__/add.test.ts"],"names":[],"mappings":""}