Metadata-Version: 2.4
Name: prompt-vault-cli
Version: 0.1.0
Summary: Save, tag, search, and version your best prompts - Interactive CLI with TUI
Author-email: larryste1 <coding2013@evv.bz>
Maintainer-email: larryste1 <coding2013@evv.bz>
License: MIT
Project-URL: Homepage, https://github.com/larryste1/prompt-vault
Project-URL: Repository, https://github.com/larryste1/prompt-vault.git
Project-URL: Documentation, https://github.com/larryste1/prompt-vault#readme
Project-URL: Bug Tracker, https://github.com/larryste1/prompt-vault/issues
Keywords: prompts,cli,vault,ai,productivity,llm,text-generation,knowledge-base
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.7.0
Requires-Dist: pyperclip>=1.8.2
Requires-Dist: thefuzz>=0.20.0
Requires-Dist: pyyaml>=6.0.1
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Dynamic: license-file

# 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

```bash
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

```bash
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

```bash
# 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:

```bash
# 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

```bash
# 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)

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

# Go
./vault get "code-review"
```

### Search prompts

```bash
# 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

```bash
# 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

```bash
# 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)

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

## Running Tests

### Python

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

### Go

```bash
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
