Add API client generator command that: - Parses Laravel routes file (routes/api.php) - Generates TypeScript client with DTOs (--ts, default) - Generates JavaScript client (--js) - Generates OpenAPI 3.0 specification (--openapi) - Supports apiResource routes Migrated from core-claude PR #52. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
27 lines
552 B
Markdown
27 lines
552 B
Markdown
---
|
|
name: api
|
|
description: Generate TypeScript/JavaScript API client from Laravel routes
|
|
args: generate [--ts|--js|--openapi]
|
|
---
|
|
|
|
# API Client Generator
|
|
|
|
Generate a TypeScript/JavaScript API client or an OpenAPI specification from your Laravel routes.
|
|
|
|
## Usage
|
|
|
|
Generate a TypeScript client (default):
|
|
`/code:api generate`
|
|
`/code:api generate --ts`
|
|
|
|
Generate a JavaScript client:
|
|
`/code:api generate --js`
|
|
|
|
Generate an OpenAPI specification:
|
|
`/code:api generate --openapi`
|
|
|
|
## Action
|
|
|
|
```bash
|
|
"${CLAUDE_PLUGIN_ROOT}/scripts/api-generate.sh" "$@"
|
|
```
|