Show HN: CLI to Churn Out CLIs

Chnmy1 pts0 comments

GitHub - chinmayrelkar/bawarchi: API spec to cli in a :flash: · GitHub

/" data-turbo-transient="true" />

Skip to content

Search/

Sign in<br>Sign upAppearance settings

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

chinmayrelkar

bawarchi

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Latest commit

History<br>48 Commits<br>48 Commits

Folders and files<br>NameNameLast commit message<br>Last commit date<br>.claude/skills/bawarchi

.claude/skills/bawarchi

.github/workflows

.github/workflows

cmd/bawarchi

cmd/bawarchi

internal

internal

.goreleaser.yaml

.goreleaser.yaml

LICENSE

LICENSE

README.md

README.md

ROADMAP.md

ROADMAP.md

go.mod

go.mod

go.sum

go.sum

View all files

Repository files navigation

bawarchi

Generate standalone CLIs from API specs. Point bawarchi at an OpenAPI 3.x or<br>Swagger 2.0 document (file or HTTPS URL) or a .proto file, and it compiles a<br>self-contained command-line tool for that API.

REST (OpenAPI 3.x / Swagger 2.0) — typed flags, request bodies, headers,<br>arrays, $ref resolution, and standardized exit codes.

gRPC (.proto) — generated CLIs shell out to<br>grpcurl; TLS by default.

Install

With Go:

go install github.com/chinmayrelkar/bawarchi/cmd/bawarchi@latest

Or download a prebuilt binary (linux/darwin/windows, amd64/arm64) from the<br>releases page — each<br>release includes a checksums.txt to verify the download.

Quick start (REST)

# Generate a CLI from a spec (file or https:// URL)<br>bawarchi add https://api.example.com/openapi.yaml

# Put it on your PATH<br>bawarchi install example-api

# Use it — auth and base URL come from environment variables<br>export EXAMPLE_API__API_KEY=sk-...<br>example-api --help

Quick start (gRPC)

bawarchi add ./greeter.proto<br>bawarchi install greeter

export GREETER__AUTH_TOKEN=...<br>greeter --help

Generated gRPC CLIs shell out to grpcurl and connect over TLS by default.<br>Control behavior with annotations in the .proto file (anywhere in the file,<br>as a // comment):

Annotation<br>Effect

// @server: host:port<br>Sets the default server address (falls back to localhost:50051 with a warning if omitted)

// @service: com.example.v1<br>Sets the fully-qualified gRPC service package/prefix used to build the method path

// @noauth<br>Marks the service as not requiring a bearer token; the generated CLI skips the auth-required check

Useful commands

Command<br>Description

bawarchi add<br>Generate, compile, and register a CLI (--dry-run to preview source, --name/--base-url to override)

bawarchi list<br>List generated CLIs

bawarchi info<br>Show details for a CLI

bawarchi update<br>Re-fetch the spec and regenerate (--source to switch spec sources, --base-url to override; falls back to the cached spec if the source is offline)

bawarchi install<br>Symlink a CLI onto your PATH (--dir to override the install directory, default ~/.local/bin)

bawarchi remove<br>Delete a CLI and its cached spec

bawarchi --version<br>Print the bawarchi version

Runtime configuration of generated CLIs

Generated CLIs read configuration from environment variables (prefix derived<br>from the API name, e.g. EXAMPLE_API__...):

NAME__API_KEY / NAME__TOKEN / NAME__CREDENTIALS — auth, depending on the spec's security scheme

NAME__BASE_URL — override the base URL

NAME__SERVER= — select one of a multi-server spec's predefined servers

gRPC: NAME__SERVER_ADDR — override the server address (overrides // @server: in the proto)

Generated REST CLIs exit 0 on success, 4 on a 4xx response, and 5 on a 5xx response.

Development

go build ./...<br>go vet ./...<br>go test ./...

CI runs gofmt, vet, build, and tests on every pull request and on every push to<br>main. Once CI is green on main, an auto-release workflow<br>automatically bumps a semver tag (feat: commits → minor, BREAKING CHANGE/!: → major,<br>everything else → patch) and runs GoReleaser to publish<br>cross-platform binaries — no manual tagging needed. .github/workflows/release.yml<br>remains as a manual fallback for hand-pushed tags.

License

MIT

About<br>API spec to cli in a :flash:<br>Resources<br>Readme<br>MIT license<br>Activity<br>Stars<br>0 stars<br>Watchers<br>0 watching<br>Forks<br>0 forks<br>Report repository

Releases

Packages

Used by

Contributors

Languages

You can’t perform that action at this time.

bawarchi spec clis generated github file

Related Articles