PIM (Prompt Instruction Manager) is a command-line utility for managing prompt instructions and related files from multiple sources. Think of it as a package manager for AI prompts and instructions.
PIM solves common challenges when working with AI prompts and instructions across projects:
Define your instructions once in a dedicated repository, then reuse them across multiple projects. Keep your AI prompts version-controlled, reviewable, and maintainable just like your code.
Split large instruction files into smaller, focused components. PIM automatically merges and concatenates them into a single file, making complex prompt systems easier to maintain and understand.
Pull instructions and prompts from external repositories like github/awesome-copilot. Stay up-to-date with community best practices and organizational standards.
Perfect for organizations managing multiple repositories. Centralize prompt governance, ensure consistency across teams, and maintain compliance with organizational standards in multi-repo setups.
brew install hubblew/tap/pimDownload pre-built binaries from the releases page.
Use the interactive init command to automatically detect your LLM tools and set up PIM:
pim initThis will:
- Detect LLM CLI tools (like GitHub Copilot) in your system
- Ask you to choose a configuration file name (default:
pim.yaml) - Create an instructions directory (default:
./instructions) - Discover existing instruction files (
.github/copilot-instructions.md,AGENTS.md, etc.) - Generate a
pim.yamlconfiguration file
Then simply run:
pim install .- Create instruction files:
mkdir -p prompts echo "You are a helpful assistant." > prompts/system.txt echo "Follow best practices." > prompts/user.txt- Create a
pim.yamlconfiguration file:
version: 1 targets: - name: prompts output: .github/copilot-instructions.md include: - "prompts/system.txt" - "prompts/user.txt"- Run PIM:
pim installNote: After running pim install, .github/copilot-instructions.md becomes a managed file. To modify it, update the source files (e.g., prompts/system.txt, prompts/user.txt) and run pim install again, rather than editing the output file directly.
Create a central repository of prompts and reuse them across multiple projects:
# In your shared prompts repository: github.com/myorg/ai-prompts # prompts/ # ├── code-review.md # ├── documentation.md # └── testing.md# In each project's pim.yaml version: 1 sources: - name: org-prompts url: github.com/myorg/ai-prompts targets: - name: copilot-instructions output: .github/copilot-instructions.md include: - "@org-prompts/prompts/code-review.md" - "@org-prompts/prompts/documentation.md"Split complex instructions into maintainable components that PIM merges automatically:
version: 1 targets: - name: combined-instructions output: .github/copilot-instructions.md # .md extension triggers concat strategy include: - "instructions/base-rules.md" - "instructions/coding-style.md" - "instructions/security-guidelines.md" - "instructions/project-specific.md" # Results in a single file with all instructions concatenatedStay updated with best practices from community repositories:
version: 1 sources: - name: awesome-copilot url: github.com/github/awesome-copilot - name: org-standards url: github.com/myorg/engineering-standards targets: - name: ai-instructions output: .github/copilot-instructions.md include: - "@awesome-copilot/prompts/best-practices.md" - "@org-standards/ai/code-quality.md" - "@org-standards/ai/security.md" - "docs/project-context.md"Ensure consistent AI behavior across organizational repositories:
# Central governance repo: github.com/myorg/ai-governance # governance/ # ├── security-requirements.md # ├── code-standards.md # └── compliance.md # Each team repository uses: version: 1 sources: - name: governance url: github.com/myorg/ai-governance targets: - name: copilot-setup output: .github/copilot-instructions.md include: - "@governance/governance/security-requirements.md" - "@governance/governance/code-standards.md" - "@governance/governance/compliance.md" - ".github/team-guidelines.md"pim init- Initialize a new PIM configuration (interactive setup)pim install [directory]- Fetch files from sources to targets (defaults to current directory)pim version- Print version informationpim help- Show help
PIM looks for pim.yaml or .pim.yaml in the current directory (or the directory specified as an argument).
version: 1 sources: - name: local-prompts url: /path/to/prompts - name: shared-repo url: github.com/user/prompts-repo targets: - name: my-project output: prompts/ include: - "@local-prompts/system.txt" - "@local-prompts/user.txt" - "@shared-repo/templates/common.txt"Flatten strategy (default for directories) - All files copied to output root:
targets: - name: prompts output: output/ strategy: flatten # This is the default for directories include: - "prompts/system.txt" - "prompts/user.txt" - "deep/nested/file.txt" # Result: # output/ # ├── system.txt # ├── user.txt # └── file.txtPreserve strategy - Maintains directory structure:
targets: - name: prompts output: output/ strategy: preserve include: - "prompts/system.txt" - "prompts/user.txt" - "deep/nested/file.txt" # Result: # output/ # ├── prompts/ # │ ├── system.txt # │ └── user.txt # └── deep/ # └── nested/ # └── file.txtConcat strategy (default for .md/.txt files) - Concatenates all files:
targets: - name: combined-prompts output: all-prompts.md # .md or .txt triggers concat by default include: - "prompts/system.txt" - "prompts/user.txt" # Result: Single file # all-prompts.mdThe working_dir source is automatically available and points to the current directory:
version: 1 targets: - name: local-files output: output/ include: - "file1.txt" - "file2.txt"Sources:
name- Unique identifier for the sourceurl- Local directory path or Git repository URL- Local:
/absolute/pathor./relative/path - Git:
github.com/user/repo
- Local:
Special Sources:
working_dir- Automatically added, points to current working directory
Targets:
name- Target nameoutput- Directory where files will be copied, or file path for concatenationstrategy- How to organize copied files (optional, auto-detected)flatten- Remove subdirectories, copy all files to output root (default for directories)preserve- Maintain original directory structureconcat- Concatenate all files into a single output file (default for .md/.txt outputs)
include- List of file paths to include- Format:
"path/to/file.txt"for local files (from working_dir source) - Format:
"@source-name/path/to/file.txt"for files from other sources - Wildcards: Supports
*,?, and[...]patterns (e.g.,"prompts/*.md","@source/docs/[a-z]*.txt")
- Format:
make test # Run all tests make test-verbose # Run tests with verbose outputmake build # Build the binary make clean # Remove build artifactsSee LICENSE file for details.
For detailed specification, see SPEC.md.