skillmds 1.0.4 → 1.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to `skillmds` are documented here. Versions follow [semver](https://semver.org).
4
4
 
5
+ ## 1.0.5
6
+
7
+ - The `skillmds` binary now dispatches: `skillmds <command>` (lint, scan, add, …) runs the CLI, while `skillmds` with no command starts the MCP server. This makes `npx skillmds lint .` work without the `-p` flag.
8
+
5
9
  ## 1.0.4
6
10
 
7
11
  - `skillmd lint`/`scan` print a progress line to stderr and warn when scanning a home directory, so a directory scan never looks like a frozen blank screen.
package/README.md CHANGED
@@ -23,9 +23,11 @@ npm i -g skillmds
23
23
  This installs both the `skillmd` and `skillmds` commands. To run the CLI without installing:
24
24
 
25
25
  ```bash
26
- npx -p skillmds skillmd lint .
26
+ npx skillmds lint .
27
27
  ```
28
28
 
29
+ `npx skillmds <command>` runs the CLI; `npx skillmds` with no command starts the MCP server.
30
+
29
31
  ## CLI: `skillmd`
30
32
 
31
33
  | Command | Description |
@@ -196,16 +196,32 @@ async function handleCall(name, args) {
196
196
  }
197
197
  }
198
198
 
199
- const server = new Server({ name: "skillmd", version: VERSION }, { capabilities: { tools: {} } });
200
- server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
201
- server.setRequestHandler(CallToolRequestSchema, async (req) => {
202
- try {
203
- return await handleCall(req.params.name, req.params.arguments ?? {});
204
- } catch (e) {
205
- return { isError: true, content: [{ type: "text", text: String(e?.message || e) }] };
206
- }
207
- });
199
+ async function startMcpServer() {
200
+ const server = new Server({ name: "skillmd", version: VERSION }, { capabilities: { tools: {} } });
201
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
202
+ server.setRequestHandler(CallToolRequestSchema, async (req) => {
203
+ try {
204
+ return await handleCall(req.params.name, req.params.arguments ?? {});
205
+ } catch (e) {
206
+ return { isError: true, content: [{ type: "text", text: String(e?.message || e) }] };
207
+ }
208
+ });
209
+ const transport = new StdioServerTransport();
210
+ await server.connect(transport);
211
+ console.error("skillmd MCP server running (stdio)");
212
+ }
208
213
 
209
- const transport = new StdioServerTransport();
210
- await server.connect(transport);
211
- console.error("skillmd MCP server running (stdio)");
214
+ // This binary is invoked two ways:
215
+ // - `skillmds` → start the MCP server (stdio; how MCP clients launch it)
216
+ // - `skillmds lint .` etc. → run the CLI (so `npx skillmds <cmd>` works without -p)
217
+ const CLI_COMMANDS = new Set([
218
+ "lint", "check", "scan", "rules", "init", "search", "add", "list", "ls",
219
+ "remove", "rm", "update", "publish", "submit", "login", "logout", "help",
220
+ "--help", "-h", "--version", "-V",
221
+ ]);
222
+ const first = process.argv[2];
223
+ if (first && CLI_COMMANDS.has(first)) {
224
+ await import("../dist/cli.js"); // the CLI parses process.argv itself
225
+ } else {
226
+ await startMcpServer();
227
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillmds",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "SkillMD for agents: the `skillmds` MCP server + the `skillmd` CLI (lint, scan, search, install, publish Agent Skills) from skillmd.com.",
5
5
  "type": "module",
6
6
  "bin": {