
Cli To Js Api Wrapper
Turns any CLI tool into a typed JavaScript API by parsing its help output and exposing subcommands as methods. You call git.commit({ message: "fix", all: true }) instead of spawning shell strings, which matters for agent workflows where you want validation before execution. The $validate method catches hallucinated flags and suggests corrections, and it generates standalone TypeScript wrappers with zero runtime deps. Streaming via async iterators, execution callbacks, and script composition are all built in. The Proxy-based approach means you get autocomplete for any binary on your system without handwriting wrappers. Clever use of help text parsing to bridge imperative shell tools and structured code.
- skills.sh installs
- 336
- GitHub stars
- 26
- last updated
- Jun 3, 2026
Install
$ npx -y skills add aradotso/trending-skills --skill cli-to-js-api-wrapper --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
npm install cli-to-js
Core Concepts
convertCliToJs(binary)— runs--help, parses output, returns typed API proxyfromHelpText(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
Sponsors
Details
- Repository
- github.com/aradotso/trending-skills
- Categories
- Backend & APIs, CLI & Terminal
- First seen
- Jun 3, 2026
More from aradotso/trending-skills
All 251- Html Ppt Skill336
- Ntwarden Windows Analysis Toolkit336
- Geoflow Content Automation335
- Dflash Mlx Speculative Decoding331
- Palantir For Family Trips325
- Wterm Web Terminal325
- Anubis Android App Manager324
- Nothing Ever Happens Polymarket Bot324
- Openduck Distributed Duckdb321
- Designlang Design Extract318
- Uzi Skill Stock Analyzer318
- Tech Doc Style Chinese316
- Weft Ai Language315
- Hy World 2 0 3d World Model314
- Killerpdf Portable Editor312
- Xata Postgres Platform312
- Lingbot Map 3d Reconstruction310
- Diagram Design Editorial307
- Meta Harness Optimization306
- Border Beam React304
- Wx Favorites Report299
- Cc Design Html Prototyping297
- Pgque Postgres Queue296
- Huashu Design Html Native290