Describe a company API once. Your agent generates the command line and the agent skill — auth, unified output, typed errors and progressive disclosure included. No framework to learn, no boilerplate to write.
Three steps from "here's my API" to "every agent can call it".
Just have your agent install the bundled agent-cli-builder skill — tell it “install this skill: github.com/renxqoo/agent-cli-sdk/tree/main/skills/agent-cli-builder”. It teaches the agent to generate a CLI, not just read one.
Give your agent the API spec — OpenAPI, a cURL example, or plain words. It writes the ~20 lines of command code from a defineCommand declaration.
skills gen writes the SKILL.md; skills sync drops it into Claude, Codex, and every other agent directory.
The same command is a human CLI and an agent skill — one source, never drifting apart.
import { defineCliApp, defineCommand } from "@renxqoo/agent-cli-sdk";
import * as z from "zod";
const app = await defineCliApp({
name: "acme",
binName: "acme",
baseUrl: "https://api.acme.com",
commands: {
orders: defineCommand({
name: "orders",
description: "List orders",
args: { schema: z.object({ limit: z.coerce.number().default(20) }) },
async run(ctx, args) {
const res = await ctx.get("/orders", { limit: args.limit });
return { data: res.data, meta: { count: res.data.length } };
},
}),
},
});
Humans run acme orders list | jq.
Agents read skills/acme/SKILL.md and call it the same way.
Reliable API calling — out of the box.
Success is {ok, data, meta} on stdout; everything else on stderr. | jq-composable.
Validation, auth, network, not-found, policy… each mapped to an exit code an agent can branch on.
Device flow, PKCE, client-credentials with 401 auto-refresh — one line of config.
SKILL.md auto-generated and synced; agents load it lazily so unused APIs cost zero tokens.
One schema drives validation, types, help and --input-schema. No second protocol.
Vite-style apply + provides + lifecycle hooks. Auth and the installer are just plugins.