Skip to content

mikeyobrien/pi-pin-context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-pin-context

A pi extension that adds a /context command for pinning files and glob patterns to chat sessions. Pinned file contents are injected into the LLM conversation automatically.

Screenshot 2026-03-17 at 7 55 46 PM

Install

Global (all projects)

cp pin-context.ts ~/.pi/agent/extensions/pin-context.ts

Project-local

mkdir -p .pi/extensions
cp pin-context.ts .pi/extensions/pin-context.ts

Quick test

pi -e ./pin-context.ts

Extensions in auto-discovered locations (~/.pi/agent/extensions/ or .pi/extensions/) can be hot-reloaded with /reload.

Usage

/context add <glob>              - Pin files matching glob
/context add <glob> --paths      - Pin file paths only (no content)
/context add <glob> --persist    - Persist across sessions
/context remove <pattern>        - Remove a pinned pattern
/context clear                   - Clear all pinned context
/context show                    - Show pinned context (TUI overlay)

Examples

# Pin all markdown files (including those in dot-directories like .agents/)
/context add **/*.md

# Pin source files, paths only
/context add src/**/*.ts --paths

# Pin config and persist across sessions
/context add tsconfig.json --persist

Features

  • Glob patterns match files inside dot-directories (.agents/, .git/, etc.)
  • Files over 500KB are skipped automatically
  • Persistent pins survive session restarts (stored in .pi/pin-context.json)
  • TUI overlay for browsing and managing pinned context (/context show)
  • Tab completion for subcommands, patterns, and flags

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors