Skip to content

feat(install): add get.xagent.co one-line installer - #760

Merged
rogercloud merged 7 commits into
xorbitsai:mainfrom
qinxuye:feat/install-script
Jul 5, 2026
Merged

feat(install): add get.xagent.co one-line installer#760
rogercloud merged 7 commits into
xorbitsai:mainfrom
qinxuye:feat/install-script

Conversation

@qinxuye

@qinxuye qinxuye commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Adds the curl | sh install path for the single-machine (pip/uvx) deployment.

curl -fsSL https://get.xagent.co | sh

What's here

  • scripts/install.sh — POSIX sh installer. Bootstraps uv if missing, then uv tool install --upgrade xagent-ai (isolated env — no system Python, no PEP 668), and prints how to start the server. Linux/macOS; Windows users are pointed at pip. Supports XAGENT_VERSION to pin. Documents the uv tool install xagent-ai manual equivalent for those who don't want to pipe curl into sh.
  • scripts/get.xagent.co/ — a Cloudflare Worker (+ wrangler.toml, README) that serves the script pinned to the latest release tag (falls back to main), so the public one-liner always serves a shipped, reviewed version.
  • .github/workflows/install-script.yml — ShellCheck + an end-to-end smoke test that actually runs the installer on Linux and macOS and asserts xagent --help, so the one-liner can't silently rot. Gated to when the script changes.

Verified

Ran scripts/install.sh locally end to end (isolated UV_TOOL_DIR/UV_TOOL_BIN_DIR): it installs xagent-ai, drops the xagent/xagent-web entry points, and xagent --help works. sh -n, workflow YAML, and worker ESM all validate.

Deploy note (outside this PR)

get.xagent.co needs a one-time wrangler deploy from the Cloudflare account that owns the xagent.co zone (see scripts/get.xagent.co/README.md).

Add scripts/install.sh — the installer served at https://get.xagent.co:

  curl -fsSL https://get.xagent.co | sh

It installs the published `xagent-ai` package via `uv tool install` (isolated,
no system-Python/PEP 668), bootstrapping uv if missing, and prints how to start
the server. Supports XAGENT_VERSION pinning; POSIX sh; Linux/macOS.

Also add:
- scripts/get.xagent.co/: a Cloudflare Worker (+ wrangler.toml, README) that
  serves the script pinned to the latest release tag (falls back to main).
- .github/workflows/install-script.yml: ShellCheck plus an end-to-end smoke
  test that runs the installer on Linux and macOS and asserts `xagent --help`,
  so the one-liner can't silently rot.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a Cloudflare Worker and an installation script (scripts/install.sh) to allow users to install xagent-ai via a simple curl one-liner. The worker fetches the installer script from the latest GitHub release tag, falling back to main if necessary. The review feedback suggests several robustness improvements: saving and using the original PATH in the installer script to accurately warn users if the command is not on their path, wrapping GitHub API and worker fetch handlers in try/catch blocks to prevent unhandled exceptions, and restricting the worker to only serve requests on the root path.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread scripts/install.sh
Comment thread scripts/install.sh Outdated
Comment thread scripts/get.xagent.co/worker.js
Comment thread scripts/get.xagent.co/worker.js Outdated
- install.sh: capture ORIG_PATH before mutating PATH and use it for the final
  'not on PATH' warning, so the warning reflects the user's real shell env
  rather than the PATH the script temporarily extended.
- worker.js: wrap the GitHub release lookup and the whole request handler in
  try/catch so an API outage or unexpected error degrades to the main fallback
  / a clean 502 text response instead of a Cloudflare HTML 500; only serve the
  installer at the root path.
@qinxuye

qinxuye commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a Cloudflare Worker and an installation script to support a one-liner installation of Xagent via curl -fsSL https://get.xagent.co | sh. The Cloudflare Worker resolves and serves the installer script from the latest GitHub release tag, falling back to main if necessary. The installer script bootstraps uv if it is missing and installs the xagent-ai package. The review feedback highlights three improvement opportunities: stripping a leading 'v' from XAGENT_VERSION for PyPI compatibility, refining the PATH warning in the installer script when uv is newly installed, and ensuring the Cloudflare Worker's x-xagent-install-ref header accurately reflects the fallback reference if the release tag fetch fails.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread scripts/install.sh
Comment thread scripts/install.sh
Comment thread scripts/get.xagent.co/worker.js Outdated
- install.sh: strip a leading 'v' from XAGENT_VERSION (v0.6.0 -> 0.6.0) so a
  git-tag-style value installs; when uv was just installed and isn't on the
  parent shell's PATH, tell the user to open a new terminal / export PATH rather
  than run 'uv tool update-shell' (which wouldn't be found).
- worker.js: report the actually-served ref in x-xagent-install-ref when the
  release tag is missing the script and it falls back to main.
Comment thread scripts/get.xagent.co/worker.js Outdated
A public curl | sh installer must not serve unreleased code. Drop the main
fallback: resolve the latest release tag and serve scripts/install.sh at that
immutable tag; on any lookup/fetch failure (API outage, rate-limit, tag missing
the script) return 502 instead of falling back to the floating main ref. The
endpoint therefore requires a release that includes the script to exist; noted
in the README.
Comment thread .github/workflows/install-script.yml
The installer workflow only triggered on scripts/install.sh and had no check for
the hosted worker. Add scripts/get.xagent.co/** to the path filters and a
Node syntax check of worker.js (fed via stdin so --input-type=module applies).
@qinxuye
qinxuye requested a review from rogercloud July 5, 2026 07:36

@rogercloud rogercloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A few non-blocking minor suggestions from review (all prior findings on this PR are already fixed — nice work on the fail-closed release resolution).

Comment thread scripts/get.xagent.co/worker.js
Comment thread scripts/install.sh Outdated
Comment thread scripts/install.sh Outdated
Comment thread .github/workflows/install-script.yml Outdated
…tests

- worker.js: add AbortSignal.timeout to both outbound fetches so a stuck
  upstream fails closed (502) fast instead of hanging the curl | sh client.
- install.sh: reject an XAGENT_VERSION that is empty after stripping a leading
  'v' (e.g. 'v') with a clear message; simplify the uv PATH-prepend (drop the
  redundant dedup — first match wins and PATH isn't printed).
- get.xagent.co: add functional tests (Node built-in runner, no deps) covering
  fail-closed 502, non-root 404, and serving from the resolved release tag;
  package.json marks the dir ESM so 'node --check'/imports work directly. CI
  runs 'node --test' for the worker.
@qinxuye
qinxuye requested a review from rogercloud July 5, 2026 09:37

@rogercloud rogercloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Summary: This PR adds a public curl -fsSL https://get.xagent.co | sh installer for xagent-ai: a POSIX install.sh that bootstraps uv and installs the package, a Cloudflare Worker that serves the script pinned to the latest GitHub release (failing closed with 502 rather than falling back to a floating ref), and CI covering both. This follow-up commit addresses all 4 minor findings from the previous review round: fetch timeouts on the Worker, a guard against a degenerate XAGENT_VERSION value, a PATH-dedup simplification, and new functional tests for the Worker's fail-closed/routing logic.

Verdict: Approve. All prior findings (this round and the prior one) are fixed and verified against the current code. No blocking issues.

A few optional nits for a future follow-up (not blocking, not requested for this PR):

  • The PATH-dedup removal can produce a duplicate PATH entry if ~/.local/bin is already present — harmless (doesn't affect resolution, PATH is never printed to the user).
  • The XAGENT_VERSION guard still lets a whitespace-only value (e.g. a single space) through, since stripping a leading v from it stays non-empty — would surface as a less friendly uv error rather than this script's own message. Low priority.
  • The new worker.test.mjs tests cover the !res.ok early-return branches (500/404) but not the try/catch exception branches — an AbortSignal.timeout abort or a res.json() parse failure never actually executes in any test, even though both end up calling the same UNAVAILABLE() helper. Worth a follow-up test that makes fetch reject.
  • No actions/setup-node pin in the workflow; relying on the runner's default Node is consistent with the file's existing style (e.g. relying on preinstalled shellcheck) and low risk in practice, but pinning would be more future-proof.

Comment thread scripts/install.sh
Comment thread scripts/install.sh
Comment thread scripts/get.xagent.co/worker.test.mjs
Comment thread .github/workflows/install-script.yml
- worker.test.mjs: add two tests where fetch rejects (release lookup, and raw
  script fetch), exercising the try/catch paths an AbortSignal.timeout abort or
  malformed JSON would hit — previously only the !res.ok branches were covered.
- install-script workflow: add actions/setup-node (pin 22) so node --test and
  AbortSignal.timeout don't rely on the runner's default Node version.

(Two other nits left as-is per the reviewer: the dropped PATH dedup is harmless
and was requested in a prior round; an all-whitespace XAGENT_VERSION still
surfaces uv's own error — out of scope.)
@rogercloud
rogercloud merged commit 574353e into xorbitsai:main Jul 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants