Quick CLI do-it-all tool. Use natural language to spit out bash commands
Project description
Rubber Ducky
Turn natural language into bash commands without leaving your terminal.
Rubber Ducky is an inline terminal companion that transforms your prompts into runnable shell commands. Paste multi-line context, get smart suggestions, and execute commands instantly.
Quick Start
# Install globally (recommended)
uv tool install rubber-ducky
# Run interactively
ducky
# Quick one-shot
ducky "list all files larger than 10MB in current directory"
# From CLI with options
ducky --model qwen3
ducky --directory src
ducky --local
# Or use uvx (requires -- separator)
uvx rubber-ducky -- --model qwen3
Both ducky and rubber-ducky executables work identically.
Requirements
- Ollama (running locally or using cloud models)
- Python 3.10+
Features
- Natural to Shell - Describe what you want, get the bash command
- Model Flexibility - Switch between local Ollama models and cloud models
- Crumbs - Save and reuse commands with argument substitution
- Piped Input - Pipe output from other commands directly to ducky
- Interactive REPL - Rich terminal experience with history and shortcuts
- Code Context - Preload project code for AI awareness
- Clipboard Support - Copy commands across macOS, Windows, and Linux
Key Concepts
REPL (Interactive Mode)
Launch ducky to start an inline session:
ducky
Key controls:
Enter- Submit promptCtrl+J- Insert newline (for multi-line prompts)Empty Enter- Rerun last command or explain shell outputCtrl+R- Re-run last suggested commandCtrl+S- Copy last command to clipboard!<cmd>- Run shell command immediatelyArrow keys- Browse historyCtrl+D- Exit
Models
Rubber Ducky supports both local and cloud models:
/model- Interactive model selection/local- List local models (localhost:11434)/cloud- List cloud models (ollama.com)- Last used model is saved automatically
Startup flags:
--local/-l- Use local Ollama with qwen3 default--model <name>/-m- Specify model directly
Crumbs
Crumbs are saved command shortcuts. Store frequently-used commands or complex workflows:
>> How do I list all running Python processes?
...
Suggested: ps aux | grep python | grep -v grep
>> /crumb pyprocs
Saved crumb 'pyprocs'!
Invoke crumb:
>> pyprocs
Crumb: pyprocs
Command: ps aux | grep python | grep -v grep
...
With argument substitution:
# Crumb command: git worktree add "../$var-$other" -b $var3
ducky at feature backend develop
# Executes: git worktree add "../feature-backend" -b develop
Usage Guide
Interactive Mode
Default mode. Perfect for development sessions.
ducky
Load code context for better suggestions:
ducky --directory src
Single-Shot Mode
Get one command suggestion and exit.
ducky "find all TODO comments in src/"
Copy to clipboard automatically:
ducky "build and run tests"
Piped Input
Process text from other commands:
cat error.log | ducky "what's wrong here?"
git diff | ducky "summarize these changes"
Run Without Confirmation
Auto-execute suggested commands:
ducky --yolo "restart the nginx service"
Crumbs Quick Reference
| Command | Description |
|---|---|
/crumbs |
List all saved crumbs |
/crumb <name> |
Save last command as crumb |
/crumb add <name> <cmd> |
Manually add crumb |
/crumb del <name> |
Delete crumb |
<name> |
Execute crumb |
/crumb help |
Detailed crumb help |
Argument Substitution:
Crumbs support ${VAR} and $var placeholder styles:
# Create crumb with placeholders
git worktree add "../$var-$other" -b $var3
# Invoke with arguments
ducky at feature backend develop
Both styles are interchangeable.
Command Reference
Inline Commands
| Command | Action |
|---|---|
/help |
Show all commands |
/clear / /reset |
Clear conversation history |
/model |
Select model (interactive) |
/local |
List local models |
/cloud |
List cloud models |
/run / :run |
Re-run last command |
/expand |
Show full output of last shell command |
CLI Flags
| Flag | Description |
|---|---|
--directory <path> / -d |
Preload code from directory |
--model <name> / -m |
Specify Ollama model |
--local / -l |
Use local Ollama (qwen3 default) |
--yolo / -y |
Auto-run without confirmation |
<prompt> |
Single prompt mode (copied to clipboard) |
Tips & Tricks
Efficient Workflows
# Preload project context
ducky --directory src
# Reuse complex commands with crumbs
docker ps | ducky "kill all containers"
>> /crumb killall
# Chain commands
!ls -la
ducksy "find large files"
# Use history
[↑] Recall previous prompts
[↓] Navigate command history
Keyboard Shortcuts Reference
| Key | Action |
|---|---|
Enter |
Submit prompt |
Ctrl+J |
Insert newline |
Empty Enter |
Rerun last command or explain |
Ctrl+R |
Re-run last suggested command |
Ctrl+S |
Copy to clipboard |
Ctrl+D |
Exit |
!cmd |
Run shell command directly |
Crumb Patterns
# Save after complex command
>> docker-compose up -d && wait && docker-compose logs
>> /crumb start-logs
# Manually add with arguments
>> /crumb add deploy-prod docker build -t app:latest && docker push app:latest
# Use for common workflows
>> ls -la
find . -type f -name "*.py" | xargs wc -l
>> /crumb count-py
Storage
Rubber Ducky stores data in ~/.ducky/:
| File | Purpose |
|---|---|
prompt_history |
readline-compatible history |
conversation.log |
JSON log of all interactions |
config |
User preferences (last model) |
crumbs.json |
Saved crumb shortcuts |
Delete the entire directory for a fresh start.
Development
# Clone and setup
git clone <repo>
cd ducky
uv sync
# Run
uv run ducky --help
uv run ducky
# Lint
uv run ruff check .
License
MIT © 2023 Parth Sareen
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 rubber_ducky-1.6.1.tar.gz.
File metadata
- Download URL: rubber_ducky-1.6.1.tar.gz
- Upload date:
- Size: 23.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f319f494ef04edcb2f390b6acfdf32e7d7147c88b55faef59f8e38faff35691
|
|
| MD5 |
9d19ebff2db97750649060e14b71e4ef
|
|
| BLAKE2b-256 |
bd615de480d93d9320e0632592d874db6f049099638577ea1b525225af9e014f
|
Provenance
The following attestation bundles were made for rubber_ducky-1.6.1.tar.gz:
Publisher:
python-publish.yml on ParthSareen/ducky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rubber_ducky-1.6.1.tar.gz -
Subject digest:
5f319f494ef04edcb2f390b6acfdf32e7d7147c88b55faef59f8e38faff35691 - Sigstore transparency entry: 803881396
- Sigstore integration time:
-
Permalink:
ParthSareen/ducky@b48f173ad1ff36d5356ecf3a8ad60dc8bdfa6d3f -
Branch / Tag:
refs/tags/v1.6.1 - Owner: https://github.com/ParthSareen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b48f173ad1ff36d5356ecf3a8ad60dc8bdfa6d3f -
Trigger Event:
release
-
Statement type:
File details
Details for the file rubber_ducky-1.6.1-py3-none-any.whl.
File metadata
- Download URL: rubber_ducky-1.6.1-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be875c23a7027e1a99aba08d540b8a81b874b1fff5c0f820d21015ccd39c3c5b
|
|
| MD5 |
6b9abe002deaa8f7da29a9cff8c3a7cb
|
|
| BLAKE2b-256 |
a8885968f9c5eb79ad765c4b4d69b2d7b4d1a6318ee5f48c260003db2c6df4f5
|
Provenance
The following attestation bundles were made for rubber_ducky-1.6.1-py3-none-any.whl:
Publisher:
python-publish.yml on ParthSareen/ducky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rubber_ducky-1.6.1-py3-none-any.whl -
Subject digest:
be875c23a7027e1a99aba08d540b8a81b874b1fff5c0f820d21015ccd39c3c5b - Sigstore transparency entry: 803881399
- Sigstore integration time:
-
Permalink:
ParthSareen/ducky@b48f173ad1ff36d5356ecf3a8ad60dc8bdfa6d3f -
Branch / Tag:
refs/tags/v1.6.1 - Owner: https://github.com/ParthSareen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b48f173ad1ff36d5356ecf3a8ad60dc8bdfa6d3f -
Trigger Event:
release
-
Statement type: