Skip to content

Document: github release for RAGFlow Go CLI - #16036

Merged
JinHai-CN merged 7 commits into
infiniflow:mainfrom
Haruko386:made
Jun 16, 2026
Merged

JinHai-CN merged 7 commits into
infiniflow:mainfrom
Haruko386:made

Conversation

@Haruko386

Copy link
Copy Markdown
Member

What problem does this PR solve?

As title

Type of change

  • New Feature (non-breaking change which adds functionality)
  • Documentation Update

@Haruko386 Haruko386 added 📖 documentation Improvements or additions to documentation ci Continue Integration labels Jun 15, 2026
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 15, 2026
@Haruko386
Haruko386 marked this pull request as draft June 15, 2026 11:04
@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52c1d94f-e064-47a0-bcec-3c10316262de

📥 Commits

Reviewing files that changed from the base of the PR and between 6d33183 and fce4ea9.

📒 Files selected for processing (1)
  • tools/scripts/INSTALL_SCRIPTS_README.md
✅ Files skipped from review due to trivial changes (1)
  • tools/scripts/INSTALL_SCRIPTS_README.md

📝 Walkthrough

Walkthrough

Adds two installer scripts (install.sh for Linux/macOS, install.ps1 for Windows) that download, verify, and install the ragflow_cli binary from GitHub Releases. The release workflow is extended to build Go CLI binaries for multiple OS/arch targets, generate SHA256SUMS, and upload all assets. READMEs document the install process.

Changes

CLI Install Scripts and Release Pipeline

Layer / File(s) Summary
Release workflow: Go setup, build, and asset upload
.github/workflows/release.yml
Adds actions/setup-go@v5 step, persists RELEASE_TAG/PRERELEASE to GITHUB_ENV, cross-compiles ragflow_cli for linux/darwin/windows × amd64/arm64, verifies linux/amd64 static linkage, generates SHA256SUMS, and uploads dist/cli/* plus install scripts via softprops/action-gh-release@v2.
install.sh: POSIX shell installer
tools/scripts/install.sh
Configurable defaults, logging/permission helpers, uname-based platform detection, GitHub latest-release API resolution, URL construction, curl download with cleanup, portable sha256sum/shasum verification, binary install with optional sudo, post-install --version check, and PATH warning.
install.ps1: Windows PowerShell installer
tools/scripts/install.ps1
Parameter-driven config, CPU arch detection, GitHub latest-release resolution via Invoke-RestMethod, .exe and SHA256SUMS download via Invoke-WebRequest, SHA-256 checksum verification, process stop and binary copy, per-user PATH update, --version post-install validation, and finally-block temp file cleanup.
Install scripts documentation
.github/INSTALL_SCRIPTS_README.md, tools/scripts/INSTALL_SCRIPTS_README.md
Documents supported OS/arch, release asset naming, default and custom install paths, version pinning via VERSION/-Version, hosting URL options, and expected release artifacts (static CGO-disabled binaries, SHA256SUMS, script assets).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant install_sh as install.sh / install.ps1
  participant GitHubAPI as GitHub Releases API
  participant GitHubAssets as GitHub Release Assets
  participant Filesystem as Local Filesystem

  User->>install_sh: execute (optional version flag/env)
  install_sh->>install_sh: detect platform and arch via uname / env
  install_sh->>GitHubAPI: GET /releases/latest (if version=latest)
  GitHubAPI-->>install_sh: tag_name
  install_sh->>install_sh: compose asset filename and URLs
  install_sh->>GitHubAssets: download binary to temp path
  install_sh->>GitHubAssets: download SHA256SUMS to temp path
  GitHubAssets-->>install_sh: binary and checksum files
  install_sh->>install_sh: verify SHA-256 checksum
  install_sh->>Filesystem: move binary to INSTALL_DIR, set permissions
  install_sh->>Filesystem: update PATH if needed
  install_sh->>Filesystem: run installed binary --version
  install_sh-->>User: installation complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 Hop, hop, a binary lands with grace,
SHA256 confirms it's in the right place.
install.sh leaps through Linux and Mac,
PowerShell skips across Windows's track.
From GitHub Releases, the CLI takes flight —
One curl | sh and the path shines bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and uses generic phrasing that doesn't accurately describe the substantial changes (installer scripts + CI workflow) in the changeset. Consider revising to be more specific, such as: 'Add RAGFlow Go CLI installer scripts and release workflow' to better reflect the actual scope of changes.
Description check ❓ Inconclusive The description is incomplete and minimal, providing only checkbox selections with no context about the actual changes or their significance. Expand the 'What problem does this PR solve?' section to explain the purpose of the installer scripts and CI workflow changes, not just 'As title'.
✅ Passed checks (2 passed)
Check name Status Explanation
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.

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


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.

@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: 3

🧹 Nitpick comments (1)
.github/INSTALL_SCRIPTS_README.md (1)

15-29: ⚡ Quick win

Document a non-piped install option alongside curl | sh.

Lines 15-29 currently show only direct pipe-to-shell execution. Please add a “download, inspect, then execute” alternative for stricter security environments.

🤖 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 @.github/INSTALL_SCRIPTS_README.md around lines 15 - 29, The
INSTALL_SCRIPTS_README.md file currently documents only the direct curl piped
execution pattern (curl | sh) in lines 15-29. Add an additional code example
section that demonstrates the safer "download, inspect, then execute" approach.
This alternative should show users how to first download the install.sh script
to a local file, optionally review its contents, and then explicitly execute it.
Include examples showing this pattern with and without the VERSION and
INSTALL_DIR environment variables for consistency with the existing piped
examples.
🤖 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 @.github/workflows/release.yml:
- Around line 139-146: The grep pattern checking for static linking on line 140
only matches "not a dynamic executable" but some toolchains report "statically
linked" instead, causing false failures. Update the grep command in the ldd
check to accept both possible outputs by modifying the pattern to match either
"not a dynamic executable" or "statically linked" using extended regex or basic
grep alternation syntax.
- Line 42: Replace floating version tags with immutable commit SHAs for GitHub
Actions to strengthen supply-chain integrity. In the
.github/workflows/release.yml file, update all uses statements that reference
floating tags (such as actions/setup-go@v5) to pin them to specific commit SHAs
instead. This ensures workflow actions cannot be unexpectedly modified and
aligns with strict pinning security policies.

In `@install.sh`:
- Line 108: The curl commands on line 108 and line 132 lack explicit timeout and
retry mechanisms, making them vulnerable to network hangs and transient failures
during installation. Add the --max-time option to specify a timeout limit for
each curl request and the --retry option to automatically retry failed requests
a configurable number of times. Apply these options to both curl invocations to
ensure resilient network fetches throughout the install script.

---

Nitpick comments:
In @.github/INSTALL_SCRIPTS_README.md:
- Around line 15-29: The INSTALL_SCRIPTS_README.md file currently documents only
the direct curl piped execution pattern (curl | sh) in lines 15-29. Add an
additional code example section that demonstrates the safer "download, inspect,
then execute" approach. This alternative should show users how to first download
the install.sh script to a local file, optionally review its contents, and then
explicitly execute it. Include examples showing this pattern with and without
the VERSION and INSTALL_DIR environment variables for consistency with the
existing piped examples.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ee9ddd8e-70ca-4488-b97f-9bfef6653b3b

📥 Commits

Reviewing files that changed from the base of the PR and between f6a2075 and d6df7ba.

📒 Files selected for processing (4)
  • .github/INSTALL_SCRIPTS_README.md
  • .github/workflows/release.yml
  • install.ps1
  • install.sh


# https://github.com/actions/setup-go
- name: Set up Go
uses: actions/setup-go@v5

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'uses:\s*[^@]+@(v[0-9]+|main|master|latest)$' .github/workflows/release.yml

Repository: infiniflow/ragflow

Length of output: 185


🏁 Script executed:

cat -n .github/workflows/release.yml | head -50

Repository: infiniflow/ragflow

Length of output: 2088


🏁 Script executed:

cat -n .github/workflows/release.yml | sed -n '30,45p'

Repository: infiniflow/ragflow

Length of output: 731


🏁 Script executed:

cat -n .github/workflows/release.yml | sed -n '150,165p'

Repository: infiniflow/ragflow

Length of output: 640


🏁 Script executed:

# Check for any action-pinning policies or configurations in the repo
find . -type f \( -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name ".github/**" \) | xargs grep -l "pin\|action\|security" 2>/dev/null | head -10

Repository: infiniflow/ragflow

Length of output: 266


🏁 Script executed:

# Count total floating action tags in the entire release.yml file
wc -l .github/workflows/release.yml

Repository: infiniflow/ragflow

Length of output: 96


🏁 Script executed:

# Search for all uses statements in the release.yml file
rg -n 'uses:' .github/workflows/release.yml

Repository: infiniflow/ragflow

Length of output: 205


🏁 Script executed:

# Check for any GitHub security policy or action pinning requirements
cat SECURITY.md 2>/dev/null | head -50

Repository: infiniflow/ragflow

Length of output: 1337


🏁 Script executed:

# Look for dependabot config that might define action pinning requirements
fd -e yml -e yaml | xargs grep -l "dependabot\|action\|pin" 2>/dev/null | head -5

Repository: infiniflow/ragflow

Length of output: 175


Pin all GitHub Actions to immutable commit SHAs.

Lines 34, 42, and 157 use floating version tags, which weakens workflow supply-chain integrity and conflicts with strict pinning policies.

Proposed hardening patch
      - name: Check out code
-       uses: actions/checkout@v6
+       uses: actions/checkout@<pin-to-full-commit-sha>

      - name: Set up Go
-       uses: actions/setup-go@v5
+       uses: actions/setup-go@<pin-to-full-commit-sha>

      - name: Upload Go CLI release assets
-       uses: softprops/action-gh-release@v2
+       uses: softprops/action-gh-release@<pin-to-full-commit-sha>
🧰 Tools
🪛 zizmor (1.25.2)

[error] 42-42: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 42-42: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): this step

(cache-poisoning)

🤖 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 @.github/workflows/release.yml at line 42, Replace floating version tags with
immutable commit SHAs for GitHub Actions to strengthen supply-chain integrity.
In the .github/workflows/release.yml file, update all uses statements that
reference floating tags (such as actions/setup-go@v5) to pin them to specific
commit SHAs instead. This ensures workflow actions cannot be unexpectedly
modified and aligns with strict pinning security policies.

Source: Linters/SAST tools

Comment on lines +139 to +146
if command -v ldd >/dev/null 2>&1; then
if ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" 2>&1 | grep -q "not a dynamic executable"; then
echo "Verified linux/amd64 CLI is not dynamically linked"
else
echo "::error::linux/amd64 CLI is dynamically linked"
ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" || true
exit 1
fi

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Accept both common ldd static-link outputs.

Line 140 currently only accepts not a dynamic executable. On some runners/toolchains, static binaries report statically linked, which would fail this step incorrectly.

Proposed compatibility patch
-          if command -v ldd >/dev/null 2>&1; then
-            if ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" 2>&1 | grep -q "not a dynamic executable"; then
+          if command -v ldd >/dev/null 2>&1; then
+            ldd_out="$(ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" 2>&1 || true)"
+            if printf '%s\n' "$ldd_out" | grep -Eq "not a dynamic executable|statically linked"; then
               echo "Verified linux/amd64 CLI is not dynamically linked"
             else
               echo "::error::linux/amd64 CLI is dynamically linked"
-              ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" || true
+              printf '%s\n' "$ldd_out"
               exit 1
             fi
           fi
🤖 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 @.github/workflows/release.yml around lines 139 - 146, The grep pattern
checking for static linking on line 140 only matches "not a dynamic executable"
but some toolchains report "statically linked" instead, causing false failures.
Update the grep command in the ldd check to accept both possible outputs by
modifying the pattern to match either "not a dynamic executable" or "statically
linked" using extended regex or basic grep alternation syntax.

Comment thread install.sh
fi

info "Fetching latest release information"
response="$(curl -sSfL "$RELEASE_API")"

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add timeout and retry policy to all curl fetches.

Line 108 and Line 132 perform critical network calls without explicit timeout/retry limits, which can cause hangs or brittle installs on transient failures.

Proposed resiliency patch
-    response="$(curl -sSfL "$RELEASE_API")"
+    response="$(curl -sSfL --retry 3 --retry-delay 2 --connect-timeout 10 --max-time 30 "$RELEASE_API")"

...

-    if ! curl -sSfL "$url" -o "$output"; then
+    if ! curl -sSfL --retry 3 --retry-delay 2 --connect-timeout 10 --max-time 300 "$url" -o "$output"; then
         rm -f "$output"
         error "Failed to download $url"
         exit 1
     fi

Also applies to: 132-132

🤖 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 `@install.sh` at line 108, The curl commands on line 108 and line 132 lack
explicit timeout and retry mechanisms, making them vulnerable to network hangs
and transient failures during installation. Add the --max-time option to specify
a timeout limit for each curl request and the --retry option to automatically
retry failed requests a configurable number of times. Apply these options to
both curl invocations to ensure resilient network fetches throughout the install
script.

@Haruko386
Haruko386 marked this pull request as ready for review June 16, 2026 03:13
@codecov

codecov Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (f6a2075) to head (b9c7654).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16036   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          668      668           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JinHai-CN JinHai-CN changed the title Document: github release for RagFlow Go CLI Document: github release for RAGFlow Go CLI Jun 16, 2026
Added detailed installation instructions for RAGFlow CLI on Linux, macOS, and Windows, including usage examples for installation scripts.
@JinHai-CN
JinHai-CN merged commit 911bb20 into infiniflow:main Jun 16, 2026
1 check passed
Harry-Hz-Zhang pushed a commit to Harry-Hz-Zhang/ragflow that referenced this pull request Jun 17, 2026
### What problem does this PR solve?

As title

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Documentation Update
@Haruko386
Haruko386 deleted the made branch June 23, 2026 06:09
@coderabbitai coderabbitai Bot mentioned this pull request Jun 23, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration 📖 documentation Improvements or additions to documentation size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants