Installation
Install ByteKit globally to use the CLI:Available Commands
The CLI supports three main modes of operation:1. Simple API Fetching
Fetch and display API responses without any type generation:2. Type Generation
Generate TypeScript types from a single API endpoint:3. Swagger/OpenAPI Integration
Generate all TypeScript DTOs from a Swagger specification:Command-Line Options
| Option | Description | Default |
|---|---|---|
--type | Generate TypeScript types from API response | Saves to src/types/{endpoint}.ts |
--swagger | Generate all TypeScript DTOs from Swagger/OpenAPI spec | Saves to src/types/api-docs.ts |
--method=<METHOD> | HTTP method (GET, POST, PUT, DELETE, PATCH) | GET |
--body=<json> | JSON body for the request | None |
--header=<key:val> | Custom HTTP header (can be used multiple times) | None |
--headers=<key:val> | Alias for --header | None |
--help, -h | Display help information | - |
Help Output
Runbytekit --help to see all available options:
Common Use Cases
Inspecting an API Endpoint
Quickly test an API endpoint without writing any code:Generating Types for a REST API
Fetch user data and generate TypeScript interfaces:src/types/users.ts with inferred types.
Working with POST Requests
Generate types from a POST endpoint with a request body:Adding Custom Headers
Include authentication or custom headers:Multiple Headers
Add multiple headers to your request:Error Handling
The CLI provides clear error messages for common issues: Missing URL:Output Directory
Generated type files are automatically saved to:- Type Generation:
src/types/{endpoint}.ts - Swagger Generation:
src/types/api-docs.ts
src/types/ directory if it doesn’t exist.