Bawarchi simplifies the development of command-line interfaces by transforming API specifications into standalone CLIs. By providing either an OpenAPI or gRPC (.proto) document, users can quickly generate self-contained tools that streamline API interactions with minimal setup required.
bawarchi is a powerful tool designed for the seamless generation of standalone command-line interfaces (CLIs) from API specifications. It supports widely-used formats such as OpenAPI 3.x, Swagger 2.0, and gRPC, enabling developers to quickly create self-contained command-line tools tailored to their API needs.
.proto files, bawarchi generates CLIs that utilize grpcurl, complete with TLS encryption by default, ensuring secure communications.To generate a CLI from a specification:
bawarchi add https://api.example.com/openapi.yaml
Next, install it into your PATH:
bawarchi install example-api
Use the generated CLI with environment variables managing authentication and base URL:
export EXAMPLE_API__API_KEY=sk-...
example-api --help
To generate a CLI from a .proto file:
bawarchi add ./greeter.proto
bawarchi install greeter
export GREETER__AUTH_TOKEN=...
greeter --help
Bawarchi allows runtime configuration of generated CLIs via environment variables, enabling easy adjustments such as authentication tokens and server addresses.
bawarchi add <spec>: Generate and register a new CLI.bawarchi list: Display all generated CLIs.bawarchi info <name>: Provide details about a specific CLI.bawarchi update <name>: Refresh the spec and regenerate the CLI.bawarchi install <name>: Make a CLI accessible on your PATH.bawarchi remove <name>: Delete a CLI and its cached specification.bawarchi --version: Output the current version of bawarchi.Bawarchi has been designed with robust development and continuous integration processes. The project utilizes Go tools for building, testing, and ensuring code quality. CI processes include automatic versioning and binary releases, streamlining the development lifecycle.
For more information and to explore the full capabilities of bawarchi, visit its GitHub repository.
No comments yet.
Sign in to be the first to comment.