A versatile tool to generate API clients from various API specification formats. Convert Postman Collections, OpenAPI/Swagger specs, or cURL commands into type-safe API clients for multiple programming languages.
-
Multiple Input Formats:
- OpenAPI/Swagger Specifications
- Postman Collections
- cURL Commands
- (Coming soon: RAML, API Blueprint)
-
Supported Output Languages:
- TypeScript (with Axios)
- Python
- Java
- Go
- C#
- JavaScript
-
AI-Enhanced Specifications:
- Enriched API documentation
- Relationship mapping between endpoints
- Visual API flow diagrams (Mermaid)
# Clone the repository
git clone https://github.com/mahi424/api-client-builder.git
# Install dependencies
cd api-client-builder
npm install
# Link globally (for CLI usage)
npm linkapi-client-builder -i ./swagger.json -t openapi -l typescript -o ./clientOptions:
-i, --input: Path to input file-t, --type: Input type (openapi, postman, curl)-l, --language: Target language-o, --output: Output directory (default: ./generated-client)
api-client-builderFollow the prompts to:
- Select input file
- Specify input type
- Choose target language
- Set output directory
# Run tests
npm run test
# Generate client (using default options)
npm run generate
# Start interactive mode
npm run interactiveapi-client-builder -i ./collections/api.postman.json -t postman -l typescript -o ./typescript-clientapi-client-builder -i ./specs/swagger.json -t openapi -l python -o ./python-clientapi-client-builder -i ./curls/request.txt -t curl -l java -o ./java-clientapi-client-builder/
├── src/
│ ├── cli/ # CLI implementation
│ ├── client-generator/ # Client generation logic
│ ├── open-api-converter/ # Format converters
│ └── spec-enricher/ # AI enhancement
├── input/
│ └── samples/ # Example input files
└── generated-clients/ # Generated output
- @openapitools/openapi-generator-cli: OpenAPI client generation
- postman-to-openapi: Postman collection conversion
- curlconverter: cURL command parsing
- openai: AI-powered spec enhancement
- commander: CLI implementation
- inquirer: Interactive prompts
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
GPL v3