@yektoo/cli 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/dist/index.js +62 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -670,6 +670,68 @@ program.command("csat").description("View CSAT survey report").option("-d, --day
670
670
  process.exit(1);
671
671
  }
672
672
  });
673
+ program.command("setup-mcp").description("Automatically configure the Yektoo MCP server for Claude Desktop, Cursor, or Claude Code").option("--target <tool>", "Target tool: claude-desktop, cursor, claude-code (required)").action(async (opts) => {
674
+ try {
675
+ if (!opts.target) {
676
+ printError("Please specify a target tool with --target <claude-desktop|cursor|claude-code>");
677
+ process.exit(1);
678
+ }
679
+ const fs = await import("fs");
680
+ const path = await import("path");
681
+ const os = await import("os");
682
+ const mcpEntry = {
683
+ command: "npx",
684
+ args: ["-y", "@yektoo/mcp-server"]
685
+ };
686
+ let configPath;
687
+ let configKey;
688
+ switch (opts.target) {
689
+ case "cursor":
690
+ configPath = path.default.join(process.cwd(), ".cursor", "mcp.json");
691
+ configKey = "mcpServers";
692
+ break;
693
+ case "claude-code":
694
+ configPath = path.default.join(process.cwd(), ".mcp.json");
695
+ configKey = "mcpServers";
696
+ break;
697
+ case "claude-desktop":
698
+ const platform = os.default.platform();
699
+ if (platform === "darwin") {
700
+ configPath = path.default.join(os.default.homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
701
+ } else if (platform === "win32") {
702
+ configPath = path.default.join(process.env.APPDATA || "", "Claude", "claude_desktop_config.json");
703
+ } else {
704
+ configPath = path.default.join(os.default.homedir(), ".config", "Claude", "claude_desktop_config.json");
705
+ }
706
+ configKey = "mcpServers";
707
+ break;
708
+ default:
709
+ printError(`Unknown target "${opts.target}". Use: claude-desktop, cursor, or claude-code`);
710
+ process.exit(1);
711
+ }
712
+ let config2 = {};
713
+ try {
714
+ const existing = fs.default.readFileSync(configPath, "utf-8");
715
+ config2 = JSON.parse(existing);
716
+ } catch {
717
+ }
718
+ if (!config2[configKey]) config2[configKey] = {};
719
+ if (config2[configKey].yektoo) {
720
+ printSuccess(`Yektoo MCP server already configured in ${configPath}`);
721
+ return;
722
+ }
723
+ config2[configKey].yektoo = mcpEntry;
724
+ const dir = path.default.dirname(configPath);
725
+ fs.default.mkdirSync(dir, { recursive: true });
726
+ fs.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n");
727
+ printSuccess(`Yektoo MCP server added to ${configPath}`);
728
+ console.log(chalk2.gray(` Restart ${opts.target === "cursor" ? "Cursor" : opts.target === "claude-code" ? "Claude Code" : "Claude Desktop"} to activate the 16 helpdesk tools.`));
729
+ console.log();
730
+ } catch (err) {
731
+ printError(err.message);
732
+ process.exit(1);
733
+ }
734
+ });
673
735
  program.command("guide").description("Show detailed usage guide with examples").action(() => {
674
736
  const guide = `
675
737
  ${chalk2.bold("Yektoo CLI \u2014 Customer Support Helpdesk")}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yektoo/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Yekto CLI — manage your customer support helpdesk from the terminal",
5
5
  "type": "module",
6
6
  "bin": {