An open API service indexing awesome lists of open source software.

https://github.com/stackql/stackql-provider-homebrew

generate stackql provider for Homebrew from openapi specs
https://github.com/stackql/stackql-provider-homebrew

homebrew stackql stackql-provider

Last synced: 4 months ago
JSON representation

generate stackql provider for Homebrew from openapi specs

Awesome Lists containing this project

README

          

# `homebrew` provider for [`stackql`](https://github.com/stackql/stackql)

This repository is used to generate and document the `homebrew` provider for StackQL, allowing you to query Homebrew packages, formulas, and repositories using SQL-like syntax. The provider is built using the `@stackql/provider-utils` package, which provides tools for converting OpenAPI specifications into StackQL-compatible provider schemas.

## Prerequisites

To use the Homebrew provider with StackQL, you'll need:

1. StackQL CLI installed on your system (see [StackQL](https://github.com/stackql/stackql))
2. Basic understanding of Homebrew API endpoints

## 1. Download the Open API Specification

First, create an OpenAPI specification for the Homebrew API (since Homebrew doesn't provide an official one):

```bash
mkdir -p provider-dev/downloaded
# Create or download the homebrew OpenAPI spec
# You'll need to implement a script that generates an OpenAPI spec from Homebrew's API endpoints
python3 provider-dev/scripts/generate_homebrew_spec.py \
--output provider-dev/downloaded/openapi.json
```

## 2. Split into Service Specs

Next, split the OpenAPI specification into service-specific files:

```bash
rm -rf provider-dev/source/*
npm run split -- \
--provider-name homebrew \
--api-doc provider-dev/downloaded/openapi.json \
--svc-discriminator tag \
--output-dir provider-dev/source \
--overwrite \
--svc-name-overrides "$(cat <