Turn any CLI tool into a fully typed JavaScript/TypeScript API using cli-to-js
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 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-rundon't have the plugin yet? install it then click "run inline in claude" again.