Comprehensive documentation for the Selfspy Python implementation - a privacy-focused activity monitoring and analytics tool.
- Installation Guide - Get started with Selfspy
- Usage Guide - Learn how to use all features
- Configuration - Customize your setup
- Architecture - Understand the internals
- Troubleshooting - Solve common issues
Selfspy is a comprehensive activity monitoring tool that tracks:
- Keyboard Activity: Keystroke counts and encrypted text
- Mouse Activity: Clicks, movement, and scroll events
- Window Activity: Active applications and windows
- Terminal Activity: Command history and shell usage
- Time Analytics: Detailed productivity metrics
All data is stored locally with optional encryption for privacy.
-
- System requirements
- Installation steps for macOS/Linux/Windows
- Setting up permissions
- Verifying installation
-
- Starting monitoring
- Viewing statistics
- Using desktop widgets
- Running as a service
- Common workflows
- Configuration Guide
- Environment variables
- Settings reference
- Privacy settings
- Screenshot configuration
- Storage management
- Architecture Documentation
- System architecture
- Core components
- Data flow
- Platform abstraction
- Extension points
- Troubleshooting Guide
- Common issues
- Permission problems
- Database issues
- Performance optimization
- Getting help
# Install
uv sync --group dev --extra macos
# Check permissions (macOS)
uv run selfspy check-permissions
# Start monitoring
uv run selfspy daemon
# View statistics
uv run selfspy viz enhanced- Local data storage (no cloud sync)
- Optional AES-256 encryption for keystrokes
- Application exclusion lists
- Privacy mode for sensitive environments
- Terminal-based statistics with Rich
- Interactive charts with Plotly
- Desktop widgets for macOS
- Multiple export formats (JSON, CSV)
- macOS: Full support with native APIs
- Linux: Support via fallback mode
- Windows: Basic support
- Command frequency analysis
- Git workflow tracking
- Productivity metrics
- Development pattern analysis
- Real-time activity display
- Always-on-top, draggable windows
- Multiple widget types
- Configurable layouts
- Python 3.10+: Modern language features
- async/await: Non-blocking I/O
- SQLAlchemy 2.0: Modern ORM patterns
- Typer + Rich: Beautiful CLI
- macOS: PyObjC for native API access
- Cross-platform: pynput fallback
- Async I/O: aiosqlite for database
Process → Window → Keys/Clicks
Clean relational model with comprehensive indexing
- Track time spent in different applications
- Identify productivity patterns
- Review daily/weekly activity
- Optimize workflows
- Terminal command analytics
- IDE usage patterns
- Git workflow analysis
- Context switching tracking
- Automatic activity logging
- Detailed time breakdowns
- Client project tracking
- Billable hours analysis
- See what you're actually typing
- Identify sensitive data exposure
- Audit application behavior
- Personal data awareness
- Python 3.10 or higher
- 100 MB disk space (more for data)
- SQLite 3.8+
- macOS 10.12+ for full features
- 1 GB disk space for database
- SSD for better performance
- 4 GB RAM
- Accessibility (Required): For input monitoring
- Screen Recording (Optional): For screenshots
- Read through guides in order
- Check troubleshooting for common issues
- Review architecture for deep understanding
- GitHub Issues: Bug reports and feature requests
- Discussions: Questions and community support
# Enable debug output
uv run selfspy daemon --debug
# Check permissions
uv run selfspy check-permissions
# View logs
tail -f /tmp/selfspy.log- Suggest corrections via GitHub issues
- Submit PRs for documentation updates
- Add examples and use cases
- See Architecture for codebase overview
- Follow existing patterns
- Add tests for new features
GPL-3.0-or-later - See LICENSE file for details
selfspy-python/
├── docs/ # This documentation
├── src/ # Main source code
│ ├── cli.py # CLI interface
│ ├── activity_monitor.py
│ ├── activity_store.py
│ ├── models.py # Database models
│ ├── config.py # Configuration
│ ├── encryption.py # Encryption utilities
│ └── platform/ # Platform-specific code
├── desktop-app/ # Desktop widgets
├── tests/ # Test suite
└── pyproject.toml # Project metadata
- 1.0.0: Initial Python implementation
- Modern async architecture
- macOS native support
- Desktop widgets
- Terminal analytics
Future features under consideration:
- Web dashboard
- Multi-device sync (optional)
- Plugin system
- Advanced analytics
- Machine learning insights
Need help? Start with the Installation Guide or check Troubleshooting for common issues.