aradotso avatar

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-code

Installs 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 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

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
1secondsky avatarbun-redissecondsky/claude-skillsUse when working with Redis in Bun (ioredis, Upstash), caching, pub/sub, session storage, or key-value operations.328skills.sh installs
2automattic avatarwp-interactivity-apiautomattic/agent-skillswp interactivity api327skills.sh installs
3davila7 avataralphafold-databasedavila7/claude-code-templatesAccess AlphaFold's 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), 326skills.sh installs
4liangdabiao avatartikhub-api-helperliangdabiao/tikhub_api_skillSearch and query TikHub APIs for TikTok, Douyin, Xiaohongshu, Lemon8, Instagram, YouTube, Twitter, Reddit, and more. Use when user asks about needs to fetch dat309skills.sh installs
5wsimmonds avatarnextjs-server-navigationwsimmonds/claude-nextjs-skillsGuide for implementing navigation in Next.js Server Components using Link component and redirect() function. Covers the difference between server and client nav305skills.sh installs
6jezweb avatarfirebase-storagejezweb/claude-skillsBuild with Firebase Cloud Storage - file uploads, downloads, and secure access. Use when: uploading images/files, generating download URLs, implementing file pi296skills.sh installs