Rubber Duck Agent(rda) is an AI-powered coding companion that lives lives alongside your development environment.
It watches your coding activity, system stats, and git commits — then reacts with real moods, evolution, and sarcastic commentary.
- Track coding activity via git commits, shell commands, idle time, CPU usage, files edited etc.
- Chat with the duck using Ollama(local LLM)
- Pet dialogue generation with Gemini
- Mood-based ASCII animations and messages
- Web dashboard with ASCII duck, XP bar and chat interface
- XP & evolution system tied to actual activity
- Local JSON save of pet state
- Web dashboard showing stats
- TTS with espeak
- Plugin for Neovim or VSCode that sync pet's state in a status bar
- Plugin system for custom behaviors
Your actions directly affect the duck’s growth:
| Event | XP Gain |
|---|---|
| Git commit | +5 |
| 10 shell commands | +2 |
| Active coding minute | +1 |
| Long idle (recovery) | +1 |
| CPU spike handled | +3 |
| Level | Form | Description |
|---|---|---|
| 1–4 | Apprentice | Cute newbie duck |
| 5–9 | Awakened | Smarter, sassier |
| 10+ | Elder | Enlightened quacker |
As the duck levels up:
- ASCII art changes
- Dialogue becomes more confident / sarcastic
- Agentic behavior becomes more frequent
Every 20–30 seconds, the duck:
- Observes current system state and activity
- Uses Gemini to reason about what’s happening
- Decides whether to:
- Speak
- Stay silent
- Sleep
- React emotionally
Example messages:
"Idle 25 minutes? I was starting to think you forgot about me." "CPU spiked to 90%? Trying to cook me?" "Commit? Finally! I was getting bored watching you stare at that screen."
# Run this to start tracking your shell activity or add this to your rc file
export PROMPT_COMMAND='python3 -c "import sensors.shell as s; s.record_command_exec()"'
git clone https://github.com/night0721/rda
cd rda
python -m venv env
source env/bin/activate
pip install -r requirements.txt
# Set your GEMINI_API_KEY environment variable at "run" file
./run
# In another terminal, start ollama server
ollama pull phi3:mini
ollama serveContributions are welcomed, feel free to open a pull request.
This project is licensed under the GNU Public License v3.0. See LICENSE for more information.