@renxqoo/agent-cli-sdk
a skill factory for your company APIs

One declaration.
A CLI & an agent skill.

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.

View on GitHub How it works
Node ≥ 20 ESM only 9 typed errors 0 config MIT
zsh — install exit 0
$ npm install @renxqoo/agent-cli-sdk
added 1 package in 2.1s
# the package ships skills/agent-cli-builder — install it into your agent:
# "install this skill: github.com/renxqoo/agent-cli-sdk/tree/main/skills/agent-cli-builder"
$ acme orders list --limit 5 | jq .data
01 / workflow

How it works

Three steps from "here's my API" to "every agent can call it".

1

Install

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.

2

Describe

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.

3

Generate & sync

skills gen writes the SKILL.md; skills sync drops it into Claude, Codex, and every other agent directory.

02 / source of truth

One declaration, dual use

The same command is a human CLI and an agent skill — one source, never drifting apart.

The entire business code for one command
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.

03 / built for agents

Everything an agent needs

Reliable API calling — out of the box.

01 / output

JSON unified output format

Success is {ok, data, meta} on stdout; everything else on stderr. | jq-composable.

02 / errors

9 typed errors

Validation, auth, network, not-found, policy… each mapped to an exit code an agent can branch on.

03 / auth

OAuth 2.1

Device flow, PKCE, client-credentials with 401 auto-refresh — one line of config.

04 / disclosure

Progressive disclosure

SKILL.md auto-generated and synced; agents load it lazily so unused APIs cost zero tokens.

05 / schema

Zod single source

One schema drives validation, types, help and --input-schema. No second protocol.

06 / plugins

Plugin system

Vite-style apply + provides + lifecycle hooks. Auth and the installer are just plugins.