Shell Shortcuts
Quick keyboard shortcuts for common whisp operations.
Shell Shortcuts
Whisp provides shell shortcuts for fast, ergonomic access to AI assistance. These work in bash, zsh, and fish.
Quick Reference
| Shortcut | Action | Example |
|---|---|---|
, | Generate command from query | , find large files |
,! | Run last generated command | ,! |
,. | Explain a command | ,. tar -xzf archive.tar.gz |
,d | Dry-run (preview effects) | ,d rm -rf ./build |
,, | Show alternative commands | ,, |
,/ | Search command history | ,/ git |
,c | Copy last command to clipboard | ,c |
Ctrl+F | Start query | Inserts , |
Query Mode: ,
The primary way to interact with whisp. Describe what you want in natural language.
# Find files
, find all files larger than 100MB
# System operations
, show disk usage by directory
# Git operations
, show commits from last week by author
# Docker
, list running containers with their portsAfter whisp generates a command, you can:
- Press Enter to run it
- Press n to cancel
- Type
,!to run it later
Tips for Good Queries
# Be specific about format
, list files sorted by size in human-readable format
# Include context when helpful
, find all TODO comments in this rust project
# Specify the tool if you prefer one
, use rsync to backup this directory to /backupRun Last Command: ,!
Execute the most recently generated command without re-querying.
, find large log files # Generates: find /var/log -size +10M
# You decide not to run it
,! # Runs find /var/log -size +10MThe command is stored per-session, so you can think about it before running.
Explain Mode: ,.
Get a detailed explanation of what a command does.
,. tar -czvf archive.tar.gz ./docs
# Output:
# Explanation: Creates a compressed tar archive
#
# Breakdown:
# - tar: Archive utility
# - -c: Create new archive
# - -z: Compress with gzip
# - -v: Verbose output
# - -f: Specify filename
# - archive.tar.gz: Output file
# - ./docs: Directory to archiveUseful for:
- Learning unfamiliar commands
- Understanding complex pipelines
- Verifying commands before running
# Explain a pipeline
,. cat access.log | grep 404 | awk '{print $7}' | sort | uniq -c | sort -rn | head
# Explain someone else's script
,. curl -fsSL https://example.com/install.sh | bashDry-Run Mode: ,d
Preview what a command will do without executing it.
,d rm -rf ./node_modules
# Output:
# Reversible: Yes (if you have backups)
#
# Effects:
# - Deletes directory ./node_modules
# - Removes all files recursively (~15,234 files)
# - Frees approximately 450MB
#
# Warning: This operation cannot be undoneThe dry-run analysis includes:
- Reversibility: Can the effects be undone?
- Effects: What will change
- Files affected: Specific files/directories
- Warnings: For destructive operations
# Check before bulk operations
,d find . -name "*.bak" -delete
# Preview git operations
,d git reset --hard HEAD~3
# Check system changes
,d chmod -R 755 /var/wwwShow Alternatives: ,,
After generating a command, see 2-3 alternative approaches.
, compress this directory # Generates: tar -czvf dir.tar.gz ./dir
,, # Show alternatives
# Alternatives:
# 1. zip -r dir.zip ./dir
# Tradeoff: More compatible with Windows, slightly larger
#
# 2. tar -cjvf dir.tar.bz2 ./dir
# Tradeoff: Better compression, slower
#
# 3. 7z a dir.7z ./dir
# Tradeoff: Best compression, requires 7zip
#
# Select [1-3] or press Enter to keep original:Select an alternative by number, or press Enter to keep the original.
Search History: ,/
Search through your whisp command history.
,/ docker
# Results:
# 1. docker compose up -d (~/projects/app, 2h ago)
# 2. docker ps -a (~/projects/app, 3h ago)
# 3. docker build -t myapp . (~/projects/app, yesterday)
#
# Select [1-3] or press Enter to cancel:History includes:
- Generated commands
- Working directory where they were run
- Timestamp
Select a result to run that command again.
Copy to Clipboard: ,c
Copy the last generated command to your clipboard.
, complex kubernetes deployment command
,c
# Output: Copied: kubectl apply -f deployment.yaml --namespace=prodWorks with:
- macOS: pbcopy
- Linux (Wayland): wl-copy
- Linux (X11): xclip or xsel
Keyboard Binding: Ctrl+F
Press Ctrl+F to insert , at the beginning of your line, ready for a query. This works in all supported shells.
# Press Ctrl+F, then type your query
find large files in /var # Becomes: , find large files in /varThe binding is implemented in:
- Bash:
bind -x '"\C-f"' - Zsh:
bindkey '^F' - Fish:
bind \cf
Piped Input
The query shortcut (,) supports piped input for context:
# Analyze log files
cat server.log |, summarize errors
# Transform data
cat data.json |, extract all email addresses
# Process command output
git diff |, explain these changesPiped input is limited to 8000 characters. Other shortcuts (,., ,d, etc.) do not accept piped input.
Session Context
Shortcuts maintain session context:
- The last generated command is remembered (for
,!and,,) - Working directory is tracked
- Shell type is detected automatically
The session resets when you close your terminal. For automatic error recovery when commands fail, see Error Recovery.
Troubleshooting
Shortcuts not working
Ensure shell integration is loaded:
# Check if whisp function exists
type ,
# Reload shell integration
source ~/.bashrc # or ~/.zshrc"Daemon not running" error
Start the daemon:
whisp startSlow responses
Check daemon health:
whisp healthConsider switching to a faster model or local Ollama.