🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@leynier/ccst

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leynier/ccst - npm Package Compare versions

Comparing version
0.5.1
to
0.5.2
+1
-1
package.json
{
"name": "@leynier/ccst",
"version": "0.5.1",
"version": "0.5.2",
"description": "Claude Code Switch Tools for managing contexts",

@@ -5,0 +5,0 @@ "keywords": [

@@ -47,25 +47,41 @@ import { spawn } from "node:child_process";

const ccsPath = getCcsExecutable();
// Open log file for writing (append mode)
const logFd = openSync(logPath, "a");
// Spawn detached process
// On Windows, use "start /B" to run without a visible console window
const child =
process.platform === "win32"
? spawn("cmd", ["/c", "start", "/B", ccsPath, "config"], {
detached: true,
stdio: ["ignore", logFd, logFd],
windowsHide: true,
})
: spawn(ccsPath, ["config"], {
detached: true,
stdio: ["ignore", logFd, logFd],
});
if (!child.pid) {
console.log(pc.red("Failed to start CCS config daemon"));
return;
let pid: number | undefined;
if (process.platform === "win32") {
// On Windows, use PowerShell with Start-Process -WindowStyle Hidden
// This is the only way to completely hide a console app that creates its own window
const ps = spawn(
"powershell",
[
"-WindowStyle",
"Hidden",
"-Command",
`$p = Start-Process -FilePath '${ccsPath}' -ArgumentList 'config' -WindowStyle Hidden -PassThru; $p.Id`,
],
{
stdio: ["ignore", "pipe", "ignore"],
windowsHide: true,
},
);
const output = await new Response(ps.stdout).text();
pid = Number.parseInt(output.trim(), 10);
if (!Number.isFinite(pid)) {
console.log(pc.red("Failed to start CCS config daemon"));
return;
}
} else {
// On Unix, use regular spawn with detached mode
const logFd = openSync(logPath, "a");
const child = spawn(ccsPath, ["config"], {
detached: true,
stdio: ["ignore", logFd, logFd],
});
if (!child.pid) {
console.log(pc.red("Failed to start CCS config daemon"));
return;
}
pid = child.pid;
child.unref();
}
await writePid(child.pid);
// Unref to allow parent to exit independently
child.unref();
console.log(pc.green(`CCS config daemon started (PID: ${child.pid})`));
await writePid(pid);
console.log(pc.green(`CCS config daemon started (PID: ${pid})`));
console.log(pc.dim(`Logs: ${logPath}`));

@@ -72,0 +88,0 @@ console.log(pc.dim("Run 'ccst ccs status' to check status"));