Repository navigation
Add nodespace-cli formula for the headless CLI install path - #2
Merged
mstomar125 merged 2 commits intoAug 19, 2026
Merged
Conversation
There was no Homebrew route to a headless CLI at all -- the existing `nodespace` cask installs the full GUI app, and the only CLI-only path was `cargo install nodespace-cli`, which needs a Rust toolchain. This adds a formula (distinct from the cask) that installs prebuilt `nodespace` and `nodespaced` binaries from nodespace-core's GitHub Releases, with a `brew services`-manageable daemon. See NodeSpaceAI/nodespace-core#2146. v0.2.0 has no macOS Intel build; the formula raises a clear odie() message on that platform/arch combination rather than failing obscurely. Every digest is computed locally from bytes actually downloaded from the release, never copied from the release's own SHA256SUMS file -- which, it turns out, lists checksums for nodespace-x86_64-apple-darwin / nodespaced-x86_64-apple-darwin that are not actually present as release assets (verified against `gh release view v0.2.0 --json assets`; filed separately as a nodespace-core follow-up). Verified in an isolated Homebrew prefix (a throwaway `brew` clone, not this machine's real Homebrew): `brew style`/`brew audit --strict` clean aside from two documented, intentional trade-offs (an explicit `version` stanza kept for future single-line version bumps despite being "redundant" per audit, and `license :cannot_represent` since nodespace-core's actual license, FSL-1.1-Apache-2.0, has no SPDX identifier). A real `brew install` caught and fixed a genuine bug: `#{version}` inside the nested `resource "nodespaced" do` block resolved against the Resource's own empty version, not the Formula's, 404'ing on a URL with an empty version segment -- fixed by capturing the Formula's version into a local variable before the resource block. `brew test`, `brew services info`, and `brew uninstall` all verified working. Co-Authored-By: Claude <[email protected]>
… claim
Three real bugs found via actually running this in an isolated Homebrew
prefix, not just reading the source:
- brew style --fix's automatic stanza reordering (on_macos/on_linux moved
ahead of conflicts_with, per FormulaAudit/ComponentsOrder) moved them
above the release_version local variable's assignment too, which turns
every #{release_version} interpolation into an undefined-local-variable
error the instant the block runs -- Ruby resolves a bare identifier as a
local-variable reference vs. a method call at parse time, based on
whether an assignment has already been seen earlier in the source, not
at block-execution time. Fixed by hand-ordering release_version before
both platform blocks while still satisfying ComponentsOrder.
- `keep_alive false` in the service block is a no-op, not "don't restart"
-- Homebrew's keep_alive? is only true when explicitly set truthy, so
false and omitted are identical. nodespaced would never be relaunched by
launchd/systemd after a crash despite the caveats explicitly selling
`brew services start` as the reason to prefer it over running the
binary directly. Now `keep_alive true`.
- The formula claimed `conflicts_with cask: "nodespace"` made the cask and
this formula mutually exclusive. Verified directly (a synthetic same-tap
cask with a real `binary` stanza, then installing this formula against
it) that this declaration has NO enforcement effect, and that the
cask-side mirror (`conflicts_with formula: "..."`) doesn't exist in
current Homebrew at all (`Unknown key: :formula. Valid keys are: :cask`).
Real observed behavior: both install successfully; `brew link` skips the
colliding bin/nodespace symlink with a clear warning (not a hard
failure, not a silent overwrite) and, because Homebrew links a keg's
files as a unit, also skips bin/nodespaced even though its name doesn't
collide with anything. `brew services start`/running nodespaced directly
both still work via the opt/ symlink regardless. Removed the
non-functional conflicts_with line and rewrote the caveats/README to
describe the real, tested behavior instead of a false guarantee.
Also: nil-guards on the Dir[...].first glob lookups (a missing/renamed
release asset now gets a clear odie() message instead of a bare Ruby
TypeError), a chmod 0755 safety net after each bin.install (verified the
downloaded binaries already land executable in practice, but this makes
it not depend on that continuing to be true), and the test block now also
asserts the nodespaced resource installed and runs, not just nodespace.
Co-Authored-By: Claude <[email protected]>
Collaborator
Author
Self-review update (round 2)Pushed fixes for real, verified bugs found by adversarial review + follow-up isolated-prefix testing:
Re-verified end to end in the isolated Homebrew prefix after every fix: Still can't merge this myself (read-only access to this repo, and GitHub blocks self-approval regardless) — needs a maintainer with write access. |
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of NodeSpaceAI/nodespace-core#2146. There was no Homebrew route to a headless CLI at all — the existing
nodespacecask installs the full GUI app, and the only CLI-only path wascargo install nodespace-cli, which needs a Rust toolchain.Adds
Formula/nodespace-cli.rb, distinct from thenodespacecask: installs prebuiltnodespace(CLI) andnodespaced(daemon) binaries from nodespace-core's GitHub Releases, with abrew services-manageable daemon (brew services start nodespace-cli). README updated to document both install paths side by side.Note on access: this account (
mstomar125) has read-only (pull) access toNodeSpaceAI/homebrew-nodespace— I can open this PR from my own fork, but cannot merge it myself (GitHub also blocks formal self-approval on one's own PR regardless). A maintainer with write access needs to review and merge.Notable findings from testing (see commit message for full detail)
odie()message on that platform rather than failing obscurely.SHA256SUMSlists checksums for assets that don't exist.nodespace-x86_64-apple-darwin/nodespaced-x86_64-apple-darwinhave entries inSHA256SUMSbut are not actual uploaded release assets (verified viagh release view v0.2.0 --json assets, not just the checksums file). Every digest in this formula was computed locally from bytes actually downloaded from the release — never copied fromSHA256SUMS. Filed as a separate nodespace-core follow-up (release asset/checksum inconsistency).#{version}inside the nestedresource "nodespaced" doblock resolves against the Resource's own (empty) version, not the Formula's —selfchanges inside that block. This 404'd on a URL with an empty version segment (.../download/v/nodespaced-...) until fixed by capturing the Formula's version into a local variable (release_version = version) before entering the resource block.brew audit --strictfindings were deliberately kept rather than "fixed": an explicitversionstanza (audit calls it "redundant with version scanned from URL", but it's needed so a future version bump is a single-line diff, matching the same reasoningnodespace-core/scripts/update-homebrew-cask.tsdocuments for the sibling cask), andlicense :cannot_represent(nodespace-core's real license, FSL-1.1-Apache-2.0, has no SPDX identifier — this is Homebrew's documented escape hatch for exactly that case).Testing (all in an isolated Homebrew prefix — a throwaway clone of
Homebrew/brew, never this machine's real Homebrew)brew style --formula— clean, no offensesbrew audit --formula --strict— clean aside from the two documented trade-offs abovebrew install nodespaceai/homebrew-nodespace/nodespace-cli— real install, real download, real digest verification, succeeded (28.0MB, 7 files)nodespace --version/nodespaced --version— both report0.2.0correctlybrew test nodespaceai/homebrew-nodespace/nodespace-cli— passesbrew services info— service block resolves correctlybrew uninstall nodespace-cli— clean removalAcceptance criteria (from #2146, this repo's slice)
nodespace-cliformula exists in the tap and installs a headless CLI🤖 Generated with Claude Code