Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/formula-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Formula Check

on:
push:
branches: [main]
paths:
- 'Formula/**'
pull_request:
branches: [main]
paths:
- 'Formula/**'

jobs:
check:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@1f8e202ffddf94def7f42f6fa3a482e821489f9c

- name: Audit formula
run: |
brew audit --strict --online structkit

- name: Style check
run: |
brew style structkit

- name: Check for trailing whitespace
run: |
if grep -r '[[:blank:]]$' Formula/; then
echo "Error: Trailing whitespace found"
exit 1
fi
175 changes: 175 additions & 0 deletions Formula/structkit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
class Structkit < Formula
include Language::Python::Virtualenv

desc "YAML-first project scaffolding tool with AI/MCP integration"
homepage "https://structkit.app"
url "https://files.pythonhosted.org/packages/b5/4f/257ae3ff6e92d68e926eb56589de260b856c51e58f991dd28d6d4f5a39cb/structkit-3.2.1.tar.gz"
sha256 "7dcdce6debf3522dff61814a6cc80e60450a9b33c1a24f7bfb88b7ce663cf22c"
license "Apache-2.0"

depends_on "libsodium"
depends_on "python@3.12"

resource "PyYAML" do
url "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz"
sha256 "d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"
end

resource "requests" do
url "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz"
sha256 "55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"
end

resource "openai" do
url "https://files.pythonhosted.org/packages/86/29/d480df62c061ce065d33976b263806bad334597c178948e69907db256a77/openai-1.54.5.tar.gz"
sha256 "2aab4f9755a3e1e04d8a45ac1f4ce7b6948bab76646020c6386256d7e5cbb7e0"
end

resource "python-dotenv" do
url "https://files.pythonhosted.org/packages/bc/57/e84d88dfe0aec03b7a2d4327012c1627ab5f03652216c63d49846d7a6c58/python-dotenv-1.0.1.tar.gz"
sha256 "e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"
end

resource "jinja2" do
url "https://files.pythonhosted.org/packages/ed/55/39036716d19cab0747a5020fc7e907f362fbf48c984b14e62127f7e68e5d/jinja2-3.1.4.tar.gz"
sha256 "4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"
end

resource "PyGithub" do
url "https://files.pythonhosted.org/packages/16/ce/aa91d30040d9552c274e7ea8bd10a977600d508d579a4bb262b95eccf961/pygithub-2.5.0.tar.gz"
sha256 "e1613ac508a9be710920d26eb18b1905ebd9926aa49398e88151c1b526aad3cf"
end

resource "shtab" do
url "https://files.pythonhosted.org/packages/a9/e4/13bf30c7c30ab86a7bc4104b1c943ff2f56c1a07c6d82a71ad034bcef1dc/shtab-1.7.1.tar.gz"
sha256 "4e4bcb02eeb82ec45920a5d0add92eac9c9b63b2804c9196c1f1fdc2d039243c"
end

resource "colorlog" do
url "https://files.pythonhosted.org/packages/db/38/2992ff192eaa7dd5a793f8b6570d6bbe887c4fbbf7e72702eb0a693a01c8/colorlog-6.8.2.tar.gz"
sha256 "3e3e079a41feb5a1b64f978b5ea4f46040a94f11f0e8bbb8261e3dbbeca64d44"
end

resource "pydantic-ai-slim" do
url "https://files.pythonhosted.org/packages/df/fa/2ff0fbd714d0337b1db08ca725913294aaed5324a84c2caf7dfef75e894d/pydantic_ai_slim-0.0.14.tar.gz"
sha256 "f6c40470091566d8135af775508d0acd2e9c52181a1472e529f6e3bd0afa18a1"
end

resource "fastmcp" do
url "https://files.pythonhosted.org/packages/50/11/2ccd6219eb65692a298e764fa84a15fd756e03c811c7ea217129d6ca545f/fastmcp-2.4.0.tar.gz"
sha256 "a08d812939d16c0d4490bdbdaf17ab136f1bdaa8ddcc14a37e33335727343c05"
end

resource "markupsafe" do
url "https://files.pythonhosted.org/packages/b2/97/5d42485e71dfc078108a86d6de8fa46db44a1a9295e89c5d6d4a06e23a62/markupsafe-3.0.2.tar.gz"
sha256 "ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0"
end

resource "certifi" do
url "https://files.pythonhosted.org/packages/0f/bd/1d41ee578ce09523c81a15426705dd20969f5abf006d1afe8aeff0dd776a/certifi-2024.12.14.tar.gz"
sha256 "b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db"
end

resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/f2/4f/e1808dc01273379acc506d18f1504eb2d299bd4131743b9fc54d7be4df1e/charset_normalizer-3.4.0.tar.gz"
sha256 "223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"
end

resource "idna" do
url "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz"
sha256 "12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"
end

resource "urllib3" do
url "https://files.pythonhosted.org/packages/ed/63/22ba4ebfe7430b76388e7cd448d5478814d3032121827c12a2cc287e2260/urllib3-2.2.3.tar.gz"
sha256 "e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"
end

resource "pydantic" do
url "https://files.pythonhosted.org/packages/45/0f/27908242621b14e649a84e62b133de45f84c255eecb350ab02979844a788/pydantic-2.10.3.tar.gz"
sha256 "cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"
end

resource "pydantic-core" do
url "https://files.pythonhosted.org/packages/a6/9f/7de1f19b6aea45aeb441838782d68352e71bfa98ee6fa048d5041991b33e/pydantic_core-2.27.1.tar.gz"
sha256 "62a763352879b84aa31058fc931884055fd75089cccbd9d58bb6afd01141b235"
end

resource "annotated-types" do
url "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz"
sha256 "aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"
end

resource "typing-extensions" do
url "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz"
sha256 "1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"
end

resource "deprecated" do
url "https://files.pythonhosted.org/packages/92/14/1e41f504a246fc224d2ac264c227975427a85caf37c3979979edb9b1b232/Deprecated-1.2.14.tar.gz"
sha256 "e5323eb936458dccc2582dc6f9c322c852a775a27065ff2b0c4970b9d53d01b3"
end

resource "wrapt" do
url "https://files.pythonhosted.org/packages/95/4c/063a912e20bcef7124e0df97282a8af3ff3e4b603ce84c481d6d7346be0a/wrapt-1.16.0.tar.gz"
sha256 "5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"
end

resource "pynacl" do
url "https://files.pythonhosted.org/packages/a7/22/27582568be639dfe22ddb3902225f91f2f17ceff88ce80e4db396c8986da/PyNaCl-1.5.0.tar.gz"
sha256 "8ac7448f09ab85811607bdd21ec2464495ac8b7c66d146bf545b0f08fb9220ba"
end

resource "cffi" do
url "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz"
sha256 "1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"
end

resource "pycparser" do
url "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz"
sha256 "491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"
end

resource "pyjwt" do
url "https://files.pythonhosted.org/packages/e7/46/bd74733ff231675599650d3e47f361794b22ef3e3770998dda30d3b63726/pyjwt-2.10.1.tar.gz"
sha256 "3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953"
end

resource "anyio" do
url "https://files.pythonhosted.org/packages/9f/09/45b9b7a6d4e45c6bcb5bf61d19e3ab87df68e0601fa8c5293de3542546cc/anyio-4.6.2.post1.tar.gz"
sha256 "4c8bc31ccdb51c7f7bd251f51c609e038d63e34219b44aa86e47576389880b4c"
end

resource "sniffio" do
url "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz"
sha256 "f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"
end

resource "distro" do
url "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz"
sha256 "2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"
end

resource "httpx" do
url "https://files.pythonhosted.org/packages/78/82/08f8c936781f67d9e6b9eeb8a0c8b4e406136ea4c3d1f89a5db71d42e0e6/httpx-0.27.2.tar.gz"
sha256 "f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"
end

resource "httpcore" do
url "https://files.pythonhosted.org/packages/6a/41/d7d0a89eb493922c37d343b607bc1b5da7f5be7e383740b4753ad8943e90/httpcore-1.0.7.tar.gz"
sha256 "8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"
end

resource "h11" do
url "https://files.pythonhosted.org/packages/f5/38/3af3d3633a34a3316095b39c8e8fb4853a28a536e55d347bd8d8e9a14b03/h11-0.14.0.tar.gz"
sha256 "8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"
end

def install
virtualenv_install_with_resources
end

test do
assert_match "structkit", shell_output("#{bin}/structkit --version")
end
end
92 changes: 91 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,92 @@
# homebrew-structkit
Homebrew tap for StructKit (brew tap httpdss/structkit &amp;&amp; brew install structkit)

Homebrew tap for [StructKit](https://structkit.app) - YAML-first project scaffolding tool with AI/MCP integration.

## Installation

```bash
brew tap httpdss/structkit
brew install structkit
```

## Usage

Once installed, you can use the `structkit` command:

```bash
# Check version
structkit --version

# List available structures
structkit list

# Generate a project structure
structkit generate --vars module_name=my-module terraform/modules/generic ./my-module
```

For full documentation, visit [structkit.app/docs](https://structkit.app/docs/).

## Updating the Formula

When a new version of StructKit is released on PyPI, update the formula:

### Steps to bump the version:

1. **Download and calculate the SHA256 hash for the new version:**

```bash
VERSION=3.2.2 # Replace with the new version
curl -sL "https://files.pythonhosted.org/packages/source/s/structkit/structkit-${VERSION}.tar.gz" \
--output "/tmp/structkit-${VERSION}.tar.gz"
sha256sum "/tmp/structkit-${VERSION}.tar.gz"
```

2. **Update `Formula/structkit.rb`:**

- Update the `url` line with the new version number
- Update the `sha256` value with the hash from step 1
- Check if any new dependencies were added by extracting the tarball and reviewing `pyproject.toml`

3. **Test the formula locally:**

```bash
brew uninstall structkit # If previously installed
brew install --build-from-source Formula/structkit.rb
structkit --version
```

4. **Commit and push the changes:**

```bash
git add Formula/structkit.rb
git commit -m "Bump structkit to version ${VERSION}"
git push origin main
```

### Checking for new dependencies:

```bash
VERSION=3.2.2 # Replace with the new version
cd /tmp
tar -xzf "structkit-${VERSION}.tar.gz"
cat "structkit-${VERSION}/pyproject.toml" | grep -A 20 "dependencies ="
```

If new dependencies are added, you'll need to:

1. Download each dependency from PyPI
2. Calculate its SHA256 hash
3. Add a new `resource` block in `Formula/structkit.rb`

Example resource block:

```ruby
resource "package-name" do
url "https://files.pythonhosted.org/packages/.../package-name-X.Y.Z.tar.gz"
sha256 "abcdef123456..."
end
```

## License

This tap is maintained following Homebrew conventions. StructKit itself is licensed under Apache-2.0.