@hasna/todos 0.9.50 → 0.9.51
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/cli/index.js +17 -23
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -14113,32 +14113,26 @@ function writeTomlFile(path, content) {
|
|
|
14113
14113
|
writeFileSync3(path, content);
|
|
14114
14114
|
}
|
|
14115
14115
|
function registerClaude(binPath, global) {
|
|
14116
|
-
const
|
|
14117
|
-
const
|
|
14118
|
-
|
|
14119
|
-
|
|
14116
|
+
const scope = global ? "user" : "project";
|
|
14117
|
+
const cmd = `claude mcp add --transport stdio --scope ${scope} todos -- ${binPath}`;
|
|
14118
|
+
try {
|
|
14119
|
+
const { execSync: execSync2 } = __require("child_process");
|
|
14120
|
+
execSync2(cmd, { stdio: "pipe" });
|
|
14121
|
+
console.log(chalk.green(`Claude Code (${scope}): registered via 'claude mcp add'`));
|
|
14122
|
+
} catch {
|
|
14123
|
+
console.log(chalk.yellow(`Claude Code: could not auto-register. Run this command manually:`));
|
|
14124
|
+
console.log(chalk.cyan(` ${cmd}`));
|
|
14120
14125
|
}
|
|
14121
|
-
const servers = config["mcpServers"];
|
|
14122
|
-
servers["todos"] = {
|
|
14123
|
-
command: binPath,
|
|
14124
|
-
args: []
|
|
14125
|
-
};
|
|
14126
|
-
writeJsonFile2(configPath, config);
|
|
14127
|
-
const scope = global ? "global" : "project";
|
|
14128
|
-
console.log(chalk.green(`Claude Code (${scope}): registered in ${configPath}`));
|
|
14129
14126
|
}
|
|
14130
|
-
function unregisterClaude(
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14127
|
+
function unregisterClaude(_global) {
|
|
14128
|
+
try {
|
|
14129
|
+
const { execSync: execSync2 } = __require("child_process");
|
|
14130
|
+
execSync2("claude mcp remove todos", { stdio: "pipe" });
|
|
14131
|
+
console.log(chalk.green(`Claude Code: removed todos MCP server`));
|
|
14132
|
+
} catch {
|
|
14133
|
+
console.log(chalk.yellow(`Claude Code: could not auto-remove. Run manually:`));
|
|
14134
|
+
console.log(chalk.cyan(" claude mcp remove todos"));
|
|
14137
14135
|
}
|
|
14138
|
-
delete servers["todos"];
|
|
14139
|
-
writeJsonFile2(configPath, config);
|
|
14140
|
-
const scope = global ? "global" : "project";
|
|
14141
|
-
console.log(chalk.green(`Claude Code (${scope}): unregistered from ${configPath}`));
|
|
14142
14136
|
}
|
|
14143
14137
|
function registerCodex(binPath) {
|
|
14144
14138
|
const configPath = join7(HOME2, ".codex", "config.toml");
|