# squiggle

Quietly polish grammar and spelling in your pi prompts.

The extension intercepts user input, shows a `squiggling...` spinner while processing, corrects spelling and grammar using a configured model, shows a colored diff, and submits the corrected prompt automatically without confirmation. Named after the red squiggle from your favorite spell-checker.

## Install

```bash
pi install npm:@anton-kochev/pithos.squiggle
```

Pin to a version:

```bash
pi install npm:@anton-kochev/pithos.squiggle@<version>
```

For local development from a checkout of [`pithos-kit`](https://github.com/anton-kochev/pithos-kit):

```bash
pi install ./pithos.squiggle
```

Project-local install:

```bash
pi install ./pithos.squiggle -l
```

Temporary test run:

```bash
pi -e ./pithos.squiggle
```

## Pithos `.pithos` config

```yaml
pi:
  extensions:
    "@anton-kochev/pithos.squiggle": "npm:0.4.0"
```

## Configuration

Create `.pi/squiggle.json` in your project:

```json
{
  "mode": "on",
  "model": "openai-codex/gpt-5.4-mini",
  "maxInputChars": 500
}
```

Options:

- `mode`: `"on"` or `"off"`
- `model`: pi model spec in `provider/model` format
- `maxInputChars`: maximum input length to send to the correction model

Environment variables override the config file:

```bash
SQUIGGLE_MODE=off pi
SQUIGGLE_MODEL=openai-codex/gpt-5.4-mini pi
SQUIGGLE_MAX_CHARS=1000 pi
```

## Commands

Inside pi:

```text
/squiggle toggle      # switch between on/off
/squiggle-status      # show status
```

The toggle state is saved in the current pi session and overrides `.pi/squiggle.json` and environment configuration for that session.

## Notes

This package imports pi runtime packages as peer dependencies:

- `@earendil-works/pi-ai`
- `@earendil-works/pi-coding-agent`

Do not bundle those dependencies; pi provides them at runtime.
