Prompt hotkey CLI
Project description
Keys: Prompt Hotkey CLI
keys is a lightweight CLI tool that binds system-wide hotkeys to prompts and dispatches them to LLM CLIs or other tools. Perfect for rapid text transformation workflows.
Quick Start
# Set your prompts directory (e.g., markdown files with prompts)
keys prompts ~/my-prompts
# Register a hotkey
keys add ctrl+shift+f fix.md
# List your keys
keys list
# Show a prompt or pipe text through it
keys show fix.md
echo "bad code" | keys show fix.md
Installation
pip install keys-cli
Or with poetry:
poetry add keys-cli
Setup
-
Create a prompts directory with markdown files:
~/my-prompts/ ├── fix.md ├── commit.md └── refactor.md -
Set the prompts directory:
keys prompts ~/my-prompts
-
Register hotkeys:
keys add ctrl+shift+f fix.md keys add cmd+shift+j commit.md # macOS keys add win+alt+r refactor.md # Windows
-
Start the daemon:
keys start -
Use your hotkeys - select text anywhere and press your key combination. The text gets piped to your prompt and the result goes to clipboard.
Commands
keys prompts <path> # Set prompts directory
keys add <key> <prompt_name> # Register a hotkey
keys list # Show all hotkeys
keys remove <key> # Unregister a hotkey
keys show <prompt_name> # Display prompt content or pipe input
keys start # Start the hotkey daemon
keys stop # Stop the daemon
Key Combinations
Supports: ctrl, shift, alt, cmd (macOS), win (Windows), option (macOS = alt)
Examples:
ctrl+shift+f- All platformscmd+shift+j- macOSwin+alt+x- Windowsoption+shift+k- macOS (option = alt)
Prompt Files
Create simple markdown files with your prompt templates:
fix.md:
Fix the syntax errors in this code:
commit.md:
Generate a conventional commit message for this code change:
The text you select or pipe will be appended to the prompt.
How It Works
Daemon Mode (Primary)
- Run
keys startin the background - Select text anywhere on your system
- Press your registered hotkey
- Selected text + prompt gets sent to
claudeCLI - Result copied to clipboard
CLI Mode (Secondary)
Pipe text through prompts directly:
echo "def foo( ): return 1" | keys show fix.md
Configuration
Config file: ~/.keys/config.yaml
prompts_dir: ~/my-prompts
hotkeys:
ctrl+shift+f: fix.md
cmd+shift+j: commit.md
That's it. No targets, no actions, no bloat.
Requirements
- Python 3.10+
- For clipboard support on Linux:
xcliporxsel - A CLI tool that accepts piped input (e.g.,
claude,gpt-cli)
Why Keys?
- Simple - Just prompts + hotkeys. No complex config.
- Fast - Pure functions, minimal overhead.
- Flexible - Works with any CLI tool, any text editor.
- Cross-platform - macOS, Linux, Windows support.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keys_cli-0.1.0.tar.gz.
File metadata
- Download URL: keys_cli-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.10 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5087684b22ccce5418aaf5d6249567b1711e280a374787a2ef09f84aaafb10f
|
|
| MD5 |
dbc19e9fd6bb875c4356c4270708350a
|
|
| BLAKE2b-256 |
ceade058c3985d4d9f7dd35f12fa93b59aeed5971038face57fb0e4e05ec3402
|
File details
Details for the file keys_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: keys_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.10 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad8cf65c3cc5339d334d00b842a15c4b620f702bcb94904a1fe7758189418fd7
|
|
| MD5 |
2f9105bf55d01a01dc250f2964178cfb
|
|
| BLAKE2b-256 |
6d62c670a56769ecbdaedb1e09788e36eef0db6186da8e6c00f1286a0a7548d1
|