Conversation
Adds @algolia/cli to npm so users can install with `npm install -g @algolia/cli`
or run with `npx @algolia/cli`. Uses the esbuild/bun pattern: one coordinator
package with six platform-specific optional dependencies that each ship the
native Go binary. The publish step runs automatically after GoReleaser on
every v* tag push.
- npm/algolia/ — coordinator package (@algolia/cli) with Node.js shim
- npm/algolia-{darwin,linux,win32}-{x64,arm64}/ — per-platform binary packages
- scripts/npm-publish.sh — copies dist binaries and publishes all 7 packages
- .github/workflows/releases.yml — adds Node.js setup + publish step after GoReleaser
- .gitignore — scope the `algolia` ignore rule to the repo root to allow npm/algolia/
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
TIP This summary will be updated as you push new changes.
|
You can do without This way, we will never need to rotate tokens. |
Thanks! I didn't know about OIDC I see an issue confirming this it seems: npm/cli#8544 |
There was a problem hiding this comment.
Pull request overview
Adds an npm distribution channel for the Algolia CLI using a coordinator package (@algolia/cli) plus platform-specific optional dependency packages, and wires publishing into the tag-based release workflow.
Changes:
- Introduces npm packages under
npm/(coordinator + 6 platform packages) and a Node.js shim to execute the packaged Go binary. - Adds
scripts/npm-publish.shto version/copy binaries from GoReleaserdist/and publish all npm packages. - Updates the release GitHub Actions workflow to set up Node.js and publish to npm after GoReleaser; adjusts
.gitignoreto allow trackingnpm/algolia/.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/npm-publish.sh | New publish script to version/copy GoReleaser artifacts into npm packages and publish them |
| npm/algolia/README.md | Coordinator package README and usage/docs |
| npm/algolia/package.json | Defines @algolia/cli coordinator with optionalDependencies and algolia bin shim |
| npm/algolia/bin/run.js | Node shim that selects and executes the correct platform binary |
| npm/algolia-darwin-x64/package.json | macOS x64 binary package metadata |
| npm/algolia-darwin-x64/index.js | Exports bin path for macOS x64 package |
| npm/algolia-darwin-arm64/package.json | macOS arm64 binary package metadata |
| npm/algolia-darwin-arm64/index.js | Exports bin path for macOS arm64 package |
| npm/algolia-linux-x64/package.json | Linux x64 binary package metadata |
| npm/algolia-linux-x64/index.js | Exports bin path for Linux x64 package |
| npm/algolia-linux-arm64/package.json | Linux arm64 binary package metadata |
| npm/algolia-linux-arm64/index.js | Exports bin path for Linux arm64 package |
| npm/algolia-win32-x64/package.json | Windows x64 binary package metadata |
| npm/algolia-win32-x64/index.js | Exports bin path for Windows x64 package |
| npm/algolia-win32-arm64/package.json | Windows arm64 binary package metadata |
| npm/algolia-win32-arm64/index.js | Exports bin path for Windows arm64 package |
| .gitignore | Scopes /algolia ignore rule so npm/algolia/ is not ignored |
| .github/workflows/releases.yml | Adds Node setup + npm publish step after GoReleaser |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| pkg="${entry%%:*}" | ||
| dist_path="${entry#*:}" | ||
| src="$DIST_DIR/$dist_path" | ||
| dest_dir="$NPM_DIR/$pkg/bin" |
| for entry in "${PLATFORMS[@]}"; do | ||
| pkg="${entry%%:*}" | ||
| # Pin the optionalDependency version in the coordinator package.json to match the published platform packages | ||
| sed -i.bak "s|\"@algolia/$pkg\": \"[^\"]*\"|\"@algolia/$pkg\": \"$VERSION\"|g" "$NPM_DIR/algolia/package.json" |
| if [[ -z "$DRY_RUN" ]]; then | ||
| cp "$src" "$dest_dir/$binary_name" | ||
| if [[ "$binary_name" != *.exe ]]; then |
|
|
||
| The official Algolia CLI lets you manage your Algolia resources — indices, records, API keys, and synonyms — directly from the command line. | ||
|
|
||
| > This package installs a prebuilt Go binary. No Node.js runtime dependency is required after install. |
Summary
@algolia/clito npm so users can install/run the CLI without Homebrew or a direct binary downloadoptionalDependenciesv*tag; npm version is offset by +4 (Gov1.x→ npm5.x) to supersede the old abandoned@algolia/cliv4 packageUsage after release
What's included
npm/algolia/@algolia/cli) with Node.js shimnpm/algolia-{darwin,linux,win32}-{x64,arm64}/scripts/npm-publish.sh.github/workflows/releases.yml.gitignorealgoliaignore rule to repo root sonpm/algolia/is trackedPre-requisites (already done)
NPM_TOKENsecret added to repo GitHub Actions secrets