Agent skill

CLI To JS

by millionco in millionco/cli-to-js

A skill your agent uses when wrapping CLI binaries in JavaScript, automating shell workflows in TypeScript, composing multiple CLIs into scripts, or building agent tool-use.

MITAuto-check passedAI & LLM Engineering

Install CLI To JS

skills CLI
$ npx skills add millionco/cli-to-js --skill cli-to-js -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install millionco/cli-to-js cli-to-js --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/millionco/cli-to-js.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/cli-to-js .claude/skills/cli-to-js && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cli-to-js
GitHub stars
410
Token cost
~1.1k tokens
SKILL.md length
142 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when wrapping CLI binaries in JavaScript, automating shell workflows in TypeScript, composing multiple CLIs into scripts, or building agent tool-use.

  • Works in 4 steps: Call convertCliToJs("binary") once,… → Use .text(), .lines(), or .json() for… → Use $validate before executing when… → …
  • Wrapping CLI binaries in JavaScript
  • SKILL.md covers REQUIRED for every cli-to-js…, Flag mapping, API quick reference and When building tools, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

CLI To JS is an agent skill from millionco/cli-to-js. Use when wrapping CLI binaries in JavaScript, automating shell workflows in TypeScript, composing multiple CLIs into scripts, or building agent tool-use. Covers convertCliToJs, $command, $validate, $spawn, script(), .text()/.lines()/.json() output parsing.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Building AI agents. It works with JavaScript and TypeScript. The repository describes itself as: Turn any CLI into a JavaScript API. The licence is MIT.

When your agent uses it

  • Wrapping CLI binaries in JavaScript
  • Automating shell workflows in TypeScript
  • Composing multiple CLIs into scripts
  • Building agent tool-use

Example prompts

  • “/cli-to-js”

Requirements

  • Docker

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Call convertCliToJs("binary") once, reuse the returned API
  2. Use .text(), .lines(), or .json() for typed output — never manually split result.stdout
  3. Use $validate before executing when inputs come from untrusted sources
  4. Use $spawn + for await for streaming — never callbacks unless specifically asked

What it can do on your machine

Read from SKILL.md and the folder at commit 7619a98. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

CLI To JS loads about 1.1k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 142 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from millionco/cli-to-js at commit 7619a98, republished under its MIT licence (© millionco). 142 words, ~1,058 tokens.

Download SKILL.mdSave it as .claude/skills/cli-to-js/SKILL.md (or your agent's skills folder).
name
cli-to-js
description
Use when wrapping CLI binaries in JavaScript, automating shell workflows in TypeScript, composing multiple CLIs into scripts, or building agent tool-use. Covers convertCliToJs, $command, $validate, $spawn, script(), .text()/.lines()/.json() output parsing.

cli-to-js

You are using cli-to-js to turn CLI binaries into callable JavaScript APIs.

REQUIRED for every cli-to-js usage:

  1. Call convertCliToJs("binary") once, reuse the returned API
  2. Use .text(), .lines(), or .json() for typed output — never manually split result.stdout
  3. Use $validate before executing when inputs come from untrusted sources
  4. Use $spawn + for await for streaming — never callbacks unless specifically asked

Flag mapping

ts
// JS option key            → 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

API quick reference

ts
import { convertCliToJs, script } from "cli-to-js";
const tool = await convertCliToJs("binary-name");

// Run + typed output
await tool.subcommand({ flag: "val", _: ["pos"] }).text();
await tool.subcommand({ json: true }).json<MyType>();
await tool.subcommand().lines();

// Streaming
for await (const line of tool.$spawn.subcommand({ watch: true })) {
}

// Validation (did-you-mean, choices, required flags, exclusive flags)
const errors = tool.$validate({ misspeled: true });

// Shell string without executing
tool.$command.subcommand({ flag: "val" });
// → "binary-name subcommand --flag val"

// Compose into runnable script
const deploy = script(git.$command.push(), docker.$command.build({ tag: "app", _: ["."] }));
deploy.run(); // execute with &&
console.log(`${deploy}`); // get the string

When building tools

Bad:

ts
const result = await api.status();
const lines = result.stdout.trim().split("\n");

Good:

ts
const statusLines = await api.status().lines();

Bad:

ts
const api1 = await convertCliToJs("git");
const api2 = await convertCliToJs("git"); // wasteful duplicate

Good:

ts
const git = await convertCliToJs("git");
// reuse git everywhere

Bad:

ts
await api.commit({ mesage: "fix" }); // typo silently becomes unknown flag

Good:

ts
const errors = api.$validate({ mesage: "fix" });
// [{ kind: "unknown-flag", suggestion: "message" }]
if (errors.length > 0) throw new Error(errors[0].message);
await api.commit({ message: "fix" });

Multi-CLI workflow pattern

ts
const git = await convertCliToJs("git");
const claude = await convertCliToJs("claude");

const files = await git.diff({ nameOnly: true, _: ["HEAD~1"] }).lines();

for (const file of files) {
  const review = await claude({
    print: true,
    model: "sonnet",
    _: [`Review ${file} for bugs`],
  }).text();

  if (review.includes("no issues")) continue;
  console.log(`${file}: ${review}`);
}

Full API surface

MethodReturnsUse for
api.sub(opts)CommandPromiseRun subcommand
.text()Promise<string>Trimmed stdout
.lines()Promise<string[]>Split by newlines
.json<T>()Promise<T>Parse JSON output
api.$spawn.sub(opts)CommandProcessfor await streaming
api.$command.sub(opts)stringShell string, no execution
api.$validate(opts)ValidationError[]Pre-flight flag checking
api.$validate("sub", opts)ValidationError[]Subcommand flag checking
api.$schemaCliSchemaParsed schema from --help
api.$parse("sub")ParsedCommandLazily enrich subcommand
script(...cmds){ run, toString }Compose && chain

© millionco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/cli-to-js of millionco/cli-to-js.

Open the folder on GitHubat commit 7619a98

Compare with similar skills

CLI To JS next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

CLI To JS compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
CLI To JS this skillmillionco/cli-to-js410—~1.1kAutomated safety check: PassMIT
Logfire Instrumentationpydantic/skills140—~6.1kAutomated safety check: PassMIT
Langgraph Testing Evaluationsoba-labs/langchain-agent-skills107—~2.3kAutomated safety check: PassMIT
Sap Cloud SDK AIsecondsky/sap-skills462—~3.2kAutomated safety check: PassGPL-3.0
Coding Agentmastra-ai/mastra29k—~2.3kAutomated safety check: PassCustom licence
Compromise NLP Libraryspencermountain/compromise12k—~2kAutomated safety check: PassMIT

Similar skills

  • Official

    Add Pydantic Logfire observability to application code — traces, logs, metrics, and AI/agent spans.

    140 GitHub stars~6.1k tokensUpdated 8 days ago
    AI & LLM EngineeringAuto-check passed
  • Langgraph Testing Evaluation

    soba-labs/langchain-agent-skills

    A skill your agent uses when you need to test or evaluate LangGraph/LangChain agents: writing unit or integration tests, generating test scaffolds, mocking LLM/tool behavior, running trajectory…

    107 GitHub stars~2.3k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Sap Cloud SDK AI

    secondsky/sap-skills

    Integrates SAP Cloud SDK for AI into JavaScript/TypeScript and Java applications.

    462 GitHub stars~3.2k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Compromise NLP Library

    spencermountain/compromise

    Helps write and debug JavaScript or TypeScript that uses the compromise English NLP library for matching, entity extraction, tagging and sentence transforms.

    12k GitHub stars~2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Trigger.dev Agent Patterns

    papermark/papermark

    Patterns for building LLM agents on Trigger.dev tasks: prompt chaining, routing, parallel workers, orchestrator-workers, evaluator loops and human approval gates.

    9.2k GitHub stars~2k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

Questions about CLI To JS

What does CLI To JS do?

A skill your agent uses when wrapping CLI binaries in JavaScript, automating shell workflows in TypeScript, composing multiple CLIs into scripts, or building agent tool-use. CLI To JS is an agent skill from millionco/cli-to-js. Use when wrapping CLI binaries in JavaScript, automating shell workflows in TypeScript, composing multiple CLIs into scripts, or building agent tool-use.

When should I use CLI To JS?

CLI To JS fits situations like: wrapping CLI binaries in JavaScript; automating shell workflows in TypeScript; composing multiple CLIs into scripts; building agent tool-use.

How do I install CLI To JS in Claude Code?

Run `npx skills add millionco/cli-to-js --skill cli-to-js -a claude-code`. Or copy the skill folder (.agents/skills/cli-to-js in millionco/cli-to-js) into .claude/skills/cli-to-js in your project. Claude Code loads it when a task matches its description.

How do I install CLI To JS in Codex?

Run `npx skills add millionco/cli-to-js --skill cli-to-js -a codex`. Or copy the skill folder (.agents/skills/cli-to-js in millionco/cli-to-js) into .agents/skills/cli-to-js in your project. Codex loads it when a task matches its description.

Can I use CLI To JS in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add millionco/cli-to-js --skill cli-to-js -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cli-to-js, .gemini/skills/cli-to-js, .github/skills/cli-to-js and .opencode/skills/cli-to-js in your project.

What does CLI To JS need to run?

SKILL.md names no scripts, command-line tools or credentials: CLI To JS is instructions for the agent only. Our summary lists: Docker.

Does CLI To JS access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is CLI To JS safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does CLI To JS use?

CLI To JS is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does CLI To JS use?

About 1.1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to CLI To JS?

Skills that share tags, products or a category with CLI To JS: Logfire Instrumentation (pydantic/skills, 140 stars), Langgraph Testing Evaluation (soba-labs/langchain-agent-skills, 107 stars), Sap Cloud SDK AI (secondsky/sap-skills, 462 stars) and Coding Agent (mastra-ai/mastra, 29k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains CLI To JS?

millionco (a GitHub organization) maintains it in millionco/cli-to-js, which has 410 GitHub stars. The repository was last updated on April 17, 2026.

Source: millionco/cli-to-js on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.