Skip to content

feat(cli): add Homebrew formula - #171

Merged
dillonstreator merged 1 commit into
mainfrom
feat/homebrew-formula
Nov 23, 2026
Merged

dillonstreator merged 1 commit into
mainfrom
feat/homebrew-formula

Conversation

@dillonstreator

Copy link
Copy Markdown
Member

Closes #61

Summary

  • Formula/crypt-fyi.rb: a Homebrew formula for the CLI, kept in this repo so no separate tap repo is needed. It follows the standard Homebrew pattern for Node packages (depends_on "node", npm install *std_npm_args, symlinks libexec/bin/*) and installs the published npm tarball for @crypt.fyi/cli@0.2.0, pinned by sha256. The test do block checks cfyi --version against the formula version, checks that --help lists the encrypt command, and runs an argument-validation error path with no network access.
  • Install:
    brew tap osbytes/crypt-fyi https://github.com/osbytes/crypt.fyi
    brew install crypt-fyi
    The tap name uses crypt-fyi because Homebrew tap names can't contain dots. The URL argument points at this repo.
  • release.yml / new homebrew job: runs after a release that published @crypt.fyi/cli, and also on manual workflow_dispatch runs to re-sync. It downloads the new tarball from registry.npmjs.org, with retries in case the registry lags a fresh publish. It checks the download against npm's dist.integrity, rewrites url and sha256 in the formula, and commits chore(cli): bump Homebrew formula to X.Y.Z straight to main. The main ruleset only blocks deletion and non-fast-forward pushes, and pushes made with GITHUB_TOKEN don't trigger more workflow runs. It uses only actions/checkout@v7 (same pin as the other jobs) plus shell; no third-party actions.
  • Docs: Homebrew install section in packages/cli/README.md; root README feature list and "Releasing packages" notes.
  • Changeset: empty changeset added, since no publishable package changes behavior (the CLI README edit alone would otherwise trip the changeset check).

Testing

  • Downloaded the 0.2.0 tarball from the registry and confirmed its sha512 matches npm dist.integrity. The sha256 in the formula comes from that file.
  • Ran a global npm install of that tarball (the same as std_npm_args) and ran each test do command by hand. --version printed 0.2.0, --help listed encrypt, and the content+file combination exited 1 with the expected message.
  • Checked the workflow's sed substitution against the formula locally. release.yml parses as YAML and passes Prettier, and pnpm format:check and changeset status --since=origin/main both pass.
  • Not verified: brew install, brew test and brew audit, and ruby -c. I wrote this on Windows without Homebrew or Ruby, so it is worth running these on macOS or Linux before merging:
    brew tap osbytes/crypt-fyi https://github.com/osbytes/crypt.fyi  # after merge, or tap a local clone
    brew install --build-from-source crypt-fyi && brew test crypt-fyi && brew audit --strict crypt-fyi
  • The homebrew workflow job only runs on the next CLI release, so it is untested end to end.

@dillonstreator
dillonstreator merged commit 915a9e7 into main Nov 23, 2026
8 checks passed
@dillonstreator
dillonstreator deleted the feat/homebrew-formula branch November 23, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Homebrew formula for CLI

1 participant