Repository navigation
feat: add curl-based install script for one-command setup - #68
Conversation
Adds scripts/install.sh that handles the full setup flow: - Checks for Node.js >= 20 (installs via nvm if missing) - Installs the FinalRun CLI globally - Installs FinalRun skills for Claude Code / Codex - Prompts for platform (Android / iOS / Both) - Detects Android Studio and Xcode - Auto-installs platform tools (scrcpy, applesimutils) via Homebrew - Runs finalrun doctor to verify the setup Updates README.md to use the one-liner curl install instead of manual steps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds a new Bash installer script and updates documentation to replace the documented global npm install flow with a curl+shell installer. The installer bootstraps Node (via nvm if needed), installs the FinalRun CLI and skills, prompts for Android/iOS selection, performs platform-specific checks, and runs Changes
Sequence DiagramsequenceDiagram
actor User
participant Installer as install.sh
participant NVM as nvm/Node
participant NPM as npm
participant CLI as FinalRun CLI
participant Skills as npx skills
participant Android as Android checks
participant iOS as iOS checks
participant Doctor as finalrun doctor
User->>Installer: run curl ... | bash
Installer->>NVM: check Node version
alt Node < v20
Installer->>NVM: bootstrap & install Node v20+
end
Installer->>NPM: npm install -g `@finalrun/finalrun-agent`@latest
NPM->>CLI: install CLI
Installer->>Skills: npx skills add final-run/finalrun-agent
Skills->>CLI: register skills
Installer->>User: prompt platform choice
User->>Installer: select Android/iOS/both
Installer->>Android: verify Android Studio & scrcpy
Installer->>iOS: verify Xcode & applesimutils
Installer->>Doctor: run finalrun doctor (scoped)
Doctor->>User: display summary/report
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…ructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
README.md (1)
41-45: Consider adding a safer “inspect first” install path alongsidecurl | bash.Since this is now the primary install method, adding a download-and-review alternative improves security posture without removing convenience.
Suggested doc addition
Run the installer to set up everything — Node.js, the CLI, skills, and platform tools: ```sh curl -fsSL https://raw.githubusercontent.com/final-run/finalrun-agent/main/scripts/install.sh | bash
+Prefer to inspect before executing?
+
+sh +curl -fsSL https://raw.githubusercontent.com/final-run/finalrun-agent/main/scripts/install.sh -o install.sh +less install.sh +bash install.sh +</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@README.mdaround lines 41 - 45, Update the README’s installer section to
include a safer "inspect first" alternative alongside the existing curl | bash
command: keep the existing curl -fsSL
https://raw.githubusercontent.com/final-run/finalrun-agent/main/scripts/install.sh
| bash line, and add a follow-up snippet showing how to download the script to
install.sh, inspect it (e.g., less install.sh), then run it with bash
install.sh; reference the install script name install.sh and the curl download
invocation so readers can clearly find and use the safer workflow.</details> </blockquote></details> <details> <summary>scripts/install.sh (1)</summary><blockquote> `250-270`: **Add non-interactive `--platform` support to the installation script.** The script always calls `prompt_platform` and does not accept `--platform android` or `--platform ios` command-line arguments, preventing automated or CI/CD usage without user interaction. Note: The `run_doctor all` invocation is correct per the CLI implementation, which validates 'all' as a proper platform value that runs checks for both Android and iOS. <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@scripts/install.sharound lines 250 - 270, The script currently always calls
prompt_platform and never reads a CLI flag; add parsing for a --platform
argument at the top of the script to set the PLATFORM variable (accepting
"android", "ios", or "both"), validate its value, and only call prompt_platform
when PLATFORM is empty/unset; keep the existing setup_android, setup_ios and
android_ok/ios_ok logic and ensure run_doctor is called using the now-set
PLATFORM value, so CI/non-interactive runs can pass --platform android or
--platform ios without prompting the user.</details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Inline comments:
In@scripts/install.sh:
- Around line 97-106: The interactive prompt loop using read -r choice can
consume the script stdin when run as curl ... | bash; change the prompt to read
from the controlling terminal (e.g., use read -r choice < /dev/tty) or otherwise
detect non-interactive mode and fall back to a default/exit; update the while
loop that sets PLATFORM (the read invocation and the case branches 1/2/3 which
set PLATFORM="android"/"ios"/"both") to read from /dev/tty and/or honor a
non-interactive flag so the prompt works correctly when piped into bash.- Around line 30-39: The install script checks for curl or wget but always uses
curl for the nvm install; update the nvm installation block so it uses wget when
curl is not available (or require curl explicitly). Specifically, modify the
section that references NVM_DIR and the install step (the info "Installing
nvm..." block and the curl invocation) to detect command -v curl and command -v
wget and run the appropriate installer fetch (use curl -fsSL ... | bash if curl
exists, otherwise use wget -qO- ... | bash), or alternatively fail early if only
wget should not be supported.- Around line 185-200: The applesimutils install branch contains a false-success
path: when applesimutils is missing and Homebrew is unavailable the script
currently calls fail(...) but still reaches the final "return 0", leaving
callers (eg. ios_ok) believing the step succeeded; update the applesimutils
error branch so the function returns non-zero or explicitly sets the failure
flag before exiting—locate the applesimutils check and replace the current else
path (the block that calls fail "applesimutils not found and Homebrew is not
available.") so it either calls "return 1" immediately after logging or sets the
appropriate status variable (e.g. ios_ok=false) and then returns a non-zero
value instead of letting the final "return 0" indicate success.- Around line 141-153: The function currently returns 0 unconditionally causing
false success reports when scrcpy installation fails; update the control flow
around the scrcpy check so that if scrcpy is missing and Homebrew is not
available (the branch that calls fail and prints the install hint), the function
exits or returns a non-zero status instead of executing the final "return 0".
Specifically, modify the else branch handling "fail 'scrcpy not found and
Homebrew is not available.'" to follow with a non-zero exit/return (e.g., return
1 or exit 1) and keep the successful paths (command -v scrcpy and brew install
scrcpy) returning 0 as before.
Nitpick comments:
In@README.md:
- Around line 41-45: Update the README’s installer section to include a safer
"inspect first" alternative alongside the existing curl | bash command: keep the
existing curl -fsSL
https://raw.githubusercontent.com/final-run/finalrun-agent/main/scripts/install.sh
| bash line, and add a follow-up snippet showing how to download the script to
install.sh, inspect it (e.g., less install.sh), then run it with bash
install.sh; reference the install script name install.sh and the curl download
invocation so readers can clearly find and use the safer workflow.In
@scripts/install.sh:
- Around line 250-270: The script currently always calls prompt_platform and
never reads a CLI flag; add parsing for a --platform argument at the top of the
script to set the PLATFORM variable (accepting "android", "ios", or "both"),
validate its value, and only call prompt_platform when PLATFORM is empty/unset;
keep the existing setup_android, setup_ios and android_ok/ios_ok logic and
ensure run_doctor is called using the now-set PLATFORM value, so
CI/non-interactive runs can pass --platform android or --platform ios without
prompting the user.</details> <details> <summary>🪄 Autofix (Beta)</summary> Fix all unresolved CodeRabbit comments on this PR: - [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended) - [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Pro **Run ID**: `a63e86c2-358e-4604-8112-6c8d4d4127e8` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between c0c67c2f987c30682998253b92c9993735637455 and c4acd12e86cadf9969906fe0c6f62ee22577f979. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `README.md` * `scripts/install.sh` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/cli/README.md (1)
70-70: Optional: Simplify wording for better readability.The phrase "you want to use" can be simplified to reduce repetition and improve conciseness. As per static analysis hint, this phrasing appears in nearby sentences as well.
✨ Proposed simplification
-4. Configure the AI provider key you want to use. +4. Configure your AI provider key.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cli/README.md` at line 70, Replace the phrase "Configure the AI provider key you want to use." with a more concise wording—either "Configure the AI provider key to use." or simply "Configure the AI provider key."—and apply the same simplification to other nearby occurrences of "you want to use" in the README to keep phrasing consistent and concise.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/cli/README.md`:
- Line 70: Replace the phrase "Configure the AI provider key you want to use."
with a more concise wording—either "Configure the AI provider key to use." or
simply "Configure the AI provider key."—and apply the same simplification to
other nearby occurrences of "you want to use" in the README to keep phrasing
consistent and concise.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 98d22fa9-3643-4e80-9846-22d670551b66
📒 Files selected for processing (1)
packages/cli/README.md
…ve step - All prompts now read from /dev/tty so they work when piped via curl | bash - Skills installation moved to the final step with a Y/n prompt Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Redirects stdin from /dev/tty at the start of main() so every child process (npx skills, brew install, nvm, etc.) gets terminal input when the script is piped via curl | bash. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Doctor now shows ✓/✗/⚠ per check instead of verbose sections - Suppress info-level logs during doctor to keep output clean Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents the script from hanging after npx skills completes by closing stdin and explicitly exiting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add wget fallback for nvm install when curl is unavailable - Return 1 from setup_android when scrcpy can't be installed (no brew) - Return 1 from setup_ios when applesimutils can't be installed (no brew) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
avdmanager is broken on modern Java (11+) and unnecessary since the emulator command handles AVD operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
scripts/install.sh— a singlecurl | bashcommand that handles the full FinalRun setup: Node.js, CLI, skills, platform tool detection, and auto-installationREADME.mdto use the one-liner install instead of manual multi-step instructionsInstall script flow
npm install -g @finalrun/finalrun-agent@latestnpx skills add final-run/finalrun-agentfinalrun doctorto verifyTest plan
bash scripts/install.shon a clean machine — verify full flow--platform androidchoice — verify only android tools checkedfinalrun doctorpasses after script completes🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
New Features