Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# openapi-gen

Generate Effect http clients from openapi specification.

## Usage

```bash
npx @tim-smart/openapi-gen --spec <path-to-spec> --name <ClientName> > src/Client.ts
```

## Options

| Option | Alias | Description | Default |
| ------------- | ----- | --------------------------------------------- | -------- |
| `--spec` | `-s` | The OpenAPI spec file path or URL (json/yaml) | Required |
| `--name` | `-n` | The name of the generated client | `Client` |
| `--type-only` | `-t` | Generate a type-only client without schemas | `false` |

## Example

```bash
npx @tim-smart/openapi-gen --spec ./openapi.yaml > src/Client.ts
```
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"version": "changeset version",
"release": "pnpm run build && changeset publish",
"test": "pnpm coverage",
"test": "vitest run",
"clean": "rm -rf dist/*",
"build": "tsup && pnpm copy-package-json",
"build:ts": "tsup",
Expand All @@ -29,14 +29,16 @@
"@effect/cli": "^0.61.3",
"@effect/platform": "^0.82.3",
"@effect/platform-node": "^0.81.0",
"@effect/vitest": "^0.27.0",
"@types/node": "^22.15.18",
"@types/swagger2openapi": "^7.0.4",
"effect": "^3.15.2",
"prettier": "^3.5.3",
"swagger2openapi": "^7.0.8",
"tsup": "^8.4.0",
"tsx": "^4.19.4",
"typescript": "^5.8.3"
"typescript": "^5.8.3",
"vitest": "^4.0.8"
},
"dependencies": {
"yaml": "^2.8.0"
Expand Down
Loading