You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
> **Warning:** This project is very experimental. APIs may change without notice.
4
4
5
-
Turn any CLI into a JavaScript API — automatically. Give it a binary name, it reads `--help`, and hands you back a fully typed object where subcommands are methods, flags are options, and everything just works.
5
+
Turn any CLI into a JavaScript API, automatically. Give it a binary name, it reads `--help`, and hands you back a fully typed object where subcommands are methods, flags are options, and everything just works.
No manual wrappers. No codegen step. No config. One function call turns `git`, `docker`, `kubectl`, `ffmpeg` — anything with `--help` — into a typed, callable API. Compose them together with plain JavaScript.
28
+
No manual wrappers. No codegen step. No config. One function call turns `git`, `docker`, `kubectl`, `ffmpeg`, or anything with `--help` into a typed, callable API. Compose them together with plain JavaScript.
29
29
30
-
**Built for AI agents.**Agents call CLIs dynamically but hallucinate flag names and forget required args. `$validate` catches mistakes before spawning a process, with did-you-mean suggestions an agent can self-correct from. `$spawn` returns a standard async iterator, so piping and streaming is just a `for await` loop — the most in-distribution JS pattern for any model.
30
+
**Why this matters for AI agents.**LLM-powered agents need to call CLI tools, but they work best with structured APIs, not raw shell strings. `cli-to-js` lets an agent introspect any binary on the system, get a typed interface, and call it safely. `$validate` catches hallucinated flag names before spawning a process and returns did-you-mean suggestions the agent can self-correct from in a single retry. `$spawn` returns a standard async iterator, so streaming and piping is just a `for await` loop, the most common JS pattern in any model's training data.
31
31
32
32
## Install
33
33
@@ -66,7 +66,7 @@ Here's how JS option keys map to CLI flags:
66
66
67
67
## TypeScript
68
68
69
-
The API is fully typed out of the box — every subcommand returns `Promise<CommandResult>`, and `$schema`, `$parse`, `$spawn` are all properly typed. No codegen needed.
69
+
The API is fully typed out of the box. Every subcommand returns `Promise<CommandResult>`, and `$schema`, `$parse`, `$spawn` are all properly typed. No codegen needed.
@@ -237,7 +237,7 @@ npx cli-to-js git --dts -o git.d.ts # generate type declarations only
237
237
npx cli-to-js git --json # dump raw schema as JSON
238
238
```
239
239
240
-
The generated code is **standalone** — it embeds a tiny runtime (spawn + options-to-args) and has zero dependencies on `cli-to-js`. Drop it into any project and it just works.
240
+
The generated code is **standalone**. It embeds a tiny runtime (spawn + options-to-args) and has zero dependencies on `cli-to-js`. Drop it into any project and it just works.
241
241
242
242
## API
243
243
@@ -286,7 +286,7 @@ The returned proxy is both callable and has subcommand methods:
Color output (`FORCE_COLOR`, `CLICOLOR_FORCE`) is auto-detected — it's enabled when streaming callbacks are provided and the parent process is connected to a TTY. To force it manually, pass `env: { ...process.env, FORCE_COLOR: "1" }`.
289
+
Color output (`FORCE_COLOR`, `CLICOLOR_FORCE`) is auto-detected. It's enabled when streaming callbacks are provided and the parent process is connected to a TTY. To force it manually, pass `env: { ...process.env, FORCE_COLOR: "1" }`.
Copy file name to clipboardExpand all lines: packages/cli-to-js/README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
> **Warning:** This project is very experimental. APIs may change without notice.
4
4
5
-
Turn any CLI into a JavaScript API — automatically. Give it a binary name, it reads `--help`, and hands you back a fully typed object where subcommands are methods, flags are options, and everything just works.
5
+
Turn any CLI into a JavaScript API, automatically. Give it a binary name, it reads `--help`, and hands you back a fully typed object where subcommands are methods, flags are options, and everything just works.
No manual wrappers. No codegen step. No config. One function call turns `git`, `docker`, `kubectl`, `ffmpeg` — anything with `--help` — into a typed, callable API. Compose them together with plain JavaScript.
28
+
No manual wrappers. No codegen step. No config. One function call turns `git`, `docker`, `kubectl`, `ffmpeg`, or anything with `--help` into a typed, callable API. Compose them together with plain JavaScript.
29
29
30
-
**Built for AI agents.**Agents call CLIs dynamically but hallucinate flag names and forget required args. `$validate` catches mistakes before spawning a process, with did-you-mean suggestions an agent can self-correct from. `$spawn` returns a standard async iterator, so piping and streaming is just a `for await` loop — the most in-distribution JS pattern for any model.
30
+
**Why this matters for AI agents.**LLM-powered agents need to call CLI tools, but they work best with structured APIs, not raw shell strings. `cli-to-js` lets an agent introspect any binary on the system, get a typed interface, and call it safely. `$validate` catches hallucinated flag names before spawning a process and returns did-you-mean suggestions the agent can self-correct from in a single retry. `$spawn` returns a standard async iterator, so streaming and piping is just a `for await` loop, the most common JS pattern in any model's training data.
31
31
32
32
## Install
33
33
@@ -66,7 +66,7 @@ Here's how JS option keys map to CLI flags:
66
66
67
67
## TypeScript
68
68
69
-
The API is fully typed out of the box — every subcommand returns `Promise<CommandResult>`, and `$schema`, `$parse`, `$spawn` are all properly typed. No codegen needed.
69
+
The API is fully typed out of the box. Every subcommand returns `Promise<CommandResult>`, and `$schema`, `$parse`, `$spawn` are all properly typed. No codegen needed.
@@ -237,7 +237,7 @@ npx cli-to-js git --dts -o git.d.ts # generate type declarations only
237
237
npx cli-to-js git --json # dump raw schema as JSON
238
238
```
239
239
240
-
The generated code is **standalone** — it embeds a tiny runtime (spawn + options-to-args) and has zero dependencies on `cli-to-js`. Drop it into any project and it just works.
240
+
The generated code is **standalone**. It embeds a tiny runtime (spawn + options-to-args) and has zero dependencies on `cli-to-js`. Drop it into any project and it just works.
241
241
242
242
## API
243
243
@@ -286,7 +286,7 @@ The returned proxy is both callable and has subcommand methods:
Color output (`FORCE_COLOR`, `CLICOLOR_FORCE`) is auto-detected — it's enabled when streaming callbacks are provided and the parent process is connected to a TTY. To force it manually, pass `env: { ...process.env, FORCE_COLOR: "1" }`.
289
+
Color output (`FORCE_COLOR`, `CLICOLOR_FORCE`) is auto-detected. It's enabled when streaming callbacks are provided and the parent process is connected to a TTY. To force it manually, pass `env: { ...process.env, FORCE_COLOR: "1" }`.
0 commit comments