pi-header-mod

Add a project identifier request header to pi model requests.

Packages

Package details

extension

Install pi-header-mod from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-header-mod
Package
pi-header-mod
Version
0.1.0
Published
Jul 31, 2026
Downloads
181/mo · 9/wk
Author
geebos
License
MIT
Types
extension
Size
23.3 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-header-mod

pi-header-mod adds a project identifier request header to model requests made by the pi coding agent.

Install

pi install ./

Or test the extension directly:

pi -e ./extensions/index.ts

Configuration

Run:

/plugin:header

The default configuration is:

{
  "projectIdentifier": {
    "headerName": "Pi-Project-Identifier",
    "mode": "repo",
    "customValue": ""
  },
  "projectName": {
    "headerName": "Pi-Project-Name"
  }
}

Configuration is stored in ~/.pi/agent/extensions/pi-header-mod/config.json.

In TUI, /plugin:header presents two parallel options: header — Request header names and mod — Project identifier mode. Selecting header configures the Project identifier header and Project name header separately; selecting mod configures the identifier mode and custom value. The value resolution mode for Pi-Project-Name is fixed and is not configurable.

Modes:

  • directory: the current pi working directory (cwd)
  • repo: domain/user/repo from the origin Git remote
  • worktree: domain/user/repo/<worktree-directory-name>
  • custom: the configured custom value

The extension also sends Pi-Project-Name, whose value is the repository name from the remote (for example app). If no repository remote is available, it falls back to the Git project directory name or the current directory name. Its naming mode is not configurable; only its header name can be changed.

Remote URLs are normalized by removing credentials and the trailing .git. If the origin remote or worktree cannot be resolved, the identifier falls back to the directory value.

CLI alternatives:

/plugin:header show
/plugin:header reset
/plugin:header set projectIdentifier.mode repo
/plugin:header set projectIdentifier.headerName Pi-Project-Identifier
/plugin:header set projectName.headerName Pi-Project-Name
/plugin:header set projectIdentifier.customValue my-project

The older set mode, set header, set name-header, and set custom forms remain supported.

The extension requires pi 0.80.4 or newer for the before_provider_headers hook.