feat(install): add curl installer script and fix homebrew formula publish#65
Conversation
…lish - scripts/install.sh: 패키지 매니저 없이 GitHub 릴리스에서 플랫폼별 독립 실행 바이너리를 내려받아 체크섬 검증 후 설치 (musl/Alpine 감지, 버전 고정 지원) - release-please.yml: homebrew formula 발행 버그 수정. csp.rb가 tap에 없던 최초 실행에서 'git diff --quiet'가 untracked 파일을 무시해 커밋을 건너뛰어 formula가 한 번도 발행되지 않았음. 스테이징 후 --cached 로 판정하도록 수정 - README.md / README.ko.md: curl 설치 방법 문서화
📝 WalkthroughWalkthroughAdds a Bash installer for the csp binary, updates English and Korean install docs, and changes the Homebrew formula workflow to check staged diffs before committing. ChangesStandalone Installer Script and Docs
Homebrew Formula Change Detection Fix
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Up to standards ✅🟢 Issues
|
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/install.sh (1)
108-110: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAdd basic retry/timeout flags to the
curlcalls.Line 110 and Lines 194-197 still fail on transient GitHub/CDN hiccups with no retry/backoff or connection timeout, which makes Docker builds and first-run installs needlessly flaky.
Suggested patch
+readonly CURL_RETRY_OPTS=(--retry 3 --retry-delay 1 --connect-timeout 10) + resolve_latest_tag() { local redirect - redirect="$(curl -fsS -o /dev/null -w '%{redirect_url}' "${RELEASES_URL}/latest" || true)" + redirect="$(curl -fsS "${CURL_RETRY_OPTS[@]}" -o /dev/null -w '%{redirect_url}' "${RELEASES_URL}/latest" || true)" [[ -n "$redirect" ]] || die "Could not resolve the latest release tag from ${RELEASES_URL}/latest" printf '%s' "${redirect##*/tag/}" } @@ - curl -fsSL -o "$binary" "${base}/${asset}" \ + curl -fsSL "${CURL_RETRY_OPTS[@]}" -o "$binary" "${base}/${asset}" \ || die "Failed to download ${base}/${asset} (does release ${tag} have a ${asset} binary?)." - curl -fsSL -o "$checksum" "${base}/${asset}.sha256" \ + curl -fsSL "${CURL_RETRY_OPTS[@]}" -o "$checksum" "${base}/${asset}.sha256" \ || die "Failed to download checksum from ${base}/${asset}.sha256"Also applies to: 194-197
🤖 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 108 - 110, The curl calls in resolve_latest_tag and the later download/checksum paths still have no retry, backoff, or connection timeout, which makes transient network failures break installs. Update the curl invocations in these scripts to include basic retry and timeout flags consistently, using the existing resolve_latest_tag function and the download logic around the later curl calls as the fix points. Keep the behavior the same otherwise, just make the network requests more resilient to temporary GitHub/CDN hiccups.
🤖 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.
Nitpick comments:
In `@scripts/install.sh`:
- Around line 108-110: The curl calls in resolve_latest_tag and the later
download/checksum paths still have no retry, backoff, or connection timeout,
which makes transient network failures break installs. Update the curl
invocations in these scripts to include basic retry and timeout flags
consistently, using the existing resolve_latest_tag function and the download
logic around the later curl calls as the fix points. Keep the behavior the same
otherwise, just make the network requests more resilient to temporary GitHub/CDN
hiccups.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c76b5413-d42d-441e-9961-7555d10b4113
📒 Files selected for processing (4)
.github/workflows/release-please.ymlREADME.ko.mdREADME.mdscripts/install.sh
There was a problem hiding this comment.
1 issue found across 4 files
Architecture diagram
sequenceDiagram
participant User as User Terminal
participant Curl as curl
participant InstallScript as install.sh Script
participant GitHub as GitHub Releases
participant LocalFS as Local Filesystem (~/.local/bin)
participant Brew as Homebrew (system)
participant BrewTap as pleaseai/homebrew-tap Repo
participant CI as GitHub Actions (release-please.yml)
Note over User,Brew: Two independent install paths
rect rgb(240, 240, 240)
Note over User,LocalFS: Path A: curl installer (scripts/install.sh)
User->>Curl: curl -fsSL .../install.sh | bash
Curl-->>InstallScript: pipe script to bash
InstallScript->>InstallScript: detect_asset() → os/arch/musl
InstallScript->>GitHub: GET /releases/latest (redirect)
GitHub-->>InstallScript: redirect_url → latest tag
InstallScript->>GitHub: GET /download/{tag}/{asset}
GitHub-->>InstallScript: binary blob
InstallScript->>GitHub: GET /download/{tag}/{asset}.sha256
GitHub-->>InstallScript: checksum file
InstallScript->>InstallScript: sha256_of(binary) vs expected
alt Checksum mismatch
InstallScript-->>User: die: checksum mismatch
else Checksum valid
InstallScript->>LocalFS: install -m 0755 binary → ~/.local/bin/csp
InstallScript->>InstallScript: warn_if_not_on_path()
InstallScript-->>User: ✓ Installed csp
end
end
rect rgb(240, 240, 240)
Note over CI,BrewTap: Path B: Homebrew formula publish (release-please.yml)
CI->>CI: git add csp.rb
CI->>CI: git diff --cached --quiet
alt No staged changes
CI->>CI: exit 0 (no commit)
else Staged changes exist
CI->>CI: git commit -m "chore: update csp to {VERSION}"
CI->>BrewTap: git push origin main
BrewTap-->>CI: formula published
Note over BrewTap,Brew: Later, user runs:
User->>Brew: brew install pleaseai/tap/csp
Brew->>BrewTap: fetch csp.rb formula
BrewTap-->>Brew: formula content
Brew->>GitHub: download binary from release
GitHub-->>Brew: binary
Brew-->>User: csp 0.1.7 installed
end
end
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
install.sh: route info/ok 메시지도 stderr로 보내 stdout을 깨끗하게 유지하고, 색상 가드(-t 2)가 실제 출력 스트림(stderr)과 일치하도록 정리 (greptile/cubic 리뷰 반영)
There was a problem hiding this comment.
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`:
- Line 149: The install script’s PATH export message is triggering ShellCheck
SC2016 because the format string is single-quoted while intentionally containing
a literal $PATH. Update the printf call in the install script’s PATH-printing
block to use a double-quoted format with an escaped $PATH so the user still sees
the same export command and the lint warning is avoided.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
install.sh: PATH 안내 printf를 이스케이프된 이중 따옴표 포맷으로 바꿔 ShellCheck SC2016 경고 제거 (출력은 동일, 리터럴 $PATH 유지) — coderabbit 반영
|



요약
패키지 매니저 없이
csp를 설치하는 curl 설치 스크립트를 추가하고, Homebrew formula가 tap에 한 번도 발행되지 않던 버그를 수정합니다.변경 사항
1.
scripts/install.sh(신규)GitHub 릴리스에서 플랫폼별 독립 실행 바이너리를 내려받아 체크섬 검증 후 설치하는 auth-free 설치 스크립트입니다.
pleaseai/gh-please의scripts/install.sh컨벤션을 따릅니다.curl -fsSL https://raw.githubusercontent.com/pleaseai/code-search/main/scripts/install.sh | bashdarwin/linux×x64/arm64csp-linux-x64-musl선택 (arm64+musl은 미발행이므로 명확히 실패)releases/latest리다이렉트로 최신 태그 해석 (GitHub API 레이트 리밋 회피).sha256파일로 체크섬 검증 (fail-closed)~/.local/bin설치 (CSP_INSTALL_DIR로 변경,--version으로 버전 고정).exe로 안내2.
release-please.yml— Homebrew formula 발행 버그 수정brew install pleaseai/tap/csp가No available formula오류로 실패하던 근본 원인입니다.update-homebrew-formula잡이git diff --quiet csp.rb로 변경 여부를 판정했는데, untracked 파일(최초에 tap에csp.rb가 없던 상태)은git diff가 무시하므로 항상 "No changes"로 판정되어 커밋을 건너뛰었습니다. 결과적으로 formula가 한 번도 tap에 발행되지 않았습니다.git add후git diff --cached로 스테이징된 diff를 판정하도록 수정했습니다.3.
README.md/README.ko.mdcurl 설치 방법을 문서화 (양쪽 동기화).
즉시 조치 (이 PR과 별개로 완료)
v0.1.7용
csp.rb를 실제 체크섬으로 생성해pleaseai/homebrew-tap에 직접 발행했습니다.brew install pleaseai/tap/csp(0.1.7) 설치·실행을 로컬에서 검증했습니다. 워크플로 수정은 다음 릴리스부터 자동 적용됩니다.테스트
bash -n scripts/install.sh통과brew install pleaseai/tap/csp→csp 0.1.7검증Summary by cubic
Adds a curl-based installer for
cspso users can install without a package manager, and fixes the Homebrew workflow so the formula publishes to the tap on first run. Installer messages now go to stderr to keep stdout clean for piping.New Features
scripts/install.shto download the standalonecspbinary from GitHub Releases, verify SHA-256, and install to~/.local/bin(override withCSP_INSTALL_DIR; pin with--version).darwin/linuxonx64/arm64, handles musl (Alpine) viacsp-linux-x64-musl, and resolves the latest tag viareleases/latest; documented inREADME.mdandREADME.ko.md.Bug Fixes
csp.rband usegit diff --cachedinrelease-please.ymlso untracked files are committed, publishing the formula topleaseai/homebrew-tapon first run.Written for commit 62c7cd3. Summary will update on new commits.
Summary by CodeRabbit
New Features
curl | bashinstaller for downloading the platform-specific binary from release artifacts.~/.local/binby default, withCSP_INSTALL_DIRfor a custom install path.--versionand provides helpful--help/argument handling.Documentation