---
title: pun self-update
description: Update Pun.
---

Update Pun to the latest release, or to the version named.

## Usage

```bash
pun self-update [version] [options]
```

```bash
pun self-update
pun self-update --check
pun self-update v0.2.7
```

## Options

| Option | Description |
| --- | --- |
| `--check` | Only say if a newer release is out. |

## What happens

- Downloads the release over HTTPS.
- Checks its SHA-256 checksum and the new binary's version.
- With a signed-in `gh`, also checks the GitHub build attestation. Set `PUN_REQUIRE_ATTESTATION=1` to require it.
- Replaces the running `pun`.
- If you installed Pun with Composer, stops. Run `composer update shipfastlabs/pun` instead.

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | Updated, or already up to date. |
| 2 | A failed download or check, or a Composer install. |
