@doquflow/cli 0.4.3 → 0.4.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/dist/commands/init.js +69 -22
- package/package.json +2 -2
package/dist/commands/init.js
CHANGED
|
@@ -29,6 +29,9 @@ function getVSCodeMcpConfigPath() {
|
|
|
29
29
|
}
|
|
30
30
|
return node_path_1.default.join(node_os_1.default.homedir(), ".config", "Code", "User", "mcp.json");
|
|
31
31
|
}
|
|
32
|
+
function getCopilotCliMcpConfigPath() {
|
|
33
|
+
return node_path_1.default.join(node_os_1.default.homedir(), ".copilot", "mcp-config.json");
|
|
34
|
+
}
|
|
32
35
|
function resolveServerBin() {
|
|
33
36
|
// Try npm-installed package first
|
|
34
37
|
try {
|
|
@@ -161,6 +164,7 @@ async function writeClaudeMd(projectDir) {
|
|
|
161
164
|
async function run() {
|
|
162
165
|
const configPath = getClaudeDesktopConfigPath();
|
|
163
166
|
const vscodeConfigPath = getVSCodeMcpConfigPath();
|
|
167
|
+
const copilotCliConfigPath = getCopilotCliMcpConfigPath();
|
|
164
168
|
const serverBin = resolveServerBin();
|
|
165
169
|
const nodeBin = process.execPath;
|
|
166
170
|
// Register in Claude Desktop config
|
|
@@ -198,6 +202,27 @@ async function run() {
|
|
|
198
202
|
catch {
|
|
199
203
|
// VS Code not installed or config dir not writable — skip silently
|
|
200
204
|
}
|
|
205
|
+
// Register in GitHub Copilot CLI MCP config (~/.copilot/mcp-config.json)
|
|
206
|
+
let copilotCliRegistered = false;
|
|
207
|
+
let copilotCliConfig = {};
|
|
208
|
+
try {
|
|
209
|
+
const raw = await promises_1.default.readFile(copilotCliConfigPath, "utf8");
|
|
210
|
+
copilotCliConfig = JSON.parse(raw);
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
// File may not exist yet
|
|
214
|
+
}
|
|
215
|
+
if (!copilotCliConfig.mcpServers)
|
|
216
|
+
copilotCliConfig.mcpServers = {};
|
|
217
|
+
copilotCliConfig.mcpServers.docuflow = { type: "local", command: nodeBin, args: [serverBin], tools: ["*"] };
|
|
218
|
+
try {
|
|
219
|
+
await promises_1.default.mkdir(node_path_1.default.dirname(copilotCliConfigPath), { recursive: true });
|
|
220
|
+
await promises_1.default.writeFile(copilotCliConfigPath, JSON.stringify(copilotCliConfig, null, 2) + "\n", "utf8");
|
|
221
|
+
copilotCliRegistered = true;
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
// Copilot CLI not installed — skip silently
|
|
225
|
+
}
|
|
201
226
|
// Create .docuflow/ directory structure
|
|
202
227
|
const projectDir = process.cwd();
|
|
203
228
|
const docuflowDir = node_path_1.default.join(projectDir, ".docuflow");
|
|
@@ -220,6 +245,27 @@ async function run() {
|
|
|
220
245
|
await copyTemplateFile("log.md", node_path_1.default.join(docuflowDir, "log.md"));
|
|
221
246
|
// Generate CLAUDE.md so Claude Code picks up DocuFlow automatically
|
|
222
247
|
await writeClaudeMd(projectDir);
|
|
248
|
+
// Write .vscode/mcp.json for project-level workspace MCP config (shareable via git)
|
|
249
|
+
// Uses npx so it works on any machine — safe to commit
|
|
250
|
+
const vscodeDirPath = node_path_1.default.join(projectDir, ".vscode");
|
|
251
|
+
const vscodeWorkspaceMcpPath = node_path_1.default.join(vscodeDirPath, "mcp.json");
|
|
252
|
+
let workspaceMcpConfig = {};
|
|
253
|
+
try {
|
|
254
|
+
const raw = await promises_1.default.readFile(vscodeWorkspaceMcpPath, "utf8");
|
|
255
|
+
workspaceMcpConfig = JSON.parse(raw);
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
// File doesn't exist yet
|
|
259
|
+
}
|
|
260
|
+
if (!workspaceMcpConfig.servers)
|
|
261
|
+
workspaceMcpConfig.servers = {};
|
|
262
|
+
workspaceMcpConfig.servers.docuflow = {
|
|
263
|
+
command: "npx",
|
|
264
|
+
args: ["-y", "-p", "@doquflow/server", "docuflow-server"],
|
|
265
|
+
type: "stdio",
|
|
266
|
+
};
|
|
267
|
+
await promises_1.default.mkdir(vscodeDirPath, { recursive: true });
|
|
268
|
+
await promises_1.default.writeFile(vscodeWorkspaceMcpPath, JSON.stringify(workspaceMcpConfig, null, 2) + "\n", "utf8");
|
|
223
269
|
// Add .docuflow/ to .gitignore if present and not already listed
|
|
224
270
|
const gitignorePath = node_path_1.default.join(process.cwd(), ".gitignore");
|
|
225
271
|
if (node_fs_1.default.existsSync(gitignorePath)) {
|
|
@@ -228,32 +274,33 @@ async function run() {
|
|
|
228
274
|
await promises_1.default.appendFile(gitignorePath, "\n# Docuflow\n.docuflow/\n");
|
|
229
275
|
}
|
|
230
276
|
}
|
|
231
|
-
console.log("
|
|
277
|
+
console.log("\u2713 DocuFlow initialised successfully.");
|
|
232
278
|
console.log("");
|
|
233
|
-
console.log("
|
|
279
|
+
console.log("\ud83d\udcc1 Structure created:");
|
|
234
280
|
console.log(` ${docuflowDir}/`);
|
|
235
|
-
console.log(`
|
|
236
|
-
console.log(`
|
|
237
|
-
console.log(`
|
|
238
|
-
console.log(`
|
|
239
|
-
console.log(`
|
|
240
|
-
console.log(`
|
|
241
|
-
console.log(`
|
|
242
|
-
console.log(`
|
|
243
|
-
console.log(`
|
|
244
|
-
console.log(`
|
|
281
|
+
console.log(` \u251c\u2500\u2500 specs/ (code specs written by the agent)`);
|
|
282
|
+
console.log(` \u251c\u2500\u2500 wiki/ (LLM-generated wiki pages)`);
|
|
283
|
+
console.log(` \u2502 \u251c\u2500\u2500 entities/`);
|
|
284
|
+
console.log(` \u2502 \u251c\u2500\u2500 concepts/`);
|
|
285
|
+
console.log(` \u2502 \u251c\u2500\u2500 timelines/`);
|
|
286
|
+
console.log(` \u2502 \u2514\u2500\u2500 syntheses/`);
|
|
287
|
+
console.log(` \u251c\u2500\u2500 sources/ (raw markdown documents to ingest)`);
|
|
288
|
+
console.log(` \u251c\u2500\u2500 schema.md (wiki configuration)`);
|
|
289
|
+
console.log(` \u251c\u2500\u2500 index.md (auto-maintained catalog)`);
|
|
290
|
+
console.log(` \u2514\u2500\u2500 log.md (operation log)`);
|
|
245
291
|
console.log("");
|
|
246
|
-
console.log("
|
|
292
|
+
console.log("\ud83d\udcdd CLAUDE.md:");
|
|
247
293
|
console.log(` Generated at: ${node_path_1.default.join(projectDir, "CLAUDE.md")}`);
|
|
248
|
-
console.log(` Claude Code
|
|
294
|
+
console.log(` Claude Code reads DocuFlow tool instructions automatically.`);
|
|
249
295
|
console.log("");
|
|
250
|
-
console.log("
|
|
251
|
-
console.log(` Claude Desktop:
|
|
252
|
-
console.log(`
|
|
296
|
+
console.log("\ud83d\udd27 MCP Registration:");
|
|
297
|
+
console.log(` Claude Desktop: \u2713 registered`);
|
|
298
|
+
console.log(` VS Code Copilot: ${vscodeRegistered ? "\u2713 registered (user-level)" : "\u2014 not detected"}`);
|
|
299
|
+
console.log(` Copilot CLI: ${copilotCliRegistered ? "\u2713 registered (~/.copilot/mcp-config.json)" : "\u2014 not detected"}`);
|
|
300
|
+
console.log(` Workspace: \u2713 .vscode/mcp.json written (commit to share with team)`);
|
|
253
301
|
console.log("");
|
|
254
|
-
console.log("
|
|
255
|
-
console.log(" 1. Edit .docuflow/schema.md to customize your wiki");
|
|
256
|
-
console.log(" 2. Add
|
|
257
|
-
console.log(" 3.
|
|
258
|
-
console.log(" 4. Restart Claude Desktop / reload VS Code window to activate");
|
|
302
|
+
console.log("\ud83d\udcd6 Next steps:");
|
|
303
|
+
console.log(" 1. Edit .docuflow/schema.md to customize your wiki domain");
|
|
304
|
+
console.log(" 2. Add markdown docs to .docuflow/sources/ then ingest them");
|
|
305
|
+
console.log(" 3. Restart Claude Desktop / reload VS Code / restart Copilot CLI");
|
|
259
306
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doquflow/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
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.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^22.0.0",
|