Skip to content

Commit 746a206

Browse files
committed
remove emdashes from README, rewrite agent pitch
1 parent 27fc7e1 commit 746a206

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **Warning:** This project is very experimental. APIs may change without notice.
44
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.
66

77
```ts
88
import { convertCliToJs } from "cli-to-js";
@@ -25,9 +25,9 @@ const docker = await convertCliToJs("docker");
2525
await docker.build({ tag: `my-app:${commits[0].slice(0, 7)}`, file: "Dockerfile", _: ["."] });
2626
```
2727

28-
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.
2929

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` loopthe 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.
3131

3232
## Install
3333

@@ -66,7 +66,7 @@ Here's how JS option keys map to CLI flags:
6666

6767
## TypeScript
6868

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.
7070

7171
For per-subcommand option types, pass a generic:
7272

@@ -121,11 +121,11 @@ console.log(commitSchema.flags);
121121
await git.$parse();
122122
```
123123

124-
Handles commander-style aliases (`init|setup`, `add|install`) — the primary name is used.
124+
Handles commander-style aliases (`init|setup`, `add|install`). The primary name is used.
125125

126126
## Validation
127127

128-
Validate options against the parsed schema before running a command. Returns an array of structured errors empty means valid.
128+
Validate options against the parsed schema before running a command. Returns an array of structured errors (empty means valid).
129129

130130
```ts
131131
const git = await convertCliToJs("git", { subcommands: true });
@@ -237,7 +237,7 @@ npx cli-to-js git --dts -o git.d.ts # generate type declarations only
237237
npx cli-to-js git --json # dump raw schema as JSON
238238
```
239239

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.
241241

242242
## API
243243

@@ -286,7 +286,7 @@ The returned proxy is both callable and has subcommand methods:
286286
| `onStdout` | `(data: string) => void` | - | Real-time stdout callback |
287287
| `onStderr` | `(data: string) => void` | - | Real-time stderr callback |
288288

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" }`.
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" }`.
290290

291291
### `CommandResult`
292292

packages/cli-to-js/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **Warning:** This project is very experimental. APIs may change without notice.
44
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.
66

77
```ts
88
import { convertCliToJs } from "cli-to-js";
@@ -25,9 +25,9 @@ const docker = await convertCliToJs("docker");
2525
await docker.build({ tag: `my-app:${commits[0].slice(0, 7)}`, file: "Dockerfile", _: ["."] });
2626
```
2727

28-
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.
2929

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` loopthe 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.
3131

3232
## Install
3333

@@ -66,7 +66,7 @@ Here's how JS option keys map to CLI flags:
6666

6767
## TypeScript
6868

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.
7070

7171
For per-subcommand option types, pass a generic:
7272

@@ -121,11 +121,11 @@ console.log(commitSchema.flags);
121121
await git.$parse();
122122
```
123123

124-
Handles commander-style aliases (`init|setup`, `add|install`) — the primary name is used.
124+
Handles commander-style aliases (`init|setup`, `add|install`). The primary name is used.
125125

126126
## Validation
127127

128-
Validate options against the parsed schema before running a command. Returns an array of structured errors empty means valid.
128+
Validate options against the parsed schema before running a command. Returns an array of structured errors (empty means valid).
129129

130130
```ts
131131
const git = await convertCliToJs("git", { subcommands: true });
@@ -237,7 +237,7 @@ npx cli-to-js git --dts -o git.d.ts # generate type declarations only
237237
npx cli-to-js git --json # dump raw schema as JSON
238238
```
239239

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.
241241

242242
## API
243243

@@ -286,7 +286,7 @@ The returned proxy is both callable and has subcommand methods:
286286
| `onStdout` | `(data: string) => void` | - | Real-time stdout callback |
287287
| `onStderr` | `(data: string) => void` | - | Real-time stderr callback |
288288

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" }`.
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" }`.
290290

291291
### `CommandResult`
292292

0 commit comments

Comments
 (0)