๐ Shelldog - Your Faithful Command Companion
Your loyal companion for tracking shell commands - because every good developer needs a faithful friend who remembers everything!
/\_/\
( o.o )
> ^ < "Woof! I'm watching... silently."
Shelldog is a silent, intelligent command tracker for your terminal. Think of it as your development diary that writes itself - tracking every command you run, so you never have to remember "what did I do yesterday?" ever again!
๐ฏ Why Shelldog?
Ever found yourself thinking:
- "What was that curl command I ran last week?"
- "How did I set up this environment again?"
- "I need to write documentation... if only I could remember what I did!"
- "What commands did I run before that bug appeared?"
Shelldog sits quietly in the background and remembers EVERYTHING for you! ๐ง
โจ Features
- ๐คซ Silent Tracking - Works invisibly without cluttering your terminal
- ๐ Privacy First - Automatically masks passwords, tokens, and API keys
- ๐ฏ Smart Detection - Knows when you're in a virtual environment
- ๐ Project-Level Logs - Each venv gets its own history file at the project root
- ๐ญ Personality - Because who says CLI tools have to be boring?
- ๐ Zero Performance Impact - Logs asynchronously in the background
- ๐ Both Bash & Zsh - Works with your favorite shell
๐ฆ Installation
Quick Install
pip install shelldog
From Source
git clone https://github.com/Ansumanbhujabal/shelldog.git
cd shelldog
pip install -e .
๐ Quick Start
1. Start Tracking
# Wake up the dog!
shelldog follow
# Activate tracking in your current shell
eval "$(shelldog follow -q)"
That's it! Shelldog is now silently logging all your commands. ๐
2. View Your History
# See everything
shelldog log
# Just today's commands
shelldog log --today
# Last 20 commands
shelldog log -n 20
3. Check Status
shelldog status
๐ฎ Commands
Core Commands
| Command | Description |
|---|---|
shelldog follow |
Start tracking commands (activates the good boy!) |
shelldog stop |
Stop tracking (sends doggo to sleep) |
shelldog log |
View command history |
shelldog status |
Check if Shelldog is watching |
shelldog clear |
Clear command history |
shelldog stats |
See cool statistics about your commands |
Fun Commands (Because Why Not?)
| Command | Description |
|---|---|
shelldog bark |
Make Shelldog bark! ๐ |
shelldog treat |
Give Shelldog a treat! ๐ฆด |
shelldog goodboy |
Tell Shelldog he's a good boy! ๐ |
๐ง How It Works
The Magic Behind the Scenes
- Shell Hook: Shelldog installs a tiny hook in your shell (via
DEBUGtrap in Bash orpreexecin Zsh) - Silent Logger: Every command gets logged asynchronously - zero impact on your workflow
- Smart Masking: Sensitive data (passwords, tokens, API keys) are automatically masked
- Venv Detection: Automatically detects if you're in a virtual environment
Virtual Environment Awareness
When you're in a virtual environment:
- Shelldog creates
shelldog_history.txtat your project root (next to your venv folder) - Each project gets its own command history
- No more mixing up commands from different projects!
my-project/
โโโ venv/
โ โโโ .shelldog/ # Hidden config folder
โโโ shelldog_history.txt # Your project's command history! ๐
โโโ src/
โโโ README.md
Privacy & Security
Shelldog automatically masks sensitive information:
# What you type:
export API_KEY=super_secret_key_123
# What gets logged:
export API_KEY=****
Protected patterns:
export VARNAME=valueโexport VARNAME=****--password,--token,--api-key,--secret- Authorization headers in curl commands
- And more!
๐ก Usage Examples
Example 1: Track Your Development Session
# Start your day
cd my-project
source venv/bin/activate
eval "$(shelldog follow -q)"
# Do your work
git pull origin main
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
# Later, review what you did
shelldog log --today
Example 2: Debug Like a Pro
# Something broke! What did you do?
shelldog log -n 50
# Find that specific command
shelldog log | grep docker
# See statistics
shelldog stats
Example 3: Document Your Setup
# After setting up a new environment
shelldog log > SETUP.md
# Now you have automatic documentation! ๐
๐จ Example Output
Starting Shelldog
$ shelldog follow
๐ Woof! I'm watching you.
Never forget what you did.
Always know where you've been.
I've got your back.
โ Shelldog is now following your commands!
๐ Commands will be logged to:
/path/to/project/shelldog_history.txt
๐ฏ Project root level logging!
๐ Stay pawsitive! ๐พ
============================================================
โ Initialization complete!
============================================================
๐ Activate the hook by running:
eval "$(shelldog follow -q)"
Viewing History
$ shelldog log -n 5
๐ Shelldog History:
================================================================================
[2025-10-08 14:23:45] pip install requests
[2025-10-08 14:24:12] python app.py
[2025-10-08 14:25:33] git add .
[2025-10-08 14:25:40] git commit -m "Add new feature"
[2025-10-08 14:25:55] git push origin main
================================================================================
๐ Total entries: 5
๐ *proud tail wag* I remembered everything!
Status Check
$ shelldog status
๐ Shelldog Status:
==================================================
Tracking enabled: โ Yes
Shell hook active: โ Yes
Virtual env: โ Yes (venv-specific logging)
Venv path: /opt/CodeRepo/SideProjects/shelldog/venv
Log file: /opt/CodeRepo/SideProjects/shelldog/shelldog_history.txt
Log file exists: โ Yes
Logged commands: 247
==================================================
โ Shelldog is actively tracking your commands! ๐
Every great developer was once a beginner! ๐
โ๏ธ Configuration
Log File Locations
- In a venv:
<project_root>/shelldog_history.txt - Global:
~/.shelldog/shelldog_history.txt
State Files
Shelldog keeps its configuration in:
- In a venv:
<venv>/.shelldog/ - Global:
~/.shelldog/
๐ค Shell Integration
Manual Activation
If you want to manually control when Shelldog watches:
# Start tracking
source ~/.shelldog/shelldog_hook.sh
# Stop tracking
source ~/.shelldog/shelldog_unhook.sh
Add to Shell Profile (Optional)
Want Shelldog to start automatically? Add to your ~/.bashrc or ~/.zshrc:
# Auto-start Shelldog in virtual environments
if [[ -n "$VIRTUAL_ENV" ]]; then
eval "$(shelldog follow -q)" 2>/dev/null
fi
๐ Troubleshooting
"Shelldog is enabled but not logging!"
Make sure the hook is active:
shelldog status
# If hook is not active, run:
eval "$(shelldog follow -q)"
"Commands are logged twice!"
This can happen if you source the hook multiple times. Run:
shelldog stop
eval "$(shelldog follow -q)"
"Shelldog logs its own commands!"
It shouldn't! Shelldog filters itself out. If you see this, please file a bug report! ๐
๐ What Gets Logged?
โ Logged
- All shell commands
- Script executions
- Git commands
- Package installations
- Database migrations
- Server starts/stops
- Basically everything you type!
โ Not Logged
shelldogcommands themselves- Internal shell functions
- Empty commands
- Shell initialization stuff
๐ Pro Tips
- Review Daily:
shelldog log --todayat the end of the day - Document Projects:
shelldog log > COMMANDS.mdfor documentation - Debug Sessions:
shelldog log -n 50to see recent commands - Find Patterns:
shelldog statsto see your most-used commands - Clean Slate:
shelldog clearwhen starting fresh
๐ค FAQ
Q: Does Shelldog slow down my terminal?
A: Nope! Logging happens asynchronously in the background. Zero performance impact.
Q: Is my sensitive data safe?
A: Yes! Shelldog automatically masks passwords, tokens, and API keys.
Q: Can I use this in production?
A: Shelldog is designed for development environments. Use caution in production!
Q: Does it work with tmux/screen?
A: Yes! Each session tracks independently.
Q: What shells are supported?
A: Bash and Zsh are fully supported.
๐จ Why the Dog Theme?
Because:
- Dogs are loyal (like your command history should be)
- Dogs remember everything (especially treats)
- Dogs are always happy to help
- CLI tools deserve more personality! ๐
๐ License
MIT License - See LICENSE file for details
๐ค Contributing
Contributions are welcome! Feel free to:
- ๐ Report bugs
- ๐ก Suggest features
- ๐ง Submit pull requests
- ๐จ Improve documentation
๐ Acknowledgments
Built with โค๏ธ by developers who got tired of asking "wait, what command did I just run?"
Made with ๐ and โ by Ansuman Bhujabala
If Shelldog helps you, give him a treat! โญ this repo
๐ *tail wagging intensifies*
Metadata
Release files for shelldog 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| shelldog-0.1.0.tar.gz | 19.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shelldog-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.0 kB
Release files / shelldog-0.1.0.tar.gz
| Download URL | shelldog-0.1.0.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a84ed13b836ac7f4806670e7d7a28ed1b873d1e23dae8977c52d0da1959fd3e
|
|
BLAKE2b-256 checksum How to use checksums |
1612389d0cad0722a4e53d39707653015d0f184d6bbb086ab837dabbc85113b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / shelldog-0.1.0-py3-none-any.whl
| Download URL | shelldog-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f57726bd226888007729dc6ab478f62b02e44307c32aab860ace7b040b2b76f9
|
|
BLAKE2b-256 checksum How to use checksums |
10ac38e91ce4433e15c23422745159666f4ea934c01165cf20b306279dda0068
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|