Skip to content

feat: add curl-based install script for one-command setup - #68

Merged
arnoldlaishram merged 10 commits into
mainfrom
add-install-script
Apr 7, 2026
Merged

arnoldlaishram merged 10 commits into
mainfrom
add-install-script

Conversation

@droid-ash

@droid-ash droid-ash commented Apr 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds scripts/install.sh — a single curl | bash command that handles the full FinalRun setup: Node.js, CLI, skills, platform tool detection, and auto-installation
  • Updates README.md to use the one-liner install instead of manual multi-step instructions

Install script flow

  1. Check/install Node.js >= 20 (via nvm)
  2. npm install -g @finalrun/finalrun-agent@latest
  3. Check npx availability
  4. npx skills add final-run/finalrun-agent
  5. Prompt platform: Android / iOS / Both
  6. Detect Android Studio / Xcode — guide user if missing
  7. Auto-install tools via Homebrew (scrcpy, applesimutils)
  8. Run finalrun doctor to verify

Test plan

  • Run bash scripts/install.sh on a clean machine — verify full flow
  • Run on a machine with everything installed — verify it skips installs
  • Run with --platform android choice — verify only android tools checked
  • Verify finalrun doctor passes after script completes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Simplified installation docs to use a single curl-based installer and reordered Quick Start to run install first; clarified that the installer handles most prerequisites while keeping detailed reference info.
  • New Features

    • Added an automated installer that verifies/sets up Node, installs the CLI and skills, and guides platform-specific (Android/iOS) tooling and readiness checks.

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>
@coderabbitai

coderabbitai Bot commented Apr 6, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds 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 finalrun doctor.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md, packages/cli/README.md
Replaced global npm install -g instructions with a curl
Installation Script
scripts/install.sh
New executable Bash installer implementing Node.js (v20+) detection/installation via nvm, global install of @finalrun/finalrun-agent, npx skills add invocation, interactive platform selection, Android/iOS tool checks (Android Studio/scrcpy, Xcode/applesimutils), and finalrun doctor execution with colored logging and strict error handling.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • arnoldlaishram

Poem

🐰 With whiskers twitched and paws so quick,
A script that hops and runs the trick,
Curl, bash—then Node and CLI,
Skills installed, devices say hi,
Hooray! The setup’s done—time to pick a trick 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a curl-based installer script that enables one-command setup, which is the primary feature in this PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-install-script

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 and usage tips.

…ructions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@droid-ash
droid-ash requested a review from arnoldlaishram April 6, 2026 22:48
@droid-ash droid-ash self-assigned this Apr 6, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🧹 Nitpick comments (2)
README.md (1)

41-45: Consider adding a safer “inspect first” install path alongside curl | 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.md around 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.sh around 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 -->

Comment thread scripts/install.sh
Comment thread scripts/install.sh
Comment thread scripts/install.sh Outdated
Comment thread scripts/install.sh Outdated

@coderabbitai coderabbitai 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.

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between c4acd12 and bd8a109.

📒 Files selected for processing (1)
  • packages/cli/README.md

droid-ash and others added 6 commits April 6, 2026 15:55
…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>
droid-ash and others added 2 commits April 6, 2026 17:13
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants