# phpv — Command Reference

The full phpv command surface, grouped by workflow. Every command is a single binary — no runtime dependencies.

## Install & build

| Command | Description |
| --- | --- |
| `phpv install <ver>` | Install a PHP version with default extensions |
| `phpv rebuild <ver>` | Rebuild PHP with different extensions (keeps deps) |
| `phpv uninstall <ver>` | Remove an installed PHP version |
| `phpv share <ver>` | Export PHP as a portable bundle |

## Switching

| Command | Description |
| --- | --- |
| `phpv use <ver>` | Switch for current shell (ephemeral; --global for global) |
| `phpv default <ver>` | Set global default PHP version |
| `phpv versions` | List installed PHP versions |
| `phpv which` | Show path to current PHP binary |

## Extensions

| Command | Description |
| --- | --- |
| `phpv extension list [ver]` | List installed extensions |
| `phpv extension available [ver]` | List extensions available for a version |
| `phpv extension add <name>…` | Install extensions into the active version |
| `phpv extension remove <name>…` | Remove extensions from the active version |

## PHAR & PECL

| Command | Description |
| --- | --- |
| `phpv phar install <name> [ver]` | Install a PHAR tool (composer/pie/wp-cli/phpunit) |
| `phpv phar update <name> [ver]` | Update a PHAR tool |
| `phpv pecl install <name|archive> [ver]` | Install a PECL extension |
| `phpv pecl uninstall <name> [ver]` | Remove a PECL extension |

## System & tools

| Command | Description |
| --- | --- |
| `phpv init <shell>` | Generate shell integration (bash/zsh/fish/pwsh/ksh) |
| `phpv doctor [ver]` | System readiness check + extension analysis |
| `phpv update` | Self-update phpv |
| `phpv completion <shell>` | Generate shell completion |

