A local, self-hosted, always-on "watchdog" tool that automatically organizes your files using AI.
- 🔍 Monitors folders - Watch one or more folders on your laptop for new or modified files
- 🤖 AI-powered analysis - Uses local or cloud AI to understand file content
- 📁 Auto-organization - Automatically renames, tags, and moves files to the correct archive location
- ⚙️ Configurable - Customize watched folders, AI providers, and organization rules
- 🖥️ Native GUI - Cross-platform desktop application (Windows, macOS, Linux)
- 💻 CLI Mode - Command-line interface for developers
- 🤝 HITL Mode - Human-In-The-Loop mode for approval before organizing files
- 📚 Few-Shot Learning - Provide examples to train the AI on your preferences
- 🔄 Always-on - Runs continuously in the background
pip install watchdock- Clone or download this repository
- Install dependencies:
pip install -r requirements.txt
pip install -e .- Install WatchDock:
pip install -e .
# Or: pip install watchdock- Launch the GUI:
watchdock gui
# Or use the shorter alias: wd gui-
Configure WatchDock through the GUI:
- Set up watched folders
- Configure AI provider and API keys
- Set archive preferences
- Add few-shot examples (optional)
-
Run WatchDock (from command line):
watchdock start
# Or simply: watchdock
# Or use the shorter alias: wd start (or just wd)- Install WatchDock:
pip install -e .- Initialize configuration:
watchdock config init
# Or: wd config initThis creates a default configuration file at ~/.watchdock/config.json
-
Edit the configuration file to:
- Add your AI API keys (if using cloud AI)
- Configure watched folders
- Set archive preferences
-
Check status:
watchdock status- Run WatchDock:
watchdock start
# Or simply: watchdockWatchDock provides a comprehensive CLI with subcommands. You can use either watchdock or the shorter alias wd:
# Both work identically
watchdock version
wd version
watchdock update
wd update# Show version
watchdock version
# Update WatchDock (installs the latest version if available)
watchdock update
# Show current status
watchdock status
# Launch GUI
watchdock gui# Initialize default configuration
watchdock config init
# Validate configuration file
watchdock config validate# List pending actions
watchdock list-pending
# Approve an action
watchdock approve <action_id>
# Reject an action
watchdock reject <action_id># Start monitoring (default command)
watchdock start
# Or simply (start is the default)
watchdock# Show all commands
watchdock --help
# Show help for a specific command
watchdock <command> --helpTo create standalone executables (.app on macOS, .exe on Windows) for distribution:
- Install PyInstaller:
pip install pyinstaller- Create executable:
# For GUI application
pyinstaller --name=WatchDock --windowed --onefile watchdock/gui_main.py
# For CLI application
pyinstaller --name=watchdock --onefile watchdock/main.pyThe executables will be in the dist/ folder.
WatchDock supports two operation modes:
Files are automatically analyzed and organized without user intervention. Perfect for fully automated workflows.
Files are analyzed and proposed actions are queued for your approval. You can:
- Review each proposed action in the GUI
- Approve or reject individual actions
- Approve all pending actions at once
- Use CLI commands to manage pending actions
CLI Commands for HITL Mode:
# List all pending actions
watchdock list-pending
# Approve a specific action
watchdock approve <action_id>
# Reject a specific action
watchdock reject <action_id>GUI: Use the "Pending Actions" tab to review and manage pending actions.
The configuration file (~/.watchdock/config.json by default) contains:
{
"watched_folders": [
{
"path": "/Users/yourname/Downloads",
"enabled": true,
"recursive": false,
"file_extensions": null
}
]
}WatchDock supports multiple AI providers:
- OpenAI - Cloud-based (requires API key)
- Anthropic - Cloud-based (requires API key)
- Ollama - Local AI (no API key needed)
Example for OpenAI:
{
"ai_config": {
"provider": "openai",
"api_key": "your-api-key-here",
"model": "gpt-4",
"temperature": 0.3
}
}Example for Ollama (local):
{
"ai_config": {
"provider": "ollama",
"model": "llama2",
"base_url": "http://localhost:11434/v1"
}
}{
"archive_config": {
"base_path": "/Users/yourname/Documents/Archive",
"create_date_folders": true,
"create_category_folders": true,
"move_files": true
}
}- Monitoring: WatchDock monitors specified folders using the
watchdoglibrary - Detection: When a new file appears or is modified, it's detected
- Analysis: The file is analyzed using AI to understand its content
- Organization: Based on the analysis, the file is:
- Categorized (e.g., Documents, Images, Videos)
- Renamed with a clean, descriptive name
- Tagged with relevant keywords
- Moved to an organized archive structure
Files are organized in the archive like this:
Archive/
├── 2024-01/
│ ├── Documents/
│ │ ├── project_proposal.pdf
│ │ └── meeting_notes.txt
│ ├── Images/
│ │ └── screenshot_2024.png
│ └── Videos/
│ └── presentation_recording.mp4
You can provide examples to help the AI understand your organization preferences. This is especially useful for:
- Custom category names
- Specific naming conventions
- Tag preferences
- Domain-specific file types
Examples can be added through the GUI or by editing ~/.watchdock/few_shot_examples.json:
[
{
"file_name": "IMG_20240101_123456.jpg",
"category": "Photos",
"suggested_name": "2024-01-01_family_photo.jpg",
"tags": ["family", "photo", "2024"],
"description": "Family photo from January 2024"
}
]WatchDock logs to both:
- Console output
watchdock.logfile in the current directory
- Python 3.8+
- Internet connection (for cloud AI providers) or local AI setup (Ollama)
MIT License