How to Deploy PrimeAgent to Production: A Complete Guide to CI/CD, Manual Installation, and NPM Package Setup
PrimeAgent can be deployed to production via automated CI/CD pipelines, the self-contained install.sh script, or direct npm installation of release tarballs from R2 storage.
This guide walks through each deployment method for PrimeIntellect's AI coding agent, covering the automated release workflow, environment preparation, and verification steps based on the official PrimeAgent source code.
Understanding PrimeAgent's Production Architecture
PrimeAgent is distributed as a Node.js package with multiple installation pathways. The production deployment system centers on two core components: the GitHub Actions release workflow (.github/workflows/build-binaries.yml) and the self-contained installer script (install.sh).
The CI pipeline builds all monorepo packages, creates versioned tarballs, uploads artifacts to Cloudflare R2, and publishes GitHub releases. This immutable infrastructure ensures reproducible deployments across environments.
Automated Production Deployment via CI/CD
The Release GitHub workflow automates production deployments. When maintainers trigger a release, this workflow executes the full build-and-publish sequence.
What the CI Workflow Does
In .github/workflows/build-binaries.yml, the pipeline:
- Builds all packages in the monorepo
- Creates production-channel and beta-channel tarballs
- Uploads artifacts to the configured R2 bucket
- Creates a GitHub release with attached binaries
- Publishes to npm via
scripts/release.mjs
Running the Release Script Locally
For testing or hotfix scenarios, invoke the release script directly:
# Bump patch version, update changelogs, create tag, and publish
node scripts/release.mjs patch
Available version bumps: patch, minor, major.
Manual Production Deployment with the Installer Script
For self-hosted production environments, the install.sh script provides automated dependency resolution and installation.
Prerequisites and Host Preparation
Ensure your target host meets these requirements:
- Node.js ≥ 20.6.0 and npm
- The installer can auto-install Node via Homebrew (macOS), apt (Debian/Ubuntu), apk (Alpine), or standalone binary
Step-by-Step Manual Installation
-
Configure the download base URL
The
PRIME_AGENT_DOWNLOAD_BASE_URLenvironment variable points to your R2 bucket:export PRIME_AGENT_DOWNLOAD_BASE_URL="https://<your-bucket>.r2.cloudflarestorage.com" -
Execute the installer
curl -fsSL https://prime-agent.dev/install.sh | sh -s -- --no-envThe
--no-envflag prevents automatic shell environment modification. -
Verify installation
The installer confirms that
prime-agentis available on$PATHand outputs a success message.
How the Installer Works Internally
The install.sh script performs these operations:
- Resolves the latest version from
<base-url>/stable(orbetachannel) - Downloads the tarball and SHA-256 checksum file
- Verifies package integrity against
SHA256SUMS - Runs
npm install -gto install globally - Optionally bootstraps the IPython kernel for Python code execution
Direct NPM Installation from Release Tarballs
For environments where you control artifact distribution, install directly from downloaded tarballs.
Download and Verify Production Artifacts
# Resolve the latest production version
VERSION=$(curl -fsSL "$PRIME_AGENT_DOWNLOAD_BASE_URL/stable")
# Download tarball and checksums
curl -fsSL "$PRIME_AGENT_DOWNLOAD_BASE_URL/releases/v${VERSION}/prime-agent-${VERSION}.tgz" \
-o prime-agent.tgz
curl -fsSL "$PRIME_AGENT_DOWNLOAD_BASE_URL/releases/v${VERSION}/SHA256SUMS" \
-o SHA256SUMS
# Verify integrity
sha256sum -c <(grep "prime-agent-${VERSION}.tgz" SHA256SUMS)
Global NPM Installation
npm install -g --no-fund --no-audit --loglevel=error prime-agent.tgz
The flags suppress funding messages and reduce output noise for production logs.
Optional: Bootstrapping the Python Runtime
PrimeAgent's code execution capabilities require Python infrastructure. The installer can prepare this automatically, or you can configure it manually:
- uv: Fast Python package manager
- Python 3.11: Required runtime version
- ipykernel: Jupyter kernel for code execution
Enable automatic bootstrapping by omitting --no-env or running the installer with default flags.
Production Runtime Configuration
After deployment, configure PrimeAgent for your production environment. Key files for runtime settings:
| File | Purpose |
|---|---|
packages/ai/README.md |
Environment variables for self-hosted model providers (API keys, endpoints, rate limits) |
packages/coding-agent/README.md |
CLI commands, extensions, and runtime configuration |
The prime-agent.sh wrapper script handles runtime flags including --no-env and --dist for distribution-specific behavior.
Summary
- Automated deployments use the
build-binaries.ymlGitHub workflow to build, upload to R2, and release - Manual installations rely on
install.shto resolve versions, verify checksums, and install globally - Direct npm installation works with downloaded tarballs when you manage artifact distribution
- Node.js ≥ 20.6.0 is required; the installer can provision this automatically
- Python runtime (uv, Python 3.11, ipykernel) enables code execution features
Frequently Asked Questions
What is the minimum Node.js version for PrimeAgent production deployment?
Node.js 20.6.0 or higher is required. The install.sh script automatically detects missing Node versions and installs them via package managers (Homebrew, apt, apk) or standalone binaries.
How does PrimeAgent verify package integrity during installation?
The installer downloads a SHA256SUMS file alongside each release tarball. It computes the SHA-256 hash of the downloaded package and validates it against the signed checksums before executing npm install -g.
Can I deploy PrimeAgent without using the install script?
Yes. Download the production tarball directly from your R2 bucket, verify checksums manually, then run npm install -g prime-agent.tgz. This approach works for air-gapped environments or custom deployment pipelines.
What does the PRIME_AGENT_DOWNLOAD_BASE_URL environment variable control?
This variable specifies the root URL for artifact resolution. The CI workflow populates an R2 bucket URL here. For production, set this to your immutable R2 storage endpoint; the installer appends /stable or /beta to resolve channel-specific versions.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →