https://github.com/ryan-prayoga/brunogen
Generate Bruno collections from Laravel, Express.js, and Go API codebases by inferring OpenAPI from source code.
https://github.com/ryan-prayoga/brunogen
api bruno cli codegen express golang laravel openapi
Last synced: about 1 month ago
JSON representation
Generate Bruno collections from Laravel, Express.js, and Go API codebases by inferring OpenAPI from source code.
- Host: GitHub
- URL: https://github.com/ryan-prayoga/brunogen
- Owner: ryan-prayoga
- License: mit
- Created: 2026-03-25T09:11:24.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-05-13T18:31:05.000Z (about 2 months ago)
- Last Synced: 2026-05-13T20:26:34.704Z (about 2 months ago)
- Topics: api, bruno, cli, codegen, express, golang, laravel, openapi
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/brunogen
- Size: 1.01 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# brunogen
[](https://www.npmjs.com/package/brunogen)
[](https://nodejs.org/)
[](https://github.com/ryan-prayoga/brunogen/actions/workflows/ci.yml)
Brunogen scans a Laravel, Express.js, or Go API codebase, normalizes what it finds into OpenAPI, and emits a Bruno collection you can try immediately.
Laravel is the strongest path today, with materially richer request and response inference. Express.js and Go support are already usable for conventional codebases, but they remain more heuristic.
Laravel
FormRequest + Resource response
Open Laravel demo
Express
Mounted router + local response helper
Open Express demo
Go
Gin bind + direct JSON response
Open Go demo
## Quick Start
Best first run: start with Laravel if you want the most complete inference path in under a minute.
```bash
npm i -g brunogen
brunogen init
brunogen generate
```
Default output:
- `.brunogen/openapi.yaml`
- `.brunogen/bruno/`
If you are testing from this repository checkout instead of an installed package, run `npm install`, `npm run build`, and `npm link` once from the repository root first.
## What You Get
- `openapi.yaml` generated directly from routes, handlers, controllers, and request/response patterns
- A ready-to-open Bruno collection under `.brunogen/bruno/`
- Warnings for patterns Brunogen could not infer confidently
## Framework Paths
| Framework | Current fit | First place to try | Demo |
| --- | --- | --- | --- |
| Laravel | Strongest path today | `cd tests/fixtures/laravel && brunogen init && brunogen generate` | [Laravel demo](https://github.com/ryan-prayoga/brunogen/blob/main/docs/demo/laravel-happy-path/README.md) |
| Express | Useful, still heuristic | `cd tests/fixtures/express && brunogen init && brunogen generate` | [Express demo](https://github.com/ryan-prayoga/brunogen/blob/main/docs/demo/express-happy-path/README.md) |
| Go | Experimental | `cd tests/fixtures/gin && brunogen init && brunogen generate` | [Go demo](https://github.com/ryan-prayoga/brunogen/blob/main/docs/demo/go-happy-path/README.md) |
To refresh the checked-in demo snapshots after an intentional output change:
```bash
npm run demo:laravel
npm run demo:express
npm run demo:go
```
## Commands
- `init` creates a starter config in the current directory
- `generate` scans the current project and writes OpenAPI plus a Bruno collection
- `watch` regenerates when supported source files change
- `validate` checks generated OpenAPI output
- `doctor` shows environment and framework detection details
## Works Best Today
- Laravel route scanning from `routes/*.php`, including groups, prefixes, middleware hints, and `apiResource`
- Laravel request inference from FormRequest rules, inline validation, and common manual accessors such as `query`, `header`, typed accessors, `has`, `filled`, `safe()->only(...)`, and `enum(...)`
- Laravel response inference for direct arrays, `response()->json(...)`, `noContent()`, same-controller helpers, `JsonResource`, `->additional(...)`, and common abort/error/not-found paths
- Express scanning for mounted routers, straightforward request access patterns, and local response helpers
- Go Gin, Fiber, and Echo scanning for conventional route registration and direct JSON responses
- Bruno export with environments, baseline auth support, and native response `example {}` blocks
## How It Works
```text
source code
-> framework adapter
-> normalized endpoint model
-> openapi.yaml
-> Bruno collection
```
OpenAPI becomes the internal source of truth after scanning. Bruno is the output target.
## Read More
- [Detailed reference, examples, config, and support matrix](https://github.com/ryan-prayoga/brunogen/blob/main/docs/reference.md)
- [CHANGELOG.md](https://github.com/ryan-prayoga/brunogen/blob/main/CHANGELOG.md)
- [CONTRIBUTING.md](https://github.com/ryan-prayoga/brunogen/blob/main/CONTRIBUTING.md)
- [docs/release-checklist.md](https://github.com/ryan-prayoga/brunogen/blob/main/docs/release-checklist.md)