@ghostystudio/cli 0.4.0 → 0.5.0
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/index.js +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -275,7 +275,7 @@ async function request(path, opts = {}, retried = false) {
|
|
|
275
275
|
method: opts.method ?? (opts.body !== void 0 || opts.raw !== void 0 ? "POST" : "GET"),
|
|
276
276
|
headers: {
|
|
277
277
|
authorization: `Bearer ${token}`,
|
|
278
|
-
"user-agent": `ghosty-cli/${"0.
|
|
278
|
+
"user-agent": `ghosty-cli/${"0.5.0"}`,
|
|
279
279
|
...opts.body !== void 0 ? { "content-type": "application/json" } : {},
|
|
280
280
|
...opts.headers
|
|
281
281
|
},
|
|
@@ -368,6 +368,10 @@ async function agentsSet(id, v) {
|
|
|
368
368
|
const r = await api(agentPath(id), { method: "PATCH", body });
|
|
369
369
|
out(r, () => `${lavender("\u2713")} Updated ${Object.keys(body).join(", ")}.`);
|
|
370
370
|
}
|
|
371
|
+
async function agentsRm(id) {
|
|
372
|
+
id = need(id, "agent id", "ghosty agents rm <agent-id>");
|
|
373
|
+
out(await api(agentPath(id), { method: "DELETE" }), () => `${lavender("\u2713")} Deleted ${id}.`);
|
|
374
|
+
}
|
|
371
375
|
async function agentsRestart(id) {
|
|
372
376
|
id = need(id, "agent id", "ghosty agents restart <agent-id>");
|
|
373
377
|
out(await api(agentPath(id, "/restart"), { method: "POST", body: {} }), () => `${lavender("\u2713")} Restarting \u2014 the next turn uses the new config.`);
|
|
@@ -730,6 +734,7 @@ ${bold("Agents")}
|
|
|
730
734
|
agents create Create an agent --name [--engine] [--model] [--prompt | --prompt-file FILE] [--env K=V,\u2026]
|
|
731
735
|
agents get <id> Show an agent's config [--fields name,model,prompt]
|
|
732
736
|
agents set <id> Change identity or engine [--name] [--engine] [--model] [--prompt | --prompt-file FILE] [--env K=V,\u2026]
|
|
737
|
+
agents rm <id> Delete an agent (owner only)
|
|
733
738
|
agents restart <id> Restart an ACP agent (needsRestart) so it loads new skills
|
|
734
739
|
|
|
735
740
|
${bold("Configure an agent")}
|
|
@@ -796,7 +801,7 @@ async function main() {
|
|
|
796
801
|
});
|
|
797
802
|
globals.json = Boolean(v.json);
|
|
798
803
|
globals.token = v.token;
|
|
799
|
-
if (v.version) return out({ version: "0.
|
|
804
|
+
if (v.version) return out({ version: "0.5.0" }, () => "0.5.0");
|
|
800
805
|
const [cmd, sub, a1, a2] = pos;
|
|
801
806
|
if (!cmd || v.help || cmd === "help") return showHelp();
|
|
802
807
|
switch (cmd) {
|
|
@@ -823,8 +828,9 @@ async function main() {
|
|
|
823
828
|
if (sub === "create" || sub === "new") return agentsCreate(v);
|
|
824
829
|
if (sub === "get") return agentsGet(a1, v.fields);
|
|
825
830
|
if (sub === "set") return agentsSet(a1, v);
|
|
831
|
+
if (sub === "rm" || sub === "delete") return agentsRm(a1);
|
|
826
832
|
if (sub === "restart") return agentsRestart(a1);
|
|
827
|
-
throw usage(`Unknown agents subcommand: ${sub}.`, "Try: ghosty agents ls | create | get | set | restart");
|
|
833
|
+
throw usage(`Unknown agents subcommand: ${sub}.`, "Try: ghosty agents ls | create | get | set | rm | restart");
|
|
828
834
|
case "files":
|
|
829
835
|
return filesCmd(sub, a1, a2, v);
|
|
830
836
|
case "skills":
|
package/package.json
CHANGED