# How to Update Prime Agent: 3 Methods to Keep Your Installation Current

> Easily update Prime Agent with three simple methods: run the update command, re-run the installer, or build from source. Keep your PrimeIntellect-ai/prime-agent installation current.

- Repository: [Prime Intellect/prime-agent](https://github.com/PrimeIntellect-ai/prime-agent)
- Tags: how-to-guide
- Published: 2026-08-16

---

**Run `prime-agent update` to fetch the latest release, re-run the installer script for a fresh install, or build from source using `npm run build` after pulling the latest commit.**

Keeping Prime Agent up-to-date ensures access to the latest features and security patches. This guide covers the three supported update methods for the PrimeIntellect-ai/prime-agent repository, from one-line commands to manual source compilation.

## Method 1: Using the Built-in Update Command

The fastest way to update a standard installation uses the **built-in update command**. As documented in the *Useful commands* section of [`README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/README.md) (lines 71-78), this command queries the latest release, verifies its SHA-256 checksum, and replaces the current `prime-agent` executable automatically.

```bash
prime-agent update [--force]

```

Use the `--force` flag to bypass version-checking logic and force a re-download when the automatic check fails or falsely reports that you are up-to-date.

## Method 2: Re-running the Installer Script

For a clean reinstall or to change installation locations, **re-run the installer script**. The script at [`install.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/install.sh) downloads the newest versioned release, validates its integrity, and configures the `prime-agent` command along with its IPython runtime.

```bash
curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh

```

As noted in the *Getting Started* section of [`README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/README.md) (lines 46-55), executing this command always fetches the latest release regardless of your current version, making it equivalent to a full upgrade.

## Method 3: Building from Source

To access bleeding-edge commits not yet packaged or apply custom patches, **build from source**. This method requires npm version 11.10 or higher and uses the TypeScript configuration defined in [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) and per-package [`tsconfig.build.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/tsconfig.build.json) files.

```bash

# Pull the latest changes

git pull origin main

# Install dependencies

npm ci

# Compile TypeScript packages

npm run build

# Link the new binary globally

npm link

```

After `npm link` completes, the freshly compiled binary replaces the previous version on your `$PATH`. This process directly uses the build pipeline defined in the repository root.

## Practical Update Examples

### Force-Update When Version Check Fails

If the automatic version detector incorrectly reports that you are current, force a fresh download:

```bash
prime-agent update --force

```

This bypasses the comparison logic and downloads the most recent release tarball immediately.

### Update from Inside a Running Session

While inside a Prime Agent REPL, trigger an update without exiting:

```bash
/prime-agent update

```

This executes the same update logic as the top-level command, refreshing the binary in place.

### Switch to a Development Build

To test the latest commits from the main branch:

```bash
git pull origin main
npm ci
npm run build
npm link
prime-agent --version  # Verify the new build

```

This sequence ensures you are running the most recent code changes before they are packaged into an official release.

## Key Files Controlling the Update Process

Understanding these source files clarifies how Prime Agent manages versions and installations:

- **[`README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/README.md)**: Contains user-facing documentation for the update command (lines 71-78) and installer instructions (lines 46-55).

- **[`install.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/install.sh)**: The installation script that handles release downloads, SHA-256 checksum verification, and system path configuration.

- **[`prime-agent.sh`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/prime-agent.sh)**: A wrapper script that manages environment setup and API key handling before launching the agent.

- **[`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json)**: Defines version metadata, dependencies, and npm scripts including the build pipeline triggered by `npm run build`.

- **`scripts/release.mjs`**: Internal release automation script that manages changelog updates and version bumping for official releases.

## Summary

- **Built-in command**: Fastest method for standard installations using `prime-agent update`.
- **Installer script**: Best for clean reinstalls or fixing corrupted environments via the official install URL.
- **Source build**: Required for unreleased features or custom modifications, using `npm run build` and `npm link`.
- **Force flag**: Use `--force` when the automatic version check prevents necessary updates.
- **File integrity**: Both the built-in updater and installer script verify SHA-256 checksums of downloaded binaries.

## Frequently Asked Questions

### How do I force an update when Prime Agent thinks it is already current?

Use the `--force` flag with the update command. According to the repository's [`README.md`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/README.md), running `prime-agent update --force` bypasses the version comparison logic and downloads the latest release tarball regardless of the current local version.

### What is the difference between updating via the built-in command versus the installer script?

The **built-in update command** (`prime-agent update`) performs an incremental update by downloading only the new binary and verifying its checksum. The **installer script** performs a complete reinstall, reconfiguring the entire runtime environment including IPython dependencies. Use the built-in command for speed and the installer script when troubleshooting environment issues.

### What npm version is required to build Prime Agent from source?

You need **npm version 11.10 or higher**. The build process relies on modern npm features to install dependencies via `npm ci` and compile TypeScript sources using the configurations defined in the repository's [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) and [`tsconfig.build.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/tsconfig.build.json) files.

### Can I update Prime Agent while running inside an active session?

Yes. Execute `/prime-agent update` from within the REPL environment. This invokes the same update routine as the standard command-line version, allowing you to refresh the binary without terminating your current session.