Skip to main content

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

  1. Create a prompts directory with markdown files:

    ~/my-prompts/
    ├── fix.md
    ├── commit.md
    └── refactor.md
    
  2. Set the prompts directory:

    keys prompts ~/my-prompts
    
  3. 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
    
  4. Start the daemon:

    keys start
    
  5. 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 platforms
  • cmd+shift+j - macOS
  • win+alt+x - Windows
  • option+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)

  1. Run keys start in the background
  2. Select text anywhere on your system
  3. Press your registered hotkey
  4. Selected text + prompt gets sent to claude CLI
  5. 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: xclip or xsel
  • 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


Download files

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

Source Distribution

keys_cli-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

keys_cli-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

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

Hashes for keys_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d5087684b22ccce5418aaf5d6249567b1711e280a374787a2ef09f84aaafb10f
MD5 dbc19e9fd6bb875c4356c4270708350a
BLAKE2b-256 ceade058c3985d4d9f7dd35f12fa93b59aeed5971038face57fb0e4e05ec3402

See more details on using hashes here.

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

Hashes for keys_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad8cf65c3cc5339d334d00b842a15c4b620f702bcb94904a1fe7758189418fd7
MD5 2f9105bf55d01a01dc250f2964178cfb
BLAKE2b-256 6d62c670a56769ecbdaedb1e09788e36eef0db6186da8e6c00f1286a0a7548d1

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