# pi-copyblock

A tiny [Pi](https://github.com/earendil-works/pi) extension that copies the last fenced code block from the latest agent message.
Uses Pi’s public `copyToClipboard()` function—the same clipboard implementation used by Pi’s built-in `/copy` command. `/copyblock` only adds a filtering step so that it extracts the final fenced code block from the latest agent message before copying.

## Install

```bash
pi install git:github.com/johannesnauta/pi-copyblock
```

For local development, clone and :

```bash
pi -e path/to/repository/extensions/copyblock.ts
```

## Usage

Run `/copyblock`. The block's contents are copied without the surrounding triple backticks or language tag. If the latest response has no fenced code block, nothing is copied.
