@mdless/cli 1.0.1 → 1.0.3
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/main.ts +15 -25
- package/package.json +3 -2
package/main.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env tsx
|
|
2
2
|
import { checkbox, confirm } from "@inquirer/prompts";
|
|
3
|
+
import { Command } from "commander";
|
|
3
4
|
import {
|
|
4
5
|
cpSync,
|
|
5
6
|
existsSync,
|
|
@@ -9,19 +10,13 @@ import {
|
|
|
9
10
|
statSync,
|
|
10
11
|
} from "node:fs";
|
|
11
12
|
import { join } from "node:path";
|
|
13
|
+
import packageJson from "./package.json" with { type: "json" };
|
|
12
14
|
|
|
13
15
|
function exit(): never {
|
|
14
16
|
console.log("\nAborted.");
|
|
15
17
|
process.exit(0);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
function showHelp(): void {
|
|
19
|
-
console.log(`Usage: mdless <command>
|
|
20
|
-
|
|
21
|
-
Commands:
|
|
22
|
-
skills Install or remove Claude Code skills`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
20
|
async function skillsCommand(): Promise<void> {
|
|
26
21
|
const cwd = process.cwd();
|
|
27
22
|
const claudeDir = join(cwd, ".claude");
|
|
@@ -94,25 +89,20 @@ async function skillsCommand(): Promise<void> {
|
|
|
94
89
|
: [];
|
|
95
90
|
|
|
96
91
|
if (finalSkills.length > 0) {
|
|
97
|
-
console.log(`\
|
|
92
|
+
console.log(`\nProject skills: ${finalSkills.join(", ")}`);
|
|
98
93
|
} else {
|
|
99
|
-
console.log("\nNo skills
|
|
94
|
+
console.log("\nNo skills in this project.");
|
|
100
95
|
}
|
|
101
96
|
}
|
|
102
97
|
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
default:
|
|
115
|
-
console.error(`Unknown command: ${command}`);
|
|
116
|
-
showHelp();
|
|
117
|
-
process.exit(1);
|
|
118
|
-
}
|
|
98
|
+
const program = new Command()
|
|
99
|
+
.name("mdless")
|
|
100
|
+
.description("CLI tools for Claude Code projects")
|
|
101
|
+
.version(packageJson.version);
|
|
102
|
+
|
|
103
|
+
program
|
|
104
|
+
.command("skills")
|
|
105
|
+
.description("Install or remove Claude Code skills")
|
|
106
|
+
.action(skillsCommand);
|
|
107
|
+
|
|
108
|
+
program.parse();
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdless/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Interactive skill selector CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"mdless": "
|
|
7
|
+
"mdless": "bin.mjs"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin.mjs",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@inquirer/prompts": "^8.2.0",
|
|
22
|
+
"commander": "^14.0.3",
|
|
22
23
|
"tsx": "^4.7.0"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|