Cursor's Cmd+K inline prompt, but for your zsh terminal — powered by Claude.
Project description
ccli-prompt
Cursor's Cmd+K inline prompt, but for your zsh terminal.
Press Cmd+K at your prompt, type what you want ("kill port 9090", "find files bigger than 100mb", "tar this folder"), hit Enter, and a ready-to-run shell command lands on your command line. Review it, Enter to run it.
Fast because there's no claude CLI boot per call: a tiny Python daemon runs in the background, holds one open HTTPS connection to api.anthropic.com, and reuses the OAuth token you already have from Claude Code (or a plain Anthropic API key). Typical latency: ~500 ms on warm connection + Haiku inference.
Install
pipx install ccli-prompt # recommended (isolated venv)
# or: pip install ccli-prompt
ccli-prompt install # runs the interactive wizard (auth + model pick)
The wizard:
- Authentication — auto-discover from Claude Code credentials, or paste a key (accepts both
sk-ant-api03-...andsk-ant-oat01-...). - Model — lists live models from
/v1/models. Haiku 4.5 is the default.
Requirements: macOS or Linux, zsh 5.x+, Python 3.10+. The daemon has zero dependencies (stdlib only).
Trigger it
Two ways — pick either:
Esc then K — works immediately, no terminal config needed. Press Esc, then K (sequence, not chord).
Cmd+K / Ctrl+K — remap it in your terminal to send ESC+k:
| Terminal | How |
|---|---|
| iTerm2 | Settings → Profiles → Keys → + · Shortcut ⌘K · Action Send Escape Sequence · Esc+: k |
| Terminal.app | Settings → Profiles → Keyboard → + · ⌘ + K · Send Text · Ctrl+V then Esc, then k |
| Ghostty | keybind = cmd+k=text:\x1bk in ~/.config/ghostty/config |
| Warp | Settings → Keyboard → bind ⌘K → Send Text · \x1bk |
| Alacritty | [[keyboard.bindings]] with key = "K", mods = "Control", chars = "\u001bk" |
| Kitty | map ctrl+k send_text all \x1bk in ~/.config/kitty/kitty.conf |
| WezTerm | {key="k", mods="CTRL", action=wezterm.action.SendString("\x1bk")} |
How it works
ccli-prompt install— copies a zsh widget to~/.ccli-prompt/ccli.zsh, appends asourceline to your~/.zshrc, and runs the wizard.- The widget (bound to
^[k— what Esc+K and remapped Cmd+K send) reads your query viaread-from-minibuffer, sends it over a Unix socket to the daemon, and places the response into$BUFFERso nothing runs until you press Enter. - The daemon (
python3 -m ccli_prompt.daemon, auto-spawned on first use) reads auth from: env var →~/.ccli-prompt/config→ macOS Keychain →~/.claude/.credentials.json. It opens oneHTTPSConnectiontoapi.anthropic.comand keeps it warm, POSTs to/v1/messages(Bearer+OAuth-beta orx-api-keydepending on token prefix), caches the system prompt, and exits after 30 minutes of idleness.
Configuration
Environment variables (override the config file; set in ~/.zshrc before the source line):
export ANTHROPIC_API_KEY="sk-ant-..." # API key or OAuth token
export CCLI_MODEL="claude-haiku-4-5"
export CCLI_MAX_TOKENS=400
export CCLI_IDLE_TIMEOUT=1800
export CCLI_SYSTEM_PROMPT_FILE="$HOME/.ccli-prompt/prompt.md"
Re-run the wizard at any time: ccli-prompt configure.
Edit the system prompt at ~/.ccli-prompt/prompt.md (copied from the package on install).
Manual daemon control
# status
[[ -S /tmp/ccli-$USER.sock ]] && echo "running" || echo "not running"
# stop
pkill -f ccli_prompt.daemon; rm -f /tmp/ccli-$USER.sock
# start manually (normally auto-starts on first Cmd+K)
python3 -m ccli_prompt.daemon &
Safety
- Daemon's Unix socket is
0600, scoped to your user. - Responses only land in
$BUFFER— nothing executes until you press Enter. - The default system prompt refuses destructive commands (
rm -rf /,dd, disk formatting, force-push tomain, etc.) unless you request them in those exact terms.
Uninstall
ccli-prompt uninstall
pipx uninstall ccli-prompt # or: pip uninstall ccli-prompt
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 ccli_prompt-0.1.1.tar.gz.
File metadata
- Download URL: ccli_prompt-0.1.1.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19ad16c87d2c5d953cdb8368c3205156d612d29e1988e5c88578301d73ea21cf
|
|
| MD5 |
892346c8e12ea3ba445a9ee1ed2cb027
|
|
| BLAKE2b-256 |
491cf754dd8e7635ac6182ca23e866ed74ffc6ebac721982ae5cc8c7dfbf386d
|
Provenance
The following attestation bundles were made for ccli_prompt-0.1.1.tar.gz:
Publisher:
workflow.yml on lucastononro/ccli-prompt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ccli_prompt-0.1.1.tar.gz -
Subject digest:
19ad16c87d2c5d953cdb8368c3205156d612d29e1988e5c88578301d73ea21cf - Sigstore transparency entry: 1343707230
- Sigstore integration time:
-
Permalink:
lucastononro/ccli-prompt@77bd7b0ba73a0fd6fd77a9a8df34cb2a29bfb25a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/lucastononro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@77bd7b0ba73a0fd6fd77a9a8df34cb2a29bfb25a -
Trigger Event:
push
-
Statement type:
File details
Details for the file ccli_prompt-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ccli_prompt-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bacdb4b9bbaa00cc36d5117cf285e2100e01e5ae3c69fd779f2db874993e926
|
|
| MD5 |
d093ee2476d7156acff7d63d05ebc9ca
|
|
| BLAKE2b-256 |
b071efa066e527f534280c6dbc8ed914522d61fe89cfe4d67a24efdd54824518
|
Provenance
The following attestation bundles were made for ccli_prompt-0.1.1-py3-none-any.whl:
Publisher:
workflow.yml on lucastononro/ccli-prompt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ccli_prompt-0.1.1-py3-none-any.whl -
Subject digest:
9bacdb4b9bbaa00cc36d5117cf285e2100e01e5ae3c69fd779f2db874993e926 - Sigstore transparency entry: 1343707272
- Sigstore integration time:
-
Permalink:
lucastononro/ccli-prompt@77bd7b0ba73a0fd6fd77a9a8df34cb2a29bfb25a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/lucastononro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@77bd7b0ba73a0fd6fd77a9a8df34cb2a29bfb25a -
Trigger Event:
push
-
Statement type: