@doquflow/cli 0.4.1 → 0.4.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/dist/commands/init.js +37 -5
- package/dist/index.js +14 -3
- package/package.json +2 -2
package/dist/commands/init.js
CHANGED
|
@@ -19,6 +19,16 @@ function getClaudeDesktopConfigPath() {
|
|
|
19
19
|
}
|
|
20
20
|
return node_path_1.default.join(node_os_1.default.homedir(), ".config", "Claude", "claude_desktop_config.json");
|
|
21
21
|
}
|
|
22
|
+
function getVSCodeMcpConfigPath() {
|
|
23
|
+
const platform = process.platform;
|
|
24
|
+
if (platform === "darwin") {
|
|
25
|
+
return node_path_1.default.join(node_os_1.default.homedir(), "Library", "Application Support", "Code", "User", "mcp.json");
|
|
26
|
+
}
|
|
27
|
+
else if (platform === "win32") {
|
|
28
|
+
return node_path_1.default.join(node_os_1.default.homedir(), "AppData", "Roaming", "Code", "User", "mcp.json");
|
|
29
|
+
}
|
|
30
|
+
return node_path_1.default.join(node_os_1.default.homedir(), ".config", "Code", "User", "mcp.json");
|
|
31
|
+
}
|
|
22
32
|
function resolveServerBin() {
|
|
23
33
|
// Try npm-installed package first
|
|
24
34
|
try {
|
|
@@ -150,9 +160,10 @@ async function writeClaudeMd(projectDir) {
|
|
|
150
160
|
}
|
|
151
161
|
async function run() {
|
|
152
162
|
const configPath = getClaudeDesktopConfigPath();
|
|
163
|
+
const vscodeConfigPath = getVSCodeMcpConfigPath();
|
|
153
164
|
const serverBin = resolveServerBin();
|
|
154
165
|
const nodeBin = process.execPath;
|
|
155
|
-
//
|
|
166
|
+
// Register in Claude Desktop config
|
|
156
167
|
let config = {};
|
|
157
168
|
try {
|
|
158
169
|
const raw = await promises_1.default.readFile(configPath, "utf8");
|
|
@@ -166,6 +177,27 @@ async function run() {
|
|
|
166
177
|
config.mcpServers.docuflow = { command: nodeBin, args: [serverBin] };
|
|
167
178
|
await promises_1.default.mkdir(node_path_1.default.dirname(configPath), { recursive: true });
|
|
168
179
|
await promises_1.default.writeFile(configPath, JSON.stringify(config, null, 2) + "\n", "utf8");
|
|
180
|
+
// Register in VS Code (GitHub Copilot) user MCP config
|
|
181
|
+
let vscodeRegistered = false;
|
|
182
|
+
let vscodeConfig = {};
|
|
183
|
+
try {
|
|
184
|
+
const raw = await promises_1.default.readFile(vscodeConfigPath, "utf8");
|
|
185
|
+
vscodeConfig = JSON.parse(raw);
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
// File may not exist — create it
|
|
189
|
+
}
|
|
190
|
+
if (!vscodeConfig.servers)
|
|
191
|
+
vscodeConfig.servers = {};
|
|
192
|
+
vscodeConfig.servers.docuflow = { command: nodeBin, args: [serverBin], type: "stdio" };
|
|
193
|
+
try {
|
|
194
|
+
await promises_1.default.mkdir(node_path_1.default.dirname(vscodeConfigPath), { recursive: true });
|
|
195
|
+
await promises_1.default.writeFile(vscodeConfigPath, JSON.stringify(vscodeConfig, null, 2) + "\n", "utf8");
|
|
196
|
+
vscodeRegistered = true;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
// VS Code not installed or config dir not writable — skip silently
|
|
200
|
+
}
|
|
169
201
|
// Create .docuflow/ directory structure
|
|
170
202
|
const projectDir = process.cwd();
|
|
171
203
|
const docuflowDir = node_path_1.default.join(projectDir, ".docuflow");
|
|
@@ -216,12 +248,12 @@ async function run() {
|
|
|
216
248
|
console.log(` Claude Code will automatically read DocuFlow tool instructions.`);
|
|
217
249
|
console.log("");
|
|
218
250
|
console.log("🔧 MCP Configuration:");
|
|
219
|
-
console.log(`
|
|
220
|
-
console.log(`
|
|
251
|
+
console.log(` Claude Desktop: ✓ registered`);
|
|
252
|
+
console.log(` GitHub Copilot: ${vscodeRegistered ? "✓ registered" : "— VS Code not detected (add manually to .vscode/mcp.json)"}`);
|
|
221
253
|
console.log("");
|
|
222
254
|
console.log("📖 Next steps:");
|
|
223
255
|
console.log(" 1. Edit .docuflow/schema.md to customize your wiki");
|
|
224
256
|
console.log(" 2. Add source files to .docuflow/sources/");
|
|
225
|
-
console.log(" 3. Use
|
|
226
|
-
console.log(" 4. Restart Claude Desktop to activate");
|
|
257
|
+
console.log(" 3. Use DocuFlow tools to ingest, query, and maintain wiki");
|
|
258
|
+
console.log(" 4. Restart Claude Desktop / reload VS Code window to activate");
|
|
227
259
|
}
|
package/dist/index.js
CHANGED
|
@@ -33,8 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
37
|
+
const { version } = require('../package.json');
|
|
36
38
|
const [, , cmd, flag] = process.argv;
|
|
37
|
-
if (cmd === '
|
|
39
|
+
if (cmd === '--version' || cmd === '-v') {
|
|
40
|
+
console.log(version);
|
|
41
|
+
}
|
|
42
|
+
else if (cmd === 'init') {
|
|
38
43
|
if (flag === '--interactive' || flag === '-i') {
|
|
39
44
|
Promise.resolve().then(() => __importStar(require('./commands/init-interactive'))).then(m => m.runInteractive());
|
|
40
45
|
}
|
|
@@ -49,10 +54,16 @@ else if (cmd === 'suggest') {
|
|
|
49
54
|
Promise.resolve().then(() => __importStar(require('./commands/suggest'))).then(m => m.run());
|
|
50
55
|
}
|
|
51
56
|
else {
|
|
52
|
-
console.log(
|
|
57
|
+
console.log(`DocuFlow v${version}`);
|
|
58
|
+
console.log('');
|
|
59
|
+
console.log('Usage: docuflow <command>');
|
|
53
60
|
console.log('');
|
|
54
|
-
console.log('
|
|
61
|
+
console.log('Commands:');
|
|
62
|
+
console.log(' init Register DocuFlow MCP and generate CLAUDE.md');
|
|
55
63
|
console.log(' init --interactive Interactive setup wizard (choose domain, project name)');
|
|
56
64
|
console.log(' status Show wiki health, page counts, and MCP status');
|
|
57
65
|
console.log(' suggest Show what to document first (domain-specific guidance)');
|
|
66
|
+
console.log('');
|
|
67
|
+
console.log('Options:');
|
|
68
|
+
console.log(' --version, -v Print version number');
|
|
58
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doquflow/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "CLI for setting up Docuflow in your project",
|
|
5
5
|
"author": "Docuflow <hello@doquflows.dev>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"build": "tsc"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@doquflow/server": "0.4.
|
|
33
|
+
"@doquflow/server": "0.4.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^22.0.0",
|