Skip to content

Print actionable PATH setup commands after install#4028

Open
rossirpaulo wants to merge 2 commits into
canaryfrom
paulo/print-installer-path-commands
Open

Print actionable PATH setup commands after install#4028
rossirpaulo wants to merge 2 commits into
canaryfrom
paulo/print-installer-path-commands

Conversation

@rossirpaulo

@rossirpaulo rossirpaulo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • print copy-paste PowerShell commands that persist the BAML bin directory in the user PATH and activate it in the current terminal
  • print duplicate-safe, shell-specific PATH setup commands for zsh, bash, fish, and other POSIX shells
  • choose .bash_profile for macOS bash and .bashrc for Linux bash

Why

The normal commands on https://boundaryml.com/quickstart do not pass -Yes or --yes. The installers therefore leave PATH unchanged, but their completion output did not give new users a complete command to persist the BAML bin directory.

Validation

  • ran the normal macOS/zsh install flow against a local wrapper manifest and artifact
  • ran the normal Linux/bash install flow with a simulated Linux target
  • ran the normal Windows/PowerShell install flow with a Windows target manifest and local wrapper artifact
  • executed the printed Unix commands twice to verify they expose baml without duplicating the profile entry
  • ran sh -n scripts/install.sh, ShellCheck, git diff --check, and the targeted pre-commit hooks

Summary by CodeRabbit

  • Improvements
    • Updated installation guidance with shell-specific instructions for configuring PATH.
    • Added clearer commands for applying PATH changes both to future terminal sessions and the current session.
    • Improved PowerShell instructions to safely update the user PATH and current environment.

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview, Comment Jul 14, 2026 10:44pm
promptfiddle Ready Ready Preview, Comment Jul 14, 2026 10:44pm
promptfiddle2 Ready Ready Preview, Comment Jul 14, 2026 10:44pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Installer scripts now print shell-specific PATH setup instructions. PowerShell guidance persists the user PATH and updates the current session, while the POSIX installer selects profiles by shell and provides fish-specific handling.

Changes

Installer PATH guidance

Layer / File(s) Summary
PowerShell PATH setup
scripts/install.ps1
The installer prints commands to conditionally persist the user PATH and update the current terminal session.
Shell-aware PATH setup
scripts/install.sh
The installer selects shell-specific profiles, handles fish with fish_add_path, and prints commands for future and current sessions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit with PATH in my paws,
Hopping through shells without flaws.
PowerShell paths bloom,
Fish finds its room,
And BAML springs forth with applause.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: installer output now prints actionable PATH setup commands after install.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch paulo/print-installer-path-commands

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Binary size checks passed

7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
baml-cli Linux 🔒 22.1 MB 9.5 MB file 22.1 MB +41.0 KB (+0.2%) OK
packed-program Linux 🔒 15.9 MB 6.7 MB file 15.8 MB +36.8 KB (+0.2%) OK
baml-cli macOS 🔒 17.0 MB 8.2 MB file 17.0 MB +33.1 KB (+0.2%) OK
packed-program macOS 🔒 12.2 MB 5.9 MB file 12.2 MB +16.6 KB (+0.1%) OK
baml-cli Windows 🔒 18.6 MB 8.4 MB file 18.5 MB +35.3 KB (+0.2%) OK
packed-program Windows 🔒 13.1 MB 6.0 MB file 13.1 MB +35.8 KB (+0.3%) OK
bridge_wasm WASM 14.7 MB 🔒 4.2 MB gzip 4.1 MB +12.8 KB (+0.3%) OK

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.


Generated by cargo size-gate · workflow run

@rossirpaulo
rossirpaulo marked this pull request as ready for review July 14, 2026 22:20
@rossirpaulo
rossirpaulo enabled auto-merge July 14, 2026 22:20
@rossirpaulo
rossirpaulo disabled auto-merge July 14, 2026 22:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/install.sh`:
- Around line 163-186: Update the shell instruction output in scripts/install.sh
to use the resolved BAML_HOME path instead of hardcoding $HOME/.baml, including
both fish_add_path and profile/env references. Preserve the literal $HOME-based
path in printed commands when BAML_HOME is unset, while ensuring custom
BAML_HOME values are injected correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a77f7db0-528a-43b0-b592-80d28ce164f0

📥 Commits

Reviewing files that changed from the base of the PR and between 187304b and c3712f4.

📒 Files selected for processing (2)
  • scripts/install.ps1
  • scripts/install.sh

Comment thread scripts/install.sh
Comment on lines +163 to +186
fish)
cat <<'NEXT'

Add BAML to your PATH by running this command in fish:

fish_add_path "$HOME/.baml/bin"
NEXT
exit 0
;;
*)
shell_label="${shell_name:-POSIX}"
profile_display="\$HOME/.profile"
;;
esac

cat <<NEXT

Add BAML to your PATH by adding this to your shell profile:
Add BAML to your PATH for future $shell_label shells by running:

. "$HOME/.baml/env"
grep -Fqx '. "\$HOME/.baml/env"' "$profile_display" 2>/dev/null || printf '\n%s\n' '. "\$HOME/.baml/env"' >> "$profile_display"

Or run for this shell session:
Then load BAML in this shell:

export PATH="$HOME/.baml/bin:$PATH"
. "\$HOME/.baml/env"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Respect BAML_HOME in printed instructions.

These instructions hardcode $HOME/.baml, which will provide incorrect paths if the user installed BAML with a custom BAML_HOME. Unlike install.ps1 (which correctly uses the dynamically resolved $BinDir), this script does not account for BAML_HOME.

You can dynamically inject the correct path while preserving the literal $HOME variable in the command string for when BAML_HOME is unset.

♻️ Proposed fix
     fish)
-      cat <<'NEXT'
+      cat <<NEXT
 
 Add BAML to your PATH by running this command in fish:
 
-  fish_add_path "$HOME/.baml/bin"
+  fish_add_path "${BAML_HOME:-\$HOME/.baml}/bin"
 NEXT
       exit 0
       ;;
     *)
       shell_label="${shell_name:-POSIX}"
       profile_display="\$HOME/.profile"
       ;;
   esac
 
   cat <<NEXT
 
 Add BAML to your PATH for future $shell_label shells by running:
 
-  grep -Fqx '. "\$HOME/.baml/env"' "$profile_display" 2>/dev/null || printf '\n%s\n' '. "\$HOME/.baml/env"' >> "$profile_display"
+  grep -Fqx '. "${BAML_HOME:-\$HOME/.baml}/env"' "$profile_display" 2>/dev/null || printf '\n%s\n' '. "${BAML_HOME:-\$HOME/.baml}/env"' >> "$profile_display"
 
 Then load BAML in this shell:
 
-  . "\$HOME/.baml/env"
+  . "${BAML_HOME:-\$HOME/.baml}/env"
 NEXT
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fish)
cat <<'NEXT'
Add BAML to your PATH by running this command in fish:
fish_add_path "$HOME/.baml/bin"
NEXT
exit 0
;;
*)
shell_label="${shell_name:-POSIX}"
profile_display="\$HOME/.profile"
;;
esac
cat <<NEXT
Add BAML to your PATH by adding this to your shell profile:
Add BAML to your PATH for future $shell_label shells by running:
. "$HOME/.baml/env"
grep -Fqx '. "\$HOME/.baml/env"' "$profile_display" 2>/dev/null || printf '\n%s\n' '. "\$HOME/.baml/env"' >> "$profile_display"
Or run for this shell session:
Then load BAML in this shell:
export PATH="$HOME/.baml/bin:$PATH"
. "\$HOME/.baml/env"
fish)
cat <<NEXT
Add BAML to your PATH by running this command in fish:
fish_add_path "${BAML_HOME:-\$HOME/.baml}/bin"
NEXT
exit 0
;;
*)
shell_label="${shell_name:-POSIX}"
profile_display="\$HOME/.profile"
;;
esac
cat <<NEXT
Add BAML to your PATH for future $shell_label shells by running:
grep -Fqx '. "${BAML_HOME:-\$HOME/.baml}/env"' "$profile_display" 2>/dev/null || printf '\n%s\n' '. "${BAML_HOME:-\$HOME/.baml}/env"' >> "$profile_display"
Then load BAML in this shell:
. "${BAML_HOME:-\$HOME/.baml}/env"
NEXT
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/install.sh` around lines 163 - 186, Update the shell instruction
output in scripts/install.sh to use the resolved BAML_HOME path instead of
hardcoding $HOME/.baml, including both fish_add_path and profile/env references.
Preserve the literal $HOME-based path in printed commands when BAML_HOME is
unset, while ensuring custom BAML_HOME values are injected correctly.

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.

1 participant