Skip to content

feat: add curl installer with checksum verification#114

Merged
rmanibus merged 1 commit into
mainfrom
feat/curl-install-script
Mar 15, 2026
Merged

feat: add curl installer with checksum verification#114
rmanibus merged 1 commit into
mainfrom
feat/curl-install-script

Conversation

@rmanibus
Copy link
Copy Markdown
Contributor

Summary

  • Add a new scripts/install.sh installer for macOS/Linux that auto-detects platform, downloads release archives, and installs cloudstic.
  • Verify release archive integrity against checksums.txt by default, with optional --no-verify escape hatch.
  • Document curl-based installation usage in README.md and docs/user-guide.md.

Usage

curl -fsSL https://raw.githubusercontent.com/Cloudstic/cli/main/scripts/install.sh | sh
curl -fsSL https://raw.githubusercontent.com/Cloudstic/cli/main/scripts/install.sh | sh -s -- --version v1.2.3
curl -fsSL https://raw.githubusercontent.com/Cloudstic/cli/main/scripts/install.sh | sh -s -- --install-dir "$HOME/.local/bin"

Validation

  • sh -n scripts/install.sh
  • ./scripts/install.sh --help

@rmanibus rmanibus merged commit 7ef6fad into main Mar 15, 2026
5 checks passed
@rmanibus rmanibus deleted the feat/curl-install-script branch March 15, 2026 22:00
@rmanibus rmanibus requested a review from Copilot March 15, 2026 23:10
@rmanibus rmanibus added the enhancement New feature or request label Mar 15, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a curl-pipeable installer script for macOS/Linux that downloads cloudstic from GitHub Releases and verifies SHA256 checksums by default, plus documents this installation path in user-facing docs.

Changes:

  • Introduce scripts/install.sh to detect OS/arch, download release archives, and verify against checksums.txt (optional --no-verify).
  • Document curl-based installation in docs/user-guide.md.
  • Add a curl installer snippet to README.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
scripts/install.sh New cross-platform (darwin/linux) installer that downloads release assets and verifies checksums.
docs/user-guide.md Adds a dedicated “Curl installer” section to the installation guide.
README.md Adds a quick “Curl installer” option in the main install section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/install.sh
exit 1
fi

mkdir -p "$INSTALL_DIR"
Comment thread scripts/install.sh
}

main() {
need_cmd curl
Comment thread scripts/install.sh
Comment on lines +116 to +132
if [ "$VERSION" = "latest" ]; then
tag="latest"
else
tag="$VERSION"
fi

if [ "$tag" = "latest" ]; then
base_url="https://github.com/$REPO/releases/latest/download"
version_for_name="$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | awk -F '"' '/tag_name/{gsub(/^v/,"",$4); print $4; exit}')"
if [ -z "$version_for_name" ]; then
echo "Error: failed to resolve latest release version." >&2
exit 1
fi
else
base_url="https://github.com/$REPO/releases/download/$tag"
version_for_name="${tag#v}"
fi
Comment thread docs/user-guide.md
Comment on lines +115 to +116
The installer verifies release checksums by default.

Comment thread docs/user-guide.md
Comment on lines +102 to +113
### Curl installer (macOS / Linux)

```bash
# Install latest
curl -fsSL https://raw.githubusercontent.com/Cloudstic/cli/main/scripts/install.sh | sh

# Install a specific version
curl -fsSL https://raw.githubusercontent.com/Cloudstic/cli/main/scripts/install.sh | sh -s -- --version v1.2.3

# Install to a user-writable directory
curl -fsSL https://raw.githubusercontent.com/Cloudstic/cli/main/scripts/install.sh | sh -s -- --install-dir "$HOME/.local/bin"
```
Comment thread scripts/install.sh
Comment on lines +171 to +175
if cp "$tmpdir/$BIN_NAME" "$target" 2>/dev/null; then
chmod +x "$target"
else
echo "Permission denied writing to $INSTALL_DIR." >&2
echo "Try running with sudo or choose a user-writable directory:" >&2
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rmanibus rmanibus linked an issue Mar 15, 2026 that may be closed by this pull request
@rmanibus rmanibus added this to the v1.12.0 milestone Mar 17, 2026
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.

Installer follow-ups: curl script and completion UX

2 participants