diff --git a/.vibe/development-plan-publish-cli.md b/.vibe/development-plan-publish-cli.md index 6d4856c..2aef988 100644 --- a/.vibe/development-plan-publish-cli.md +++ b/.vibe/development-plan-publish-cli.md @@ -156,6 +156,8 @@ if (args.length === 0) { - [x] Fix CLI routing issue - entry point was not properly awaiting imports - [x] Fix missing CLI dependencies in main package (commander, chalk, ora) - [x] Fix MCP server import - call startServer() function instead of importing index.js +- [x] Debug npx execution - added debug output to see what arguments npx passes +- [x] **FOUND ROOT CAUSE**: Local packaging script doesn't include packages/ directory in tarball ### Completed diff --git a/package.json b/package.json index 3200b74..e362046 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agentic-knowledge-mcp", - "version": "0.1.4", + "version": "0.1.5", "description": "A Model Context Protocol server for agentic knowledge guidance with web-based documentation loading and intelligent search instructions", "type": "module", "main": "packages/mcp-server/dist/index.js", diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index eaddbda..4090d4e 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -16,7 +16,13 @@ const __dirname = dirname(__filename); async function main() { const args = process.argv.slice(2); + // Debug output to stderr so it doesn't interfere with CLI output + console.error(`[DEBUG] process.argv: ${JSON.stringify(process.argv)}`); + console.error(`[DEBUG] args: ${JSON.stringify(args)}`); + console.error(`[DEBUG] args.length: ${args.length}`); + if (args.length === 0) { + console.error("[DEBUG] No args - starting MCP server"); // No arguments, start MCP server const isLocal = existsSync( join(__dirname, "../../mcp-server/dist/index.js"), @@ -31,6 +37,7 @@ async function main() { await startServer(); } } else { + console.error("[DEBUG] Has args - starting CLI"); // Any arguments, run CLI const { runCli } = await import("./cli.js"); runCli();