@leeandrew94/ccm 0.1.11 → 0.1.13
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/README.md +1 -1
- package/README.zh.md +1 -1
- package/bin/ccm.js +12 -5
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ Profile config file `~/.ccm/profiles.json` (managed via `ccm add` / `ccm edit`):
|
|
|
104
104
|
|
|
105
105
|
## Star History
|
|
106
106
|
|
|
107
|
-
[](https://www.star-history.com/?type=date&repos=leeandrew94%2Fccm-cli)
|
|
108
108
|
|
|
109
109
|
## License
|
|
110
110
|
|
package/README.zh.md
CHANGED
|
@@ -104,7 +104,7 @@ Profile 配置文件 `~/.ccm/profiles.json`(通过 `ccm add` / `ccm edit` 管
|
|
|
104
104
|
|
|
105
105
|
## Star History
|
|
106
106
|
|
|
107
|
-
[](https://www.star-history.com/?type=date&repos=leeandrew94%2Fccm-cli)
|
|
108
108
|
|
|
109
109
|
## License
|
|
110
110
|
|
package/bin/ccm.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
// src/cli.ts
|
|
4
|
+
import { readFileSync } from "fs";
|
|
5
|
+
import updateNotifier from "update-notifier";
|
|
6
|
+
|
|
3
7
|
// src/config.ts
|
|
4
8
|
import fs from "fs";
|
|
5
9
|
|
|
@@ -250,7 +254,7 @@ function cmdLaunch(args) {
|
|
|
250
254
|
writeRun(process.pid, args.name, "");
|
|
251
255
|
info(`Launching claude with profile '${args.name}'...`);
|
|
252
256
|
console.log();
|
|
253
|
-
const child = spawn("claude", ["--settings", settingsPath], {
|
|
257
|
+
const child = spawn("claude", ["--settings", settingsPath, ...args.extraArgs || []], {
|
|
254
258
|
stdio: "inherit"
|
|
255
259
|
});
|
|
256
260
|
child.on("exit", (code) => {
|
|
@@ -803,7 +807,8 @@ var BASH_COMPLETION = `_ccm_completions() {
|
|
|
803
807
|
complete -F _ccm_completions ccm`;
|
|
804
808
|
|
|
805
809
|
// src/cli.ts
|
|
806
|
-
var
|
|
810
|
+
var pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
811
|
+
var VERSION = pkg.version;
|
|
807
812
|
var KNOWN_COMMANDS = /* @__PURE__ */ new Set([
|
|
808
813
|
"_launch",
|
|
809
814
|
"_register",
|
|
@@ -848,13 +853,14 @@ Shortcuts:
|
|
|
848
853
|
`);
|
|
849
854
|
}
|
|
850
855
|
function parseArgs(argv) {
|
|
851
|
-
const args = { _: [] };
|
|
856
|
+
const args = { _: [], extra: [] };
|
|
852
857
|
let i = 0;
|
|
853
858
|
while (i < argv.length) {
|
|
854
859
|
const arg = argv[i];
|
|
855
860
|
if (arg === "--all") {
|
|
856
861
|
args.all = true;
|
|
857
862
|
} else if (arg.startsWith("-")) {
|
|
863
|
+
args.extra.push(arg);
|
|
858
864
|
} else {
|
|
859
865
|
args._.push(arg);
|
|
860
866
|
}
|
|
@@ -877,6 +883,7 @@ function parseArgs(argv) {
|
|
|
877
883
|
return { command, args };
|
|
878
884
|
}
|
|
879
885
|
async function main() {
|
|
886
|
+
updateNotifier({ pkg }).notify();
|
|
880
887
|
const rawArgs = process.argv.slice(2);
|
|
881
888
|
if (rawArgs.includes("-v") || rawArgs.includes("--version")) {
|
|
882
889
|
console.log(`ccm ${VERSION}`);
|
|
@@ -889,14 +896,14 @@ async function main() {
|
|
|
889
896
|
const firstArg = rawArgs[0];
|
|
890
897
|
if (firstArg && !KNOWN_COMMANDS.has(firstArg) && !firstArg.startsWith("-")) {
|
|
891
898
|
if (profileExists(firstArg)) {
|
|
892
|
-
cmdLaunch({ name: firstArg });
|
|
899
|
+
cmdLaunch({ name: firstArg, extraArgs: rawArgs.slice(1) });
|
|
893
900
|
return;
|
|
894
901
|
}
|
|
895
902
|
}
|
|
896
903
|
const { command, args } = parseArgs(rawArgs);
|
|
897
904
|
switch (command) {
|
|
898
905
|
case "_launch":
|
|
899
|
-
cmdLaunch({ name: args.name });
|
|
906
|
+
cmdLaunch({ name: args.name, extraArgs: args.extra || [] });
|
|
900
907
|
break;
|
|
901
908
|
case "_register":
|
|
902
909
|
cmdRegister({ name: args.name, pid: args.pid, tty: args.tty });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leeandrew94/ccm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Claude Code Model Manager - switch between AI models per terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -38,5 +38,8 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"tsup": "^8.0.0",
|
|
40
40
|
"typescript": "^5.4.0"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"update-notifier": "^7.3.1"
|
|
41
44
|
}
|
|
42
45
|
}
|