contextswitch 0.1.2 → 0.1.4
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.js +14 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11,15 +11,17 @@ import "./chunk-PNKVD2UK.js";
|
|
|
11
11
|
import { Command } from "commander";
|
|
12
12
|
import picocolors from "picocolors";
|
|
13
13
|
import { existsSync, readFileSync, unlinkSync } from "fs";
|
|
14
|
-
import { join } from "path";
|
|
14
|
+
import { join, dirname } from "path";
|
|
15
|
+
import { fileURLToPath } from "url";
|
|
15
16
|
var pc = picocolors;
|
|
16
17
|
function getVersion() {
|
|
17
18
|
try {
|
|
18
|
-
const
|
|
19
|
+
const currentDir = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
const packagePath = join(currentDir, "..", "package.json");
|
|
19
21
|
const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
|
|
20
22
|
return packageJson.version;
|
|
21
23
|
} catch {
|
|
22
|
-
return "0.1.
|
|
24
|
+
return "0.1.4";
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
function processSessionFallbackMarker() {
|
|
@@ -52,7 +54,15 @@ function processSessionFallbackMarker() {
|
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
var program = new Command();
|
|
55
|
-
program.name("cs").description("Domain-based context management for Claude Code CLI - Each domain represents a project with its own working directory and configuration").version(getVersion()).
|
|
57
|
+
program.name("cs").description("Domain-based context management for Claude Code CLI - Each domain represents a project with its own working directory and configuration").version(getVersion()).addHelpText("after", `
|
|
58
|
+
Quick Start:
|
|
59
|
+
cs init Initialize ContextSwitch
|
|
60
|
+
cs domain add myproject -w /path/to/project Create a domain with a working directory
|
|
61
|
+
cs switch myproject Switch to the domain (launches Claude)
|
|
62
|
+
cs list See all your domains
|
|
63
|
+
|
|
64
|
+
The --working-dir (-w) flag sets where Claude will run. If omitted, the current directory is used.
|
|
65
|
+
Run "cs domain add --help" for more details.`).hook("preAction", () => {
|
|
56
66
|
paths.ensureDirectories();
|
|
57
67
|
processSessionFallbackMarker();
|
|
58
68
|
});
|