Skip to content

Repository files navigation

prompt bar image

PromptBar

A macOS menu bar application for managing and quickly accessing your prompt templates. Built with SwiftUI and Core Data.

Features

  • Menu Bar Integration - Quick access from anywhere via the menu bar
  • Global Hotkey - Press ⌘⌥⇧P to open PromptBar from any application
  • Prompt Management - Create, edit, and delete prompt templates with ease
  • Smart Organization - Tag prompts with custom colored labels
  • Powerful Search - Instant search across all prompts with debounced filtering
  • Flexible Sorting - Sort by most recent, most used, or alphabetically
  • Usage Tracking - Automatically tracks how often you use each prompt
  • Keyboard Navigation - Navigate with arrow keys, copy with Return
  • Undo Delete - Accidentally deleted a prompt? Undo it with ⌘Z
  • Visual Feedback - Clear indication when prompts are copied to clipboard
  • Dark Mode Support - Seamlessly adapts to your system theme

Requirements

  • macOS 13.0 (Ventura) or later
  • Xcode 15.0 or later (for building)

Installation

Building from Source

  1. Clone the repository:
git clone git@github.com:kaufmanhenry/PromptBar.git
cd PromptBar
  1. Open the project in Xcode:
open PromptBar.xcodeproj
  1. Build and run (⌘R)

Accessibility Permissions

For the global hotkey (⌘⌥⇧P) to work system-wide, you'll need to grant PromptBar accessibility permissions:

  1. Open System Settings > Privacy & Security > Accessibility
  2. Add PromptBar to the list of allowed applications
  3. Toggle the permission on

Usage

Basic Operations

  • Open PromptBar: Click the menu bar icon or press ⌘⌥⇧P
  • Create New Prompt: Click the + button or press ⌘N
  • Search Prompts: Click the search field or start typing
  • Copy Prompt: Click the copy icon, press ⌘C, or press Return on selected prompt
  • Edit Prompt: Click the edit icon or press ⌘E
  • Delete Prompt: Click the trash icon or press Delete
  • Navigate: Use and arrow keys to select prompts
  • Quit: Press ⌘Q

Keyboard Shortcuts

Shortcut Action
⌘⌥⇧P Toggle PromptBar (global)
⌘N New prompt
⌘C / Return Copy selected prompt
⌘E Edit selected prompt
Delete Delete selected prompt
⌘Z Undo delete
⌘Q Quit application
/ Navigate prompts

Tags

Organize your prompts with colored tags:

  • Assign multiple tags to each prompt
  • Create tags on-the-fly while editing prompts
  • Filter prompts by searching for tag names
  • Each tag can have a custom color

Architecture

Tech Stack

  • SwiftUI - Modern declarative UI framework
  • Core Data - Persistent data storage
  • AppKit - Menu bar integration (NSStatusItem, NSPopover)
  • Combine - Reactive search debouncing

Key Components

  • StatusBarController - Manages menu bar icon and popover presentation
  • MenuBarView - Main SwiftUI interface
  • DataController - Core Data stack and operations
  • PromptManager - State management and business logic
  • Prompt & Tag Extensions - Core Data entity helpers

Data Model

Prompt
├── id: UUID
├── title: String
├── content: String
├── createdAt: Date
├── updatedAt: Date
├── usageCount: Int32
├── lastUsedAt: Date?
└── tags: [Tag]

Tag
├── id: UUID
├── name: String
├── colorHex: String?
└── prompts: [Prompt]

Development

Project Structure

PromptBar/
├── PromptBarApp.swift          # App entry point & AppDelegate
├── StatusBarController.swift    # Menu bar & popover management
├── MenuBarView.swift           # Main popover interface
├── AddPromptView.swift         # Create/edit prompt form
├── TagSelectorView.swift       # Tag selection interface
├── DataController.swift        # Core Data stack
├── PromptManager.swift         # State management
├── Prompt+Extensions.swift     # Prompt entity helpers
├── Tag+Extensions.swift        # Tag entity helpers
├── SampleDataGenerator.swift   # Debug sample data
├── ContentView.swift           # Legacy (not used)
└── PromptBar.xcdatamodeld/     # Core Data model

Debug Features

In debug builds, a debug menu is available in the header to:

  • Generate sample data for testing
  • Clear all data

Building for Release

  1. Select "Any Mac" as the build destination
  2. Choose Product > Archive
  3. Export the application using Developer ID or Mac App Store distribution

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - feel free to use this project however you'd like.

Acknowledgments

Built with Claude Code - AI-assisted development by Anthropic.

About

A macOS menu bar application for managing and quickly accessing your prompt templates.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages