---
title: pun composer
description: Run other Composer commands.
---

Run Composer commands that have no `pun` command of their own. Only `dump-autoload` exists today.

## Usage

```bash
pun composer <command> [options]
```

```bash
pun composer dump-autoload
pun composer dump-autoload -o --no-dev
```

## Options

For `dump-autoload` (alias `dumpautoload`):

| Option | Description |
| --- | --- |
| `-o`, `--optimize` | Add PSR-0 and PSR-4 classes to the class map. |
| `-a`, `--classmap-authoritative` | Load classes from the class map only. |
| `--apcu` | Cache class lookups in APCu. |
| `--apcu-prefix=<prefix>` | The APCu prefix. |
| `--dev` | Include `autoload-dev`. |
| `--no-dev` | Skip `autoload-dev` and dev packages. |
| `--no-scripts` | Skip the root package's scripts. |
| `--no-plugins` | Skip Composer plugins. |
| `--ignore-platform-req=<req>` | Leave one requirement out of `platform_check.php`. |
| `--ignore-platform-reqs` | Write no `platform_check.php`. |
| `-d`, `--working-dir=<dir>` | Run in `<dir>`. |

## What happens

- Writes the autoloader again from `vendor/composer/installed.json`.
- The files match `composer dump-autoload` byte for byte.
- Runs the autoload scripts and allowed plugins.
- Without `--dev` or `--no-dev`, follows the last install.
- Pun never calls the Composer CLI.

## Limitations

- Only `dump-autoload` exists. Any other command exits 2.

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | Written. |
| 1 | Written, but a package is missing from `vendor/`. |
| 2 | Unknown command, or another error. |
