← Catalog

pi-startup-commands

Run configured Pi extension commands on interactive startup and reload.

Extension

Install

Install with PiG

pig install npm:pi-startup-commands

Install with Pi

pi install npm:pi-startup-commands
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.js"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

pi-startup-commands

Run configured Pi extension commands when an interactive session starts or extensions reload.

For example, set max-context to 300k automatically while keeping its code unchanged.

Install

Requires Pi 1.4.0 or later and Node.js 22.19 or later.

pi install git:github.com/uuie/pi-startup-commands@v0.1.0

After the npm release is published, the package can also be installed with:

pi install npm:pi-startup-commands

Create ~/.pi/agent/startup-commands.json:

{
  "commands": [
    "/max-context 300k"
  ]
}

Restart Pi or run /reload, then run /max-context to verify the limit. Install max-context separately with pi install npm:max-context when using this example.

Pi's PI_CODING_AGENT_DIR override also controls where this extension reads its configuration. A missing file or an empty commands array leaves startup unchanged.

Behavior

EventAction
Interactive startupRead the file and dispatch configured commands
/reloadReread the file and dispatch configured commands
New, resumed or forked sessionKeep the current runtime settings
RPC or print modeLeave startup unchanged

Commands must be registered extension commands, such as /max-context or /ponytail. The entire list is validated before dispatch. Unknown commands, skills, prompt templates, plain prompts and multiline values are rejected, so a typo cannot become a model prompt.

Commands are dispatched in the listed order through Pi's public command-expansion API. Dispatch waits until all extensions have finished their session_start handlers. Each command owns its asynchronous work and error reporting.

Configuration errors appear as a Pi notification. Configuration contents are omitted from errors. The extension does not create configuration files or modify other extensions.

Development

npm install --ignore-scripts
npm run build
npm test
npm pack --dry-run

The only peer dependency is the Pi host API. No runtime dependencies are bundled.

License

MIT.