---
slug: "haphazarddev-pi-interactive-code-review"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/HaphazardDev/pi-extensions@main/README.md"
repo: "https://github.com/HaphazardDev/pi-extensions"
source_file: "README.md"
branch: "main"
---
# HaphazardDev pi extensions

A collection of pi extension packages published to npm and installable directly in pi.

## Install from npm

```bash
pi install npm:@haphazarddev/pi-vim-quit
pi install npm:@haphazarddev/pi-ask-user-question
pi install npm:@haphazarddev/pi-copy-code-block
pi install npm:@haphazarddev/pi-interactive-code-review
```

## Packages

### `@haphazarddev/pi-vim-quit`

Quit pi with Vim-style commands typed as normal input:

- `:q`
- `:qa`
- `:wq`

Install:

```bash
pi install npm:@haphazarddev/pi-vim-quit
```

Package docs:
- [`extensions/pi-vim-quit/README.md`](https://github.com/HaphazardDev/pi-extensions/blob/HEAD/extensions/pi-vim-quit/README.md)

### `@haphazarddev/pi-ask-user-question`

Adds an `ask_user_question` tool so pi can ask you for clarification, confirmation, selections, and free-form input through the UI.

Install:

```bash
pi install npm:@haphazarddev/pi-ask-user-question
```

Package docs:
- [`extensions/pi-ask-user-question/README.md`](https://github.com/HaphazardDev/pi-extensions/blob/HEAD/extensions/pi-ask-user-question/README.md)

### `@haphazarddev/pi-copy-code-block`

Copy a code block from the latest assistant message to your clipboard with `/copy-code` or `Ctrl+Alt+C`.

Install:

```bash
pi install npm:@haphazarddev/pi-copy-code-block
```

Package docs:
- [`extensions/pi-copy-code-block/README.md`](https://github.com/HaphazardDev/pi-extensions/blob/HEAD/extensions/pi-copy-code-block/README.md)

### `@haphazarddev/pi-interactive-code-review`

Review your branch like a pull request inside pi: browse the diff against the default branch, leave line/hunk/file comments, batch them up, or send them immediately to the agent and see replies attached back to the review thread.

Install:

```bash
pi install npm:@haphazarddev/pi-interactive-code-review
```

Package docs:
- [`extensions/pi-interactive-code-review/README.md`](https://github.com/HaphazardDev/pi-extensions/blob/HEAD/extensions/pi-interactive-code-review/README.md)

## Install from a local checkout

If you want to test directly from this repository:

```bash
pi install ./extensions/pi-vim-quit
pi install ./extensions/pi-ask-user-question
pi install ./extensions/pi-copy-code-block
pi install ./extensions/pi-interactive-code-review
```

## For maintainers

This repository is an npm workspace monorepo with packages under `extensions/`.

### Local commands

```bash
vp install
vp run typecheck
vp run changeset
vp run release:status
```

### Release workflow

This repo uses Changesets for automated npm releases.

#### Initial publish

For the very first release of a package, keep the package at its existing version (currently `0.1.0`) and publish it without a changeset. On `main`, the workflow will attempt to publish any unpublished packages at their current version.

#### Ongoing releases

1. Add a changeset for consumer-facing package changes with `vp run changeset`.
2. Merge to `main`.
3. GitHub Actions opens or updates a release PR.
4. Merging the release PR publishes updated `@haphazarddev/*` packages to npm.

#### Publishing auth

Prefer npm trusted publishing with GitHub Actions OIDC. This workflow already includes `id-token: write` for that setup.

If you are not using trusted publishing yet, you can instead provide an `NPM_TOKEN` GitHub Actions secret.

To ensure CI runs on the auto-generated `changeset-release/*` PRs, also configure a `RELEASE_GITHUB_TOKEN` secret (PAT or GitHub App installation token) with repository `Contents: Read and write` and `Pull requests: Read and write`. The release workflow falls back to `GITHUB_TOKEN`, but that fallback will not trigger downstream workflows for release PR updates.

The workflow is defined in `.github/workflows/release.yml`.
