repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

extensions/masks/README.md

Raw

masks

Switch model and thinking level together.

Install / load

This extension is loaded through the root pi-ext package. See root README.

Commands / tools / settings

Commands:

Tools: none.

Hooks:

Settings:

{
  "masks": {
    "pickerShortcut": "alt+m",
    "items": [
      {
        "name": "sol",
        "model": "openai-codex/gpt-5.6-sol",
        "thinkingLevel": "high",
        "shortcut": "alt+1"
      }
    ]
  }
}

masks.pickerShortcut is optional and defaults to alt+m. masks.items is an ordered array. Each item requires a unique name, a provider/model, and a thinkingLevel. shortcut is optional and must not collide with the picker or another mask. Thinking levels are off, minimal, low, medium, high, xhigh, and max. Settings are global because masks describe personal model access and bindings. Run /reload after changing them.

Prompt templates may equip a mask for one agent run:

---
description: Review this change
mask: terra
---
Review the current change.

mask must exactly match a configured mask name. The mask lasts through the prompt's tool loop and is restored at agent_end. Masked prompts cannot be queued while another agent run is active.

Behavior

The picker fuzzy-matches mask names, models, thinking levels, and shortcuts. Without a query, it shows every configured mask in settings order. A mask changes the model first, then applies its thinking level. Missing models or credentials leave the thinking level unchanged and report an error. Successful switches add no status because Pi's existing footer shows model and thinking.

Markdown source
File outline
# masks

Switch model and thinking level together.

## Install / load

This extension is loaded through the root pi-ext package.
See [root README](../../README.md).

## Commands / tools / settings

Commands:

- `/masks` opens the fuzzy mask picker.
- `/masks <name>` equips one mask directly.

Tools:
none.

Hooks:

- `input` detects prompt templates declaring a mask.
- `before_agent_start` equips a prompt mask.
- `agent_end` restores the previous model and thinking level.
- `session_start` reports invalid mask settings.

Settings:

```json
{
  "masks": {
    "pickerShortcut": "alt+m",
    "items": [
      {
        "name": "sol",
        "model": "openai-codex/gpt-5.6-sol",
        "thinkingLevel": "high",
        "shortcut": "alt+1"
      }
    ]
  }
}
```

`masks.pickerShortcut` is optional and defaults to `alt+m`.
`masks.items` is an ordered array.
Each item requires a unique `name`, a `provider/model`, and a `thinkingLevel`.
`shortcut` is optional and must not collide with the picker or another mask.
Thinking levels are `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
Settings are global because masks describe personal model access and bindings.
Run `/reload` after changing them.

Prompt templates may equip a mask for one agent run:

```markdown
---
description: Review this change
mask: terra
---
Review the current change.
```

`mask` must exactly match a configured mask name.
The mask lasts through the prompt's tool loop and is restored at `agent_end`.
Masked prompts cannot be queued while another agent run is active.

## Behavior

The picker fuzzy-matches mask names, models, thinking levels, and shortcuts.
Without a query, it shows every configured mask in settings order.
A mask changes the model first, then applies its thinking level.
Missing models or credentials leave the thinking level unchanged and report an error.
Successful switches add no status because Pi's existing footer shows model and thinking.