Skip to content
Closed
57 changes: 57 additions & 0 deletions bin/cli/api-commands/a2a.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// AUTO-GENERATED from docs/openapi.yaml. Do not edit.
import { apiFetch } from "../api.mjs";
import { emit } from "../output.mjs";
import { readFileSync } from "node:fs";

export function register_a2a(parent) {
const tag = parent.command("a2a").description("A2a endpoints");
tag.command("get-api-a2a-status")
.description("GET a2a › status")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/a2a/status";
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag.command("get-api-a2a-tasks")
.description("GET a2a › tasks")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/a2a/tasks";
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag.command("post-api-a2a-tasks")
.description("POST a2a › tasks")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/a2a/tasks";
const res = await apiFetch(url, { method: "POST", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag.command("get-api-a2a-tasks-id-")
.description("GET a2a › tasks › <id>")
.requiredOption("--id <id>", "id path parameter")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/a2a/tasks/{id}";
url = url.replaceAll("{id}", encodeURIComponent(opts.id ?? ""));
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag.command("post-api-a2a-tasks-id-cancel")
.description("POST a2a › tasks › <id> › cancel")
.requiredOption("--id <id>", "id path parameter")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/a2a/tasks/{id}/cancel";
url = url.replaceAll("{id}", encodeURIComponent(opts.id ?? ""));
const res = await apiFetch(url, { method: "POST", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
}
35 changes: 35 additions & 0 deletions bin/cli/api-commands/acp.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// AUTO-GENERATED from docs/openapi.yaml. Do not edit.
import { apiFetch } from "../api.mjs";
import { emit } from "../output.mjs";
import { readFileSync } from "node:fs";

export function register_acp(parent) {
const tag = parent.command("acp").description("Acp endpoints");
tag.command("delete-api-acp-agents")
.description("DELETE acp › agents")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/acp/agents";
const res = await apiFetch(url, { method: "DELETE", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag.command("get-api-acp-agents")
.description("GET acp › agents")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/acp/agents";
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag.command("post-api-acp-agents")
.description("POST acp › agents")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/acp/agents";
const res = await apiFetch(url, { method: "POST", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
}
26 changes: 26 additions & 0 deletions bin/cli/api-commands/admin.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// AUTO-GENERATED from docs/openapi.yaml. Do not edit.
import { apiFetch } from "../api.mjs";
import { emit } from "../output.mjs";
import { readFileSync } from "node:fs";

export function register_admin(parent) {
const tag = parent.command("admin").description("Admin endpoints");
tag.command("get-api-admin-concurrency")
.description("GET admin › concurrency")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/admin/concurrency";
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag.command("post-api-admin-concurrency")
.description("POST admin › concurrency")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/admin/concurrency";
const res = await apiFetch(url, { method: "POST", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
}
48 changes: 11 additions & 37 deletions bin/cli/api-commands/agent-skills.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,53 @@ import { readFileSync } from "node:fs";

export function register_agent_skills(parent) {
const tag = parent.command("agent-skills").description("Agent Skills endpoints");
tag
.command("get-api-agent-skills")
tag.command("get-api-agent-skills")
.description("List agent skills catalog")
.option("--category <category>", "Filter by category (api = REST API skills, cli = CLI skills)")
.option("--area <area>", 'Filter by area slug (e.g. "providers", "models", "cli-serve")')
.option("--area <area>", "Filter by area slug (e.g. \"providers\", \"models\", \"cli-serve\")")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/agent-skills";
const qs = new URLSearchParams();
if (opts.category != null) qs.set("category", String(opts.category));
if (opts.area != null) qs.set("area", String(opts.area));
if (qs.toString()) url += "?" + qs.toString();
const res = await apiFetch(url, {
method: "GET",
baseUrl: gOpts.baseUrl,
apiKey: gOpts.apiKey,
});
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag
.command("get-api-agent-skills-id-")
tag.command("get-api-agent-skills-id-")
.description("Get a single agent skill")
.requiredOption("--id <id>", "Canonical skill ID")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/agent-skills/{id}";
url = url.replaceAll("{id}", encodeURIComponent(opts.id ?? ""));
const res = await apiFetch(url, {
method: "GET",
baseUrl: gOpts.baseUrl,
apiKey: gOpts.apiKey,
});
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag
.command("get-api-agent-skills-id-raw")
tag.command("get-api-agent-skills-id-raw")
.description("Get raw SKILL.md content")
.requiredOption("--id <id>", "Canonical skill ID")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/agent-skills/{id}/raw";
url = url.replaceAll("{id}", encodeURIComponent(opts.id ?? ""));
const res = await apiFetch(url, {
method: "GET",
baseUrl: gOpts.baseUrl,
apiKey: gOpts.apiKey,
});
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag
.command("get-api-agent-skills-coverage")
tag.command("get-api-agent-skills-coverage")
.description("Get SKILL.md coverage stats")
.action(async (opts, cmd) => {
const gOpts = cmd.optsWithGlobals();
let url = "/api/agent-skills/coverage";
const res = await apiFetch(url, {
method: "GET",
baseUrl: gOpts.baseUrl,
apiKey: gOpts.apiKey,
});
const res = await apiFetch(url, { method: "GET", baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
tag
.command("post-api-agent-skills-generate")
tag.command("post-api-agent-skills-generate")
.description("Trigger SKILL.md generator")
.option("--body <jsonOrPath>", "JSON body or @path/to/file.json")
.action(async (opts, cmd) => {
Expand All @@ -84,12 +63,7 @@ export function register_agent_skills(parent) {
? JSON.parse(readFileSync(opts.body.slice(1), "utf8"))
: JSON.parse(opts.body);
}
const res = await apiFetch(url, {
method: "POST",
body,
baseUrl: gOpts.baseUrl,
apiKey: gOpts.apiKey,
});
const res = await apiFetch(url, { method: "POST", body, baseUrl: gOpts.baseUrl, apiKey: gOpts.apiKey });
const data = res.ok ? await res.json() : await res.text();
emit(data, gOpts);
});
Expand Down
Loading
Loading