Skip to content

fix(install): require bun in install.sh to match runtime dependency#28

Open
Voskresenskyi-Serhii wants to merge 3 commits into
involvex:mainfrom
Voskresenskyi-Serhii:bugfix/install-sh-require-bun
Open

fix(install): require bun in install.sh to match runtime dependency#28
Voskresenskyi-Serhii wants to merge 3 commits into
involvex:mainfrom
Voskresenskyi-Serhii:bugfix/install-sh-require-bun

Conversation

@Voskresenskyi-Serhii

@Voskresenskyi-Serhii Voskresenskyi-Serhii commented Jun 18, 2026

Copy link
Copy Markdown

Description

The install.sh script installs the package via npm first, but the CLI binary uses a #!/usr/bin/env bun shebang and the build targets bun (--target bun). Users without bun get a successful install but a non-functional CLI that immediately fails with env: 'bun': No such file or directory.

This PR replaces the npm-first install logic with a bun availability check and a clear error message pointing to https://bun.sh when bun is missing.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement

Testing

  • Tests pass locally (bun run test)
  • Manual testing steps performed
  • Added new tests for the feature/fix

Steps to verify:

  1. Ensure bun is not installed
  2. Run bash scripts/install.sh
  3. Confirm: error message with install link is shown, script exits with code 1
  4. Install bun, re-run bash scripts/install.sh
  5. Confirm: package installs successfully via bun install -g

Checklist

  • My code follows the project's code style
  • I have run bun run lint and bun run typecheck
  • I have updated the documentation accordingly
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally

Additional Notes

Closes #27

Summary by Sourcery

Bug Fixes:

  • Prevent successful installation on systems without Bun by failing early with a clear error message and installation link.

The CLI binary uses a bun shebang and the build targets bun, so
installing via npm leaves users with a non-functional binary.
Replace the npm-first logic with a bun check and a clear error
message pointing to https://bun.sh when bun is missing.

Closes involvex#27
@changeset-bot

changeset-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 096b3fb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sourcery-ai

sourcery-ai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the installation script to require Bun explicitly before installing the CLI, ensuring runtime and install-time dependencies match and providing a clear error message and exit code when Bun is missing.

Flow diagram for updated install.sh Bun requirement

flowchart TD
  Start([Run install.sh]) --> CheckBun{command -v bun}
  CheckBun -- not found --> Error["Error: bun is required to run @involvex/youtube-music-cli\nInstall bun: https://bun.sh\nexit 1"]
  CheckBun -- found --> BunInstall["bun install -g @involvex/youtube-music-cli"]
  BunInstall --> Done["youtube-music-cli installed. Run: youtube-music-cli"]
Loading

File-Level Changes

Change Details Files
Require Bun before installation and fail fast with a clear message when Bun is not available.
  • Replace npm-first install logic with a Bun availability check using command -v bun and a negated condition.
  • When Bun is missing, print a concise error explaining Bun is required to run the CLI and include a link to https://bun.sh, then exit with status code 1.
  • If Bun is available, run bun install -g for the package and print a final success message instructing how to run the CLI.
scripts/install.sh

Assessment against linked issues

Issue Objective Addressed Explanation
#27 Ensure the install.sh script matches the CLI runtime dependency on bun by requiring bun to be installed and installing the package via bun instead of npm, so users without bun do not end up with a broken CLI.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the shell installation script (scripts/install.sh) to strictly require the bun runtime and removes the fallback to npm. The reviewer recommended applying the same logic to the PowerShell installation script (scripts/install.ps1) to ensure consistency and prevent issues on Windows platforms.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread scripts/install.sh
Comment on lines +6 to 10
if ! command -v bun >/dev/null 2>&1; then
echo "Error: bun is required to run ${PACKAGE}." >&2
echo "Install bun: https://bun.sh" >&2
exit 1
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The PowerShell installation script scripts/install.ps1 still contains the old logic that falls back to npm if available. This will lead to the same issue on Windows systems (a successful installation but a non-functional CLI due to the missing bun runtime).

To ensure consistency across platforms, please update scripts/install.ps1 to also require bun and remove the npm fallback. For example:

if (!(Get-Command bun -ErrorAction SilentlyContinue)) {
	throw "bun is required to run $package. Install bun: https://bun.sh"
}

bun install -g $package

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@kilo-code-bot

kilo-code-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • scripts/install.ps1 - previous Write-Error exit handling warning resolved by adding -ErrorAction Continue.
  • scripts/install.sh - unchanged from prior review; Bun requirement remains fail-fast.
Previous Review Summaries (2 snapshots, latest commit b3802cf)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit b3802cf)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
scripts/install.ps1 6 Write-Error with $ErrorActionPreference = 'Stop' prevents the following explicit exit 1 from running, so missing Bun may not produce the intended controlled exit status.
Other Observations (not in diff)

None.

Files Reviewed (2 files)
  • scripts/install.sh - previous Bun requirement verified; no new issues found.
  • scripts/install.ps1 - 1 warning found.

Fix these issues in Kilo Cloud

Previous review (commit e8dad70)

Status: No Issues Found | Recommendation: Merge

The changes fix the critical issue where users without bun could successfully install the CLI via npm, but then get runtime errors because the CLI binary uses #!/usr/bin/env bun shebang.

The updated script now:

  1. Checks for bun availability first (fail-fast pattern)
  2. Provides a clear error message with installation link
  3. Exits with status code 1 when bun is missing
  4. Only runs bun install -g when bun is available
Other Observations (not in diff)

The PowerShell installation script (scripts/install.ps1) still has the same issue - it uses npm-first with bun fallback. Consider applying the same fix there for consistency across platforms.

File Line Issue
scripts/install.ps1 5-11 Uses npm-first logic with bun fallback, same problem as original install.sh
Files Reviewed (1 file)
  • scripts/install.sh

Reviewed by nex-n2-pro:free · 287,240 tokens

Same fix as install.sh — replace npm-first logic with a bun check
and a clear error message for Windows users.

Closes involvex#27
Comment thread scripts/install.ps1 Outdated
} else {
throw "npm or bun is required to install $package."
if (-not (Get-Command bun -ErrorAction SilentlyContinue)) {
Write-Error "bun is required to run $package. Install bun: https://bun.sh"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Write-Error is unreachable for explicit exit handling because $ErrorActionPreference = 'Stop' turns it into a terminating error before exit 1 runs.

Use an error action that lets the script continue to the explicit exit status.

Suggested change
Write-Error "bun is required to run $package. Install bun: https://bun.sh"
Write-Error "bun is required to run $package. Install bun: https://bun.sh" -ErrorAction Continue

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Write-Error is a terminating error when $ErrorActionPreference is Stop,
preventing the explicit exit 1 from running.
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.

[BUG] install.sh installs via npm but CLI requires bun runtime

1 participant