Skip to content

Commit dfdfc05

Browse files
rbbydotdevclaude
andcommitted
Rename CLI binary from-openapi → spac-from-openapi
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f917406 commit dfdfc05

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ api.group('/admin', g => {
102102
### Generate spac code from an existing OpenAPI spec
103103

104104
```sh
105-
npx from-openapi spec.json --out ./generated
106-
npx from-openapi spec.json --out ./generated --strip '/accounts/{account_id}'
105+
npx spac-from-openapi spec.json --out ./generated
106+
npx spac-from-openapi spec.json --out ./generated --strip '/accounts/{account_id}'
107107
```
108108

109109
See [`@spec-spac/from-openapi` README](packages/from-openapi) for full CLI options.

packages/from-openapi/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ npm install @spec-spac/from-openapi
1212

1313
```sh
1414
# Preview what will be generated (dry-run)
15-
npx from-openapi spec.json
15+
npx spac-from-openapi spec.json
1616

1717
# Generate to a directory
18-
npx from-openapi spec.json --out ./generated
18+
npx spac-from-openapi spec.json --out ./generated
1919

2020
# Strip path prefixes before grouping
21-
npx from-openapi spec.json --out ./generated \
21+
npx spac-from-openapi spec.json --out ./generated \
2222
--strip '/accounts/{account_id}' --strip '/zones/{zone_id}'
2323

2424
# Enable source map support in generated code
25-
npx from-openapi spec.json --out ./generated --debug
25+
npx spac-from-openapi spec.json --out ./generated --debug
2626
```
2727

2828
### Options

packages/from-openapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"main": "dist/index.js",
1616
"types": "dist/index.d.ts",
1717
"bin": {
18-
"from-openapi": "./dist/cli.js"
18+
"spac-from-openapi": "./dist/cli.js"
1919
},
2020
"exports": {
2121
".": {

packages/from-openapi/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { generate } from "./index";
66
const args = process.argv.slice(2);
77

88
function usage() {
9-
console.log(`Usage: from-openapi <spec.json> [options]
9+
console.log(`Usage: spac-from-openapi <spec.json> [options]
1010
1111
Options:
1212
--out <dir> Output directory (required for generate, omit for dry-run)

packages/website/content/docs/guides/from-openapi-cli.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: from-openapi CLI
2+
title: spac-from-openapi CLI
33
description: Generate spac TypeScript from existing OpenAPI specs
44
---
55

@@ -18,7 +18,7 @@ npx @spec-spac/from-openapi spec.json
1818
## Usage
1919

2020
```bash
21-
from-openapi <spec.json> [options]
21+
spac-from-openapi <spec.json> [options]
2222
```
2323

2424
Without `--out`, runs in **dry-run mode** — prints file list, stats, and group breakdown without writing anything.
@@ -40,7 +40,7 @@ With `--out`, generates spac TypeScript files to the output directory.
4040
### Dry run — preview what will be generated
4141

4242
```bash
43-
from-openapi petstore.json
43+
spac-from-openapi petstore.json
4444
```
4545

4646
Output:
@@ -63,15 +63,15 @@ Dry run — 8 files generated in 125ms
6363
### Generate to a directory
6464

6565
```bash
66-
from-openapi petstore.json --out ./generated
66+
spac-from-openapi petstore.json --out ./generated
6767
```
6868

6969
### Strip path prefixes for cleaner grouping
7070

7171
When your API has paths scoped under context prefixes (like account or zone IDs), use `--strip` to remove them before grouping:
7272

7373
```bash
74-
from-openapi cloudflare.json --out ./generated \
74+
spac-from-openapi cloudflare.json --out ./generated \
7575
--strip '/accounts/{account_id}' \
7676
--strip '/zones/{zone_id}'
7777
```
@@ -81,7 +81,7 @@ Without `--strip`, a path like `/accounts/{account_id}/dns/records` would create
8181
### Enable source maps
8282

8383
```bash
84-
from-openapi spec.json --out ./generated --debug
84+
spac-from-openapi spec.json --out ./generated --debug
8585
```
8686

8787
The `--debug` flag adds `debug: true` to the generated `Api` constructor, enabling source map output when calling `.emit({ sourceMap: true })`.

0 commit comments

Comments
 (0)