Skip to content

fix: install kane-cli via npm tarball instead of bare runner binary#1

Merged
siddhant573 merged 1 commit intomainfrom
fix/brew-formula-via-npm
Apr 16, 2026
Merged

fix: install kane-cli via npm tarball instead of bare runner binary#1
siddhant573 merged 1 commit intomainfrom
fix/brew-formula-via-npm

Conversation

@samyakLambda
Copy link
Copy Markdown
Collaborator

Summary

Brew users currently get a different (and broken-looking) command than npm users. This PR switches the formula to install via the npm tarball so both paths produce the same install.

Background

The release on `LambdaTest/kane-cli` ships these binaries:
```
kane-cli-darwin-arm64 ← actually v16-runner, renamed
kane-cli-linux-x64 ← same
kane-cli-win-x64.exe ← same
```

Those are the bare Python/Nuitka agent (`v16-runner`). The actual user-facing CLI is the Node.js TUI shipped via `@testmuai/kane-cli` on npm — that wraps `v16-runner` as a subprocess.

The old formula installed the bare runner as `kane-cli`, so:

  • `brew install LambdaTest/kane/kane-cli && kane-cli` → no TUI, expects NDJSON config on stdin, errors out
  • `npm install -g @testmuai/kane-cli && kane-cli` → interactive Ink TUI

Approach

Adopt the agent-browser pattern — Homebrew's existing formula for a similar Node-based CLI tool.

```ruby
url "https://registry.npmjs.org/@testmuai/kane-cli/-/kane-cli-0.2.0.tgz"
sha256 "..."
depends_on "node"

def install
system "npm", "install", std_npm_args
bin.install_symlink libexec.glob("bin/
")
end
```

`npm install` resolves `@testmuai/kane-cli`'s `optionalDependencies` and pulls only the matching platform binary package — same as the npm install path.

Auto-update workflow

Rewritten so it works against the new formula structure:

  • Polls npmjs.com for the new version (up to 2min — handles npm CDN propagation)
  • Computes tarball sha256 directly from the registry
  • Updates `url` / `sha256` / `version` (single occurrences each — no per-platform blocks anymore)
  • Idempotent — skips commit if nothing changed

Test plan

  • `brew install LambdaTest/kane/kane-cli` after this merges and the repo is public — should run `npm install`, install Node-based TUI
  • `kane-cli --version` prints `0.2.0`
  • `kane-cli` (no args) launches the same Ink TUI as the npm install
  • On next `build-cli.yml` public release, the formula auto-update workflow polls for the new version and updates the formula in one step

🤖 Generated with Claude Code

The previous formula downloaded kane-cli-darwin-arm64 / kane-cli-linux-x64
from GitHub Releases and installed them as 'kane-cli'. Those binaries
are actually v16-runner — the bare Python/Nuitka agent — not the
Node.js TUI users get from `npm install -g @testmuai/kane-cli`.

Result: brew users got a different (and broken-looking) command than
npm users — no interactive shell, different argument interface,
"v16-runner not found" errors when invoked normally.

Switch to the agent-browser pattern (Homebrew core formula for the
similar agent-browser tool):
  - Download the @testmuai/kane-cli npm tarball from registry.npmjs.org
  - depends_on "node"
  - npm install + symlink bin/
  - Platform-specific native binary auto-resolves via npm's
    optionalDependencies (only the matching one installs)

This way `brew install LambdaTest/kane/kane-cli` and
`npm install -g @testmuai/kane-cli` produce identical installs.

Auto-update workflow rewritten to:
  - Wait for the npm package to be visible (polls registry up to 2m)
  - Compute the tarball sha256 directly from npmjs.com
  - Update url / sha256 / version (single occurrences now)
  - Skip commit if no changes (idempotent)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants