- Category
- Developer Tools
- Rank
- No. 1412Tools index
Previous survey · No. 1383 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- millionco
- GitHub
- 408 stars
- Date
About
Wrap any CLI tool as a typed JavaScript/TypeScript API. Useful for giving agents structured access to shell tools.
What it does
It reads a program’s help output, turns commands and flags into a schema, then presents them as an object-oriented Node.js interface. Options become process arguments, while results expose buffered text, lines, parsed JSON, exit status, or streaming output.
Why it's ranked here
The idea is unusually practical for agent tooling, and the implementation covers more than simple argument conversion. Schema inspection, preflight validation, streaming, cancellation, generated declarations, and standalone wrappers make it useful. The explicit experimental warning matters, because help-text parsing and changing APIs limit confidence in long-lived integrations.
What's good
Commands are spawned with argument arrays instead of assembled shell strings during normal execution. Validation catches unknown flags, value-type errors, invalid choices, missing required inputs, and mutually exclusive options. Generated wrappers embed their runtime and do not depend on the package. Users can parse subcommands eagerly or only when needed.
Tradeoffs
Correctness depends on how accurately each program describes itself in help text. Root help is the default, so subcommand flags need extra parsing before validation. Static per-command autocomplete requires supplied generic types or generated declarations. The project calls itself very experimental and warns that APIs may change without notice.
How to use it well
Use it when a Node.js application or agent repeatedly drives well-documented command-line programs and benefits from validation, typed results, or streaming. Generate standalone wrappers when consumers should avoid a runtime dependency. It does not replace the underlying binaries, improve incomplete help output, or provide the adjacent HTTP-server layer by itself.
Technical notes+
packages/cli-to-js/src/index.ts loads or parses help text and delegates proxy construction. packages/cli-to-js/src/exec.ts uses node:child_process spawn with argument arrays, configurable cwd, env, timeout, abort signal, inherited stdio, callbacks, buffered results, and line-based async iteration. packages/cli-to-js/src/validate.ts implements schema checks plus Levenshtein suggestions. packages/cli-to-js/src/generate.ts emits TypeScript, JavaScript, or declaration output and embeds a small spawn runtime in standalone wrappers. packages/cli-to-js/src/cli.ts exposes generation, schema JSON, declaration, JavaScript, and subcommand-enrichment options. packages/cli-to-js/vite.config.ts produces ESM and declarations for Node, targeting Node 18. The root package.json declares a private pnpm monorepo and Node 22 or newer for repository development.
Observed
- License
- MIT
- Primary language
- TypeScript
- Install surface
- Published for npm installation as cli-to-js
- Interfaces
- Node.js library API and command-line generator
- Module format
- ESM build with generated TypeScript declarations
- Generated output
- Standalone JavaScript or TypeScript wrappers can embed their own runtime
- Repository structure
- Private pnpm monorepo containing cli-to-js, js-to-cli, and cli-to-server packages
Read from README.md, package.json, packages/cli-to-js/vite.config.ts, packages/js-to-cli/vite.config.ts, packages/cli-to-server/vite.config.ts, packages/cli-to-js/src/cli.ts, packages/js-to-cli/src/cli.ts, packages/cli-to-js/src/exec.ts, packages/cli-to-js/src/index.ts, packages/js-to-cli/src/index.ts, packages/cli-to-server/src/cli.ts, packages/cli-to-js/src/cli-api.ts, packages/cli-to-js/src/generate.ts, packages/cli-to-js/src/validate.ts, packages/cli-to-server/src/index.ts.
What it can do
Wrap CLI tools as JavaScript functions
Command line tool or executable → JavaScript/TypeScript function wrapper
Generate TypeScript type definitions for CLI tools
CLI tool with its parameters and options → TypeScript type definitions
Create structured API interfaces for shell commands
Shell commands and their arguments → Structured JavaScript API
Enable programmatic access to command line utilities
CLI tool executable and configuration → Callable JavaScript methods
Provide typed interfaces for agent integration with shell tools
Command line tools and their schemas → Agent-compatible structured interfaces
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.
