@minhpnq1807/contextos 0.5.25 → 0.5.26
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/CHANGELOG.md +5 -0
- package/bin/ctx.js +31 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.26
|
|
4
|
+
|
|
5
|
+
- **Interactive `ctx install`:** Running `ctx install` without `--agent` now shows an interactive multi-select prompt (↑/↓ to navigate, Space to toggle, Enter to confirm) letting you pick which agents to install in one go.
|
|
6
|
+
- **Removed positional agent args:** `ctx install codex`, `ctx install claude`, `ctx install agy` no longer work as positional shortcuts. Use `ctx install` (interactive) or `ctx install --agent <name>` (direct).
|
|
7
|
+
|
|
3
8
|
## 0.5.25
|
|
4
9
|
|
|
5
10
|
- **Fix Windows JSON parse crash:** All `readJsonFile`/`readHooksFile` helpers now catch corrupt JSON and warn instead of crashing, allowing fresh config to be generated automatically.
|
package/bin/ctx.js
CHANGED
|
@@ -41,11 +41,8 @@ function usage() {
|
|
|
41
41
|
return `ContextOS (ctx)
|
|
42
42
|
|
|
43
43
|
Usage:
|
|
44
|
-
ctx install
|
|
45
|
-
ctx install codex
|
|
46
|
-
ctx install claude
|
|
47
|
-
ctx install agy
|
|
48
|
-
ctx install --agent codex
|
|
44
|
+
ctx install (interactive agent selection)
|
|
45
|
+
ctx install --agent codex (direct install for a specific agent)
|
|
49
46
|
ctx install --agent claude
|
|
50
47
|
ctx install --agent agy
|
|
51
48
|
ctx install --quiet
|
|
@@ -82,6 +79,12 @@ Usage:
|
|
|
82
79
|
`;
|
|
83
80
|
}
|
|
84
81
|
|
|
82
|
+
const SUPPORTED_AGENTS = [
|
|
83
|
+
{ label: "Codex", value: "codex", selected: true },
|
|
84
|
+
{ label: "Claude Code", value: "claude", selected: true },
|
|
85
|
+
{ label: "Antigravity (agy)", value: "agy", selected: true }
|
|
86
|
+
];
|
|
87
|
+
|
|
85
88
|
function normalizeInstallAgent(agent) {
|
|
86
89
|
const normalized = String(agent || "").trim().toLowerCase();
|
|
87
90
|
if (/[|/]/.test(normalized)) {
|
|
@@ -581,8 +584,7 @@ const command = args[0];
|
|
|
581
584
|
function installAgentFromArgs(args) {
|
|
582
585
|
const agentFlag = args.indexOf("--agent");
|
|
583
586
|
if (agentFlag >= 0) return normalizeInstallAgent(args[agentFlag + 1] || "");
|
|
584
|
-
|
|
585
|
-
return normalizeInstallAgent(firstValue || "codex");
|
|
587
|
+
return null; // no --agent flag → interactive selection
|
|
586
588
|
}
|
|
587
589
|
|
|
588
590
|
try {
|
|
@@ -591,11 +593,28 @@ try {
|
|
|
591
593
|
} else if (command === "--version" || command === "-v") {
|
|
592
594
|
console.log(packageVersion());
|
|
593
595
|
} else if (command === "install") {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
596
|
+
const copy = args.includes("--copy");
|
|
597
|
+
const inject = args.includes("--inject") || !args.includes("--quiet");
|
|
598
|
+
const explicitAgent = installAgentFromArgs(args);
|
|
599
|
+
|
|
600
|
+
if (explicitAgent) {
|
|
601
|
+
// Direct mode: ctx install --agent <name>
|
|
602
|
+
await install({ copy, inject, agent: explicitAgent });
|
|
603
|
+
} else {
|
|
604
|
+
// Interactive mode: ctx install
|
|
605
|
+
const selected = await multiSelect({
|
|
606
|
+
message: "Select agents to install:",
|
|
607
|
+
options: SUPPORTED_AGENTS
|
|
608
|
+
});
|
|
609
|
+
if (!selected.length) {
|
|
610
|
+
console.log("No agents selected. Nothing to install.");
|
|
611
|
+
} else {
|
|
612
|
+
for (const agent of selected) {
|
|
613
|
+
await install({ copy, inject, agent });
|
|
614
|
+
console.log("");
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
599
618
|
} else if (command === "setup") {
|
|
600
619
|
await setup({ args: args.slice(1), cwd: process.cwd() });
|
|
601
620
|
} else if (command === "debug") {
|
package/package.json
CHANGED