Skip to main content
skill CX Codex

cli-to-js-api-wrapper — Claude Code skill: CLI into a JS API

A skill that walks through wrapping a command line tool in a typed JavaScript/TypeScript API with the cli-to-js package. Useful when an agent should call commands as methods, not shell strings.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add reason-machines/trending-skills --skill cli-to-js-api-wrapper -a claude-code
Open on GitHub

What cli-to-js-api-wrapper does

The skill covers the cli-to-js package. It runs a binary's --help, turns that output into a schema, and hands back a Proxy where each subcommand is a method and each flag is an option. Positional arguments go under the _ key, and camelCase keys are rewritten to kebab-case flags, so { dryRun: true } becomes --dry-run.

TypeScript generics get their own section: you declare the subcommands and their options once and keep autocomplete plus type errors on later calls. Validation is the part worth reading twice. $validate reports flags the binary does not have and suggests near matches, which matters in agent loops where a made-up flag would otherwise reach the shell. Output helpers include .text(), .lines() and .json<T>(), and there is streaming through callbacks or $spawn, plus $command for building the command string without running it.

You need Node.js and the package itself: npm install cli-to-js. The wrapper only reaches binaries already present on the machine — convertCliToJs("git") installs nothing. Tools whose --help is a wall of unstructured text are a poor fit; for those you feed the help string to fromHelpText yourself.

What it helps with

  • call a command line tool from Node.js without joining shell strings
  • get autocomplete and type checking for CLI flags
  • catch a mistyped flag name before the process starts
  • turn command output into a string array or parsed JSON
  • stream a long build and stop it on a matching line

Example prompts for the agent

  • Wrap git with cli-to-js and call git.status()
  • Build a typed wrapper for npm and parse npm outdated --json
  • Check the flags with $validate before running the command

How to install cli-to-js-api-wrapper

1Skills CLI (Vercel)

npx skills add reason-machines/trending-skills --skill cli-to-js-api-wrapper -a claude-code

2Manually: put the files in place

~/.claude/skills/cli-to-js-api-wrapper/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cli-to-js-api-wrapper/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cli-to-js-api-wrapper

How do I install cli-to-js-api-wrapper in Claude Code?

Run npx skills add reason-machines/trending-skills --skill cli-to-js-api-wrapper -a claude-code. The skill file lands at ~/.claude/skills/cli-to-js-api-wrapper/SKILL.md.

What does cli-to-js-api-wrapper do?

It shows how to use the cli-to-js library to expose a command line tool as a typed JavaScript/TypeScript API, with subcommands as methods and flags as options.

What do I need for this skill to work?

Node.js and the cli-to-js package, installed with npm install cli-to-js. The wrapper works against binaries that are already available on your system.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set139

isolet-widget-isolation This skill packages a component into a self-contained widget with shadow DOM and scoped styles, ready to embed on any page. CX Codex +1 474installs capso-screenshot-macos A skill about Capso, the open-source macOS app for capturing screens and recording video. It helps you embed Capso's SPM packages in your own project. CX Codex +1 445installs ntwarden-windows-analysis-toolkit A skill for digging into Windows internals: processes, services, network, ETW, kernel. Useful when you need to break down what a suspicious process is doing. CX Codex +1 443installs geoflow-content-automation A skill that walks your agent through GEOFlow: AI article generation, task scheduling, review and publishing via CLI, REST API and Docker. Useful when the content pipeline runs on PHP and PostgreSQL. CX Codex +1 442installs tech-doc-style-chinese Style rules for Chinese technical writing: spacing between CJK and Latin, corner brackets, no buzzwords. Ships with a Python linter. CX Codex +1 434installs diagram-design-editorial A skill that turns a short description into an HTML+SVG diagram for posts and docs. Thirteen types, no Mermaid, no build step, styling matched to your site. CX Codex +1 433installs anubis-android-app-manager A skill for building and configuring Anubis, an Android app manager that freezes app groups through Shizuku depending on VPN state. CX Codex +1 427installs huashu-design-html-native Turns a plain-language request into a finished file: prototype, slide deck, animation or infographic in HTML/CSS/JS. No Figma involved. CX Codex +1 426installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor