Agent skill · software engineering · aradotso
cli-to-js-api-wrapper
Turn any CLI tool into a fully typed JavaScript/TypeScript API using cli-to-js
Why this skill is useful
Adds a fully typed JavaScript API wrapper for any CLI tool, enabling structured command execution and validation that the AI cannot generate on its own.
What it needs
Requires cli-to-js installed locally. About 5k tokens when loaded. Last updated 2026-07-09. 70 stars on the source repository.
What this skill does
cli-to-js: Turn Any CLI Into a JavaScript API Skill by ara.so — Daily 2026 Skills collection. cli-to-js reads a binary's --help output, parses it into a schema, and returns a fully typed Proxy-based API where subcommands are methods and flags are options. Designed for agent workflows where structured APIs are safer than raw shell strings. Install Core Concepts convertCliToJs(binary) — runs --help, parses output, returns typed API proxy fromHelpText(binary, text) — same but from a static help string Every subcommand becomes a method: api.subcommand({ flag: value }) Positional args use the key: api.command({ : ["file.txt"] }) camelCase keys auto-convert to kebab-case flags: { dryRun: true } → --dry-run Flag → CLI Mapping JS option CLI output --------------------------- --------------------------- { verbose: true } --verbose { verbose: false } (omitted) { output: "file.txt" } --output file.txt { dryRun: true } --dry-run { v: true } -v { include: ["a","b"] } --include a --include b { : ["file.txt"] } file.txt Basic Usage TypeScript Generics for Full Typing Output Helpers Validation (Critical for Agent Use) Validate options before spawning — catches hallucinated flag names with did-you-mean suggestions: Subcommand Parsing Streaming Output Per-Call Execution Config Command Strings (Without Executing) From Help Text String CLI Code Generation Generated files are standalone with zero runtime dependencies on cli-to-js. Agent Workflow Pattern Schema Inspection Common Patterns Wrap with default config: Root command call (no subcommand): Interactive CLI passthrough: Troubleshooting Binary not found: Ensure the binary is in PATH. Test with which <binary> in terminal. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aradotso/cli-to-js-api-wrapper