Skip to main content

Save, tag, search, and version your best prompts - Interactive CLI with TUI

Project description

Prompt Vault CLI

Dual Python + Go implementation with Docker support

Save, tag, search, and version your best prompts with a unified CLI.

Features

  • ๐Ÿ” Save prompts โ€“ Store with name, tags, and auto-versioning
  • ๐Ÿ” Fuzzy search โ€“ Find prompts by keyword or tag
  • ๐Ÿ“‹ Clipboard copy โ€“ One command to copy prompt ready to paste
  • ๐Ÿ“š Version history โ€“ Git-based versioning with diff and revert
  • ๐Ÿ“ฆ Export/Import โ€“ Backup and restore your vault
  • ๐Ÿ Python version โ€“ Typer CLI with Rich output
  • ๐Ÿน Go version โ€“ Fast single binary, no dependencies
  • ๐Ÿณ Docker ready โ€“ Pre-configured containers for both
  • ๐Ÿ–ฅ๏ธ Interactive TUI โ€“ Run without arguments for menu-driven interface

Quick Start

Python Version

cd prompt_vault/python
pip install -r requirements.txt

# Interactive TUI (no arguments)
python3 vault_cli.py

# Or use CLI commands
python3 vault_cli.py create --name "my-prompt" --tags "demo,test"
python3 vault_cli.py get "my-prompt"

Go Version

cd prompt_vault/go
go mod download
go build -o vault

# Interactive TUI (no arguments)
./vault

# Or use CLI commands
./vault create --name "my-prompt" --tags "demo,test"
./vault get "my-prompt"

Docker

# Build and run Python version
docker build -f Dockerfile.python -t prompt-vault:python .
docker run -v $(pwd)/data:/app/data prompt-vault:python create --name "my-prompt"

# Build and run Go version
docker build -f Dockerfile.go -t prompt-vault:go .
docker run -v $(pwd)/data:/app/data prompt-vault:go create --name "my-prompt"

# Or use docker-compose
docker-compose run python create --name "my-prompt"
docker-compose run go create --name "my-prompt"

Commands

Run vault without arguments to open the Interactive TUI.

Command Python Go Description
(tui) vault_cli.py vault Interactive menu (default)
create vault_cli.py create -n "name" vault create -n "name" Create a new prompt
get vault_cli.py get "name" vault get "name" Get prompt (copies to clipboard)
search vault_cli.py search "query" vault search "query" Fuzzy search prompts
list vault_cli.py list vault list List all prompts
tags vault_cli.py tags vault tags List all tags
version vault_cli.py version "name" vault version "name" View version history
export vault_cli.py export vault export Export vault
import vault_cli.py import file.yaml vault import file.yaml Import prompts
delete vault_cli.py delete "name" vault delete "name" Delete a prompt

Interactive TUI

Run without arguments to open the interactive terminal UI:

# Python
python3 vault_cli.py

# Go
./vault

TUI Menu:

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘         Prompt Vault                     โ•‘
โ•‘  Save, tag, search, version prompts      โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Main Menu:
  1 - List all prompts
  2 - Create new prompt
  3 - Search prompts
  4 - View tags
  5 - Get prompt (copy to clipboard)
  6 - Delete prompt
  q - Quit

Navigate with number keys, enter text when prompted, and press Enter to continue between screens.

Examples

Create a prompt with tags

# Python
python vault_cli.py create --name "code-review" --tags "code,review,analysis"

# Go
./vault create --name "code-review" --tags "code,review,analysis"

Get a prompt (copies to clipboard)

# Python
python vault_cli.py get "code-review"

# Go
./vault get "code-review"

Search prompts

# Python
python vault_cli.py search "code analysis"
python vault_cli.py search --tag "python"

# Go
./vault search "code analysis"
./vault search --tag "python"

View version history

# Python
python vault_cli.py version "code-review"
python vault_cli.py version "code-review" --revert 2

# Go
./vault version "code-review"
./vault version "code-review" --revert 2

Export/Import backup

# Export
python vault_cli.py export --output backup.yaml
./vault export --output backup.yaml

# Import
python vault_cli.py import backup.yaml
./vault import backup.yaml

Architecture

prompt_vault/
โ”œโ”€โ”€ python/                     # Python implementation
โ”‚   โ”œโ”€โ”€ vault_cli.py           # Main CLI entry (Typer)
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ vault.py           # CRUD operations (SQLite)
โ”‚   โ”‚   โ”œโ”€โ”€ search.py          # Fuzzy search (thefuzz)
โ”‚   โ”‚   โ”œโ”€โ”€ versioning.py      # Git versioning (GitPython)
โ”‚   โ”‚   โ””โ”€โ”€ config.py          # Config handling (TOML/YAML)
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”œโ”€โ”€ clipboard.py       # Cross-platform clipboard
โ”‚   โ”‚   โ””โ”€โ”€ output.py          # Rich formatting
โ”‚   โ””โ”€โ”€ tests/
โ”‚       โ””โ”€โ”€ test_vault.py      # Unit tests
โ”‚
โ”œโ”€โ”€ go/                         # Go implementation
โ”‚   โ”œโ”€โ”€ main.go                # Main entry
โ”‚   โ”œโ”€โ”€ cmd/                   # Cobra commands
โ”‚   โ”‚   โ”œโ”€โ”€ root.go
โ”‚   โ”‚   โ”œโ”€โ”€ create.go
โ”‚   โ”‚   โ”œโ”€โ”€ get.go
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ internal/vault/        # Core logic
โ”‚       โ”œโ”€โ”€ vault.go           # CRUD (SQLite)
โ”‚       โ”œโ”€โ”€ search.go          # Fuzzy search
โ”‚       โ””โ”€โ”€ versioning.go      # Version management
โ”‚
โ””โ”€โ”€ data/                       # Shared data directory
    โ”œโ”€โ”€ prompts.db             # SQLite database
    โ””โ”€โ”€ versions/              # Version history

Configuration

Environment Variables

Variable Description Default
PROMPT_VAULT_DATA Data directory ~/.prompt_vault
PROMPT_VAULT_CONFIG Config file path ~/.prompt_vault/config.toml

Config File (TOML)

data_dir = "~/.prompt_vault"
default_tags = ["general"]
auto_copy = true
auto_version = true
search_limit = 10
list_limit = 50

Running Tests

Python

cd prompt_vault/python
pip install pytest
pytest tests/ -v

Go

cd prompt_vault/go
go test ./internal/vault/ -v

Performance Comparison

Operation Python Go
Startup time ~200ms ~10ms
Create prompt ~50ms ~5ms
Search (1000 prompts) ~100ms ~10ms
Binary size N/A ~15MB

License

MIT

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests for both Python and Go
  5. Submit a pull request

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

prompt_vault_cli-0.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

prompt_vault_cli-0.1.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prompt_vault_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for prompt_vault_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7dd5d6a62da4f5a38cac530b400b7fa9b9957992e9614c8133619efb961ac911
MD5 672aeb763af7b9044519e11edec3934b
BLAKE2b-256 07de6089d8d56d8952b78ed5c9ec6f173c1586d311077581ac1670e591fae6d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prompt_vault_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f2af56cebc2df5cd2251cbb57305b9150f83596d09554bc59e44e16ae203626
MD5 e18195063f593b67d8c65c08456acefe
BLAKE2b-256 6612b3fad901a1deb59841157dacf70ab3cefc6c58d5b37d6b6f072a2ffb3510

See more details on using hashes here.

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