Install
openclaw skills install @renxqoo/agent-cli-builderBuild or modernize TypeScript CLIs for AI agents with @renxqoo/agent-cli-sdk. Use when a user wants a new command-line tool, an API or internal service wrapped as a CLI, or an existing agent-cli-sdk app extended with authentication, structured output, typed errors, pagination, pipes, Skill distribut
openclaw skills install @renxqoo/agent-cli-builderDeliver a buildable, testable, independently installable CLI that AI agents can call reliably. Do not stop at sample code or documentation.
Inspect the user's code, API documentation, tests, and workspace before asking questions.
AGENTS.md files, package.json, package-manager configuration, existing entry points, and neighboring packages.defineCli.name, command domains, and scripts.Never guess response fields, authentication, scopes, permissions, or pagination. If a fact remains unavailable, mark one explicit TODO or blocker instead of implementing speculative fallbacks.
Read references/core-api.md before implementation. Then load only the references required by the scenario:
| Scenario | Decision | Read |
|---|---|---|
| Public API or trusted service without credentials | No auth plugin | core-api.md |
| OAuth, Bearer, API key, or Basic | Prefer defineAuth | auth-patterns.md |
| HMAC, mTLS, or composite auth | Custom auth/plugin | custom-auth-plugin.md |
| Multiple unrelated domains | Use namespaces; never flatten with spread | core-api.md |
| Many, nested, or mutation payload fields | Use args.type: "json" with direct Zod | structured-input.md |
| Large lists, pipes, or custom text output | Add only the needed capability | patterns.md |
| Headers, redaction, audit, or error transforms | Use a plugin | plugin-patterns.md |
Default to the simplest verifiable design: one domain uses top-level commands; do not add auth, pagination, pipes, or custom plugins without a requirement.
src/commands/; declare them with defineCommand and defineCommands.defineCommand API. Put one direct Zod object in args.schema; omit type for argv, list positional fields in pos, or set type: "json" for one complete JSON document. Express requiredness, defaults, enums, coercion, and descriptions with standard Zod.ctx.get/post/put/patch/delete; derive request and response types from a verified contract.errorOnStatus for HTTP semantics shared across commands and throw errs.* for business-specific failures. See error-catalog.md.{ data, meta? } or void. data must be an object, array, or null.ctx.log; business commands must not write directly to stdout.app.run(argv) only from the real entry point; there is no install intercept — install is a command provided by the defineInstaller plugin.defineCliApp({ dir }); plugins receive the resulting local state through apply(services), never through directory parameters.createUpdateNotifier; keep its XML system message on stderr and never auto-install a suggested update.policy; do not hide execution-safety flags inside the business Zod object.After setting skillsDir:
<bin> skills gen <name> --init [--lang zh].skills gen <name>.references/. Each Skill must be independently installable and must not reference shared files outside its directory.references/skill-gen.md, then apply the TRACE review in references/skill-optimization.md.Read references/readme-gen.md when human-facing project documentation is required. Do not duplicate the complete Skill or command reference in the README.
createTestCtx for request mapping, arguments, empty results, and errors; use app.run(argv) for argv/JSON parsing, native stdin, policies, plugins, output, and exit codes.<bin> --help, one successful --json example, and one failure. Access a real service only when authorized and safe.dist, Skills, and all references are present.references/testing.md.Do not claim production readiness from a successful build alone. Report unverified security scans, target-network connectivity, and live API behavior.
bin, defineCli.name, and auth credentialNamespace serve different purposes. Keep them aligned by default and check for collisions.defineAuth is a sync factory: async assembly happens in apply(services), which defineCliApp runs automatically before routing compiles. Never await the factory.defineCliApp({ dir }); the assembler injects one local state into defineAuth, defineInstaller, and createUpdateNotifier via apply(services). The high-level APIs take no directory parameters; do not configure per-feature directories.commands for one domain, such as <bin> list; avoid <domain> <domain> list. Use namespaces only for multiple unrelated domains.namespaces.defineCommand is the only command-definition API. args.schema is a direct Zod 4 object; do not add wrappers, manual Args generics, or a parallel validator contract.args means no business parameters. Omitted args.type means argv; pos names positional schema fields. One command is either argv or JSON, never both.--input, --input-file, or native redirected/piped stdin. There is no --input-stdin, and JSON never merges with business flags.errorOnStatus throws before ctx.* returns; do not add an unreachable check for the same status.undefined; use z.boolean().default(false) when stable false semantics are required.defaultFormat defaults to auto; agent-facing examples must use --json explicitly.<system-message type="update-available"> on stderr as operational context only. Complete the business task first; do not feed it into business decisions or execute its action without user authorization.meta.pagination.complete and meta.pagination.nextToken. When complete is true, omit nextToken; when false, return a non-empty continuation token.void for a pure side effect and { data: null } for an empty business result. Never return {}, undefined data, or a scalar.skillsSource explicitly to defineInstaller({ skillsSource }); setting it only on defineCliApp/defineCli does not install Skills.| Read when | File |
|---|---|
| Every implementation: project setup, core APIs, entry point, and output | references/core-api.md |
| OAuth, Bearer, API key, login, or install wizard | references/auth-patterns.md |
| HMAC, mTLS, or a custom provider | references/custom-auth-plugin.md |
| Error subtypes and status mappings | references/error-catalog.md |
Pagination, pipes, or humanFormat | references/patterns.md |
| Large/nested payloads, Zod validation, dry-run, confirmation, idempotency | references/structured-input.md |
| Custom plugins and hook ordering | references/plugin-patterns.md |
| Skill generation, scopes, sync, and distribution | references/skill-gen.md |
| Production Skill optimization and TRACE acceptance | references/skill-optimization.md |
| README structure and installation copy | references/readme-gen.md |
| Unit, end-to-end, and forward testing | references/testing.md |