@flyreq/cli
v0.1.0
Published
FeiFly flyreq CLI — generate bus API templates from endpoints JSON
Downloads
195
Readme
@flyreq/cli
Codegen and configuration CLI for
flyreq. Ships inside
flyreq, so if you installed that you
already have the flyreq command.
pnpm add -D @flyreq/cliGenerate an API client
flyreq gen ./api.json -o ./src/generated
flyreq gen https://api-platform.example.com/export -o ./src/generatedEach endpoint in the JSON becomes a typed function built on the flyreq
client, with path parameters, per-call options and a barrel index.ts. Treat
the output as generated — layer call options at the call site instead of
editing it.
Set platform in flyreq.config.json to omit the URL:
{ "platform": "https://api-platform.example.com/export" }Select a transport
flyreq use fetch
flyreq use axiosThis writes to flyreq.config.json. Since browsers cannot read it at runtime,
it takes effect through setupFlyreqFromConfig() from flyreq/node; browser
apps pass backend to setupFlyreq() directly.
License
MIT
