Skip to main content

A CLI tool for managing and using prompt templates with placeholder injection.

Project description

Proplate

A CLI tool for managing and using prompt templates with placeholder injection. Perfect for storing reusable prompt templates and quickly filling them with context-specific information.

Features

  • 🎯 Interactive template selection with fuzzy search
  • Direct template access with tab autocomplete
  • 📋 Auto-copy to clipboard for seamless pasting
  • 🔧 Placeholder support with single-line and multi-line input
  • 📝 YAML frontmatter for template metadata
  • 🎨 Rich CLI output with beautiful formatting

Installation

pip install proplate

Quick Start

1. Create a template

Easy way:

proplate new code-review

This opens your editor with starter content:

---
title: Code Review
description: Add a description here
---

# {{placeholder}}

Your template content goes here.
Use {{placeholder}} syntax for variables.

Or manually create ~/.proplate/templates/code-review.md:

---
title: Code Review Guide
description: Template for thorough code reviews
---

# Code Review: {{file_path}}

## Context
{{context}}

## Review Areas
{{focus_areas}}

## Security Considerations
{{security_notes}}

Pro tip: Make placeholders self-documenting!

{{Your feature request here. Be specific about WHAT and WHY.}}

This way, the placeholder itself tells users what to enter.

2. Use your template

Interactive mode (with fuzzy search):

proplate

Direct selection (with tab autocomplete):

proplate code-review

The tool will:

  1. Prompt you for each {{placeholder}}
  2. Support multi-line input when needed
  3. Automatically copy the filled template to your clipboard
  4. You can then paste directly into Cursor, ChatGPT, or any other tool

Usage

Main Commands

# Interactive template selector
proplate

# Use a specific template (supports tab completion)
proplate <template-name>

# Create a new template (opens in $EDITOR with starter content)
proplate new <template-name>

# List all available templates
proplate list

# Edit an existing template in $EDITOR
proplate edit <template-name>

# Delete a template (with confirmation)
proplate delete <template-name>

# Delete a template without confirmation
proplate delete <template-name> --force

# Show templates directory path
proplate path

# Initialize templates directory (optional - auto-created on first use)
proplate init

Managing Templates

Create a new template:

proplate new my-template

Creates a template with starter content and opens it in your $EDITOR.

Edit existing template:

proplate edit my-template

Delete a template:

proplate delete my-template        # With confirmation prompt
proplate delete my-template --force # Skip confirmation

Manual way: Create/edit .md files directly in ~/.proplate/templates/ (auto-created on first use)

Shell Autocomplete

Enable tab completion for template names:

# For bash
proplate --install-completion bash

# For zsh
proplate --install-completion zsh

# For fish
proplate --install-completion fish

Then restart your shell or source your config file.

Template Format

Templates are Markdown files with optional YAML frontmatter and {{placeholder}} syntax.

Basic Template

# Hello {{name}}!

This is a simple template.

Template with Frontmatter

---
title: Bug Analysis
description: Structured template for bug investigation
---

# Bug Report: {{bug_id}}

## Description
{{description}}

## Steps to Reproduce
{{steps}}

## Expected vs Actual
**Expected:** {{expected}}
**Actual:** {{actual}}

Placeholder Guidelines

  • Use {{placeholder}} syntax
  • Placeholders can be descriptive instructions (e.g., {{Your request here. Be specific!}})
  • Support spaces, punctuation, and special characters
  • Duplicate placeholders are prompted once and replaced everywhere
  • Whitespace variations ({{name}}, {{ name }}) are normalized
  • Leave input empty to open multi-line editor ($EDITOR)

Examples

Example 1: Code Review Template

~/.proplate/templates/code-review.md:

---
title: Code Review
description: Comprehensive code review template
---

# Code Review: {{file_path}}

## Context
{{context}}

## Changes Summary
{{changes}}

## Review Checklist
- [ ] Code quality and readability
- [ ] Error handling
- [ ] Security considerations
- [ ] Performance implications
- [ ] Test coverage

## Specific Feedback
{{feedback}}

Example 2: Refactoring Plan

~/.proplate/templates/refactor.md:

---
title: Refactoring Plan
description: Template for planning refactoring work
---

# Refactoring: {{component_name}}

## Current State
{{current_state}}

## Problems
{{problems}}

## Proposed Solution
{{solution}}

## Migration Strategy
{{migration}}

## Risks
{{risks}}

Tips

  1. Multi-line Input: Press Enter on an empty prompt to open your $EDITOR for multi-line content
  2. Template Organization: Use descriptive filenames (they become the template name)
  3. Metadata: Add title and description in frontmatter for better organization
  4. Separators: Use --- freely in your template body (only the first block is frontmatter)

Development

# Clone repository
git clone <repo-url>
cd proplate

# Install with uv
uv sync

# Run locally
uv run proplate

# Run tests
uv run pytest

# Run specific test
uv run pytest tests/test_template.py -v

Requirements

  • Python >= 3.12
  • Dependencies:
    • typer[all] - CLI framework
    • questionary - Interactive prompts
    • pyperclip - Clipboard operations
    • pyyaml - YAML parsing
    • rich - Terminal formatting

License

MIT

Contributing

Contributions welcome! Please ensure:

  1. Tests pass: pytest
  2. Code follows project style (modern Python 3.12+ syntax)
  3. Add tests for new features

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proplate-0.1.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

proplate-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file proplate-0.1.0.tar.gz.

File metadata

  • Download URL: proplate-0.1.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for proplate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 367bb28c6686112ff057f0c15effc2db066b7e84009fab17b73e9dc1773c55e8
MD5 a15dfbc02b2350d27ccd48f10ce3b103
BLAKE2b-256 42eea9a30b2ea2be60ab5c67d000b1b4a594b6361db01b537c2bfd4958be0b36

See more details on using hashes here.

Provenance

The following attestation bundles were made for proplate-0.1.0.tar.gz:

Publisher: release.yml on eliorc/proplate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file proplate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: proplate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for proplate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c06ce149c838bd59199af32ebdbd0c787fcb6b8440a6932a1596b6d4a13edecc
MD5 5075ed3601ec39ffd0c21a47bdceec56
BLAKE2b-256 5b9cf26d7dbe2f99492de4b5b4170df5dd9841b586d36f5477a3600d3ae31ba5

See more details on using hashes here.

Provenance

The following attestation bundles were made for proplate-0.1.0-py3-none-any.whl:

Publisher: release.yml on eliorc/proplate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page