Developer productivity toolkit: time tracking, Pomodoro timer, project tree visualization, and automation tools
Project description
Saini ๐
Developer productivity toolkit by Rohit Saini
Saini is a comprehensive command-line toolkit designed to boost developer productivity with intelligent time tracking, beautiful project visualization, and automation tools.
โจ Features
โฑ๏ธ Smart Time Tracking
- Automatic Detection: Auto-detect project and branch from git
- Multi-Project Support: Track time across multiple projects seamlessly
- Pause/Resume: Take breaks without losing context
- Rich Reports: Daily, weekly, and project-based analytics
- Data Export: Export to CSV or JSON for further analysis
๐ Pomodoro Timer
- Focus Sessions: 25-minute work intervals with 5-minute breaks
- Long Breaks: Automatic 15-minute breaks after 4 pomodoros
- Desktop Notifications: Get notified when it's time for a break
- Session Tracking: Integrated with time tracking
๐๏ธ Idle Detection
- Smart Pause: Auto-pause when no git activity detected
- Configurable Threshold: Set your own idle timeout (default: 10 minutes)
- Activity Monitoring: Tracks git commits and file changes
- Seamless Resume: Pick up right where you left off
๐ณ Project Tree Visualization
- Beautiful Output: Rich, colorful tree structure with icons
- Smart Filtering: Auto-ignore node_modules, .git, build artifacts
- File Information: Optional file sizes and statistics
- Multiple Formats: Export to text or JSON
- Customizable Depth: Control how deep to traverse
- Hidden Files: Optionally show/hide hidden files
๐ฆ Installation
From PyPI (Recommended)
pip install saini
From Source
git clone https://github.com/rohitsainier/saini.git
cd saini
./install.sh
Upgrade
pip install --upgrade saini
๐ Quick Start
Time Tracking
# Start tracking your work
saini start "Implementing user authentication"
# Check current status
saini status
# Take a break
saini pause
# Resume work
saini resume
# Stop tracking
saini stop
# View today's report
saini report today
Project Tree
# Show project structure
saini tree
# Limit depth to 3 levels
saini tree -d 3
# Show file sizes
saini tree -s
# Save to file
saini tree -o project-structure.txt
# Export as JSON
saini tree -o structure.json -f json
Configuration
# Enable Pomodoro mode (25min work, 5min break)
saini config pomodoro on
# Enable idle detection
saini config idle on
# Set idle threshold to 15 minutes
saini config idle-time 15
# View all settings
saini config show
๐ Complete Command Reference
Time Tracking Commands
| Command | Description | Example |
|---|---|---|
saini start [description] |
Start tracking time | saini start "Bug fix #123" |
saini stop |
Stop current session | saini stop |
saini switch [description] |
Switch to new task | saini switch "Code review" |
saini pause |
Pause current session | saini pause |
saini resume |
Resume paused session | saini resume |
saini status |
Show current status | saini status |
Report Commands
| Command | Description | Example |
|---|---|---|
saini report today |
Today's activity | saini report today |
saini report yesterday |
Yesterday's activity | saini report yesterday |
saini report week |
This week's summary | saini report week |
saini report project [name] |
Project-specific report | saini report project my-app |
saini export csv [file] |
Export to CSV | saini export csv report.csv |
saini export json [file] |
Export to JSON | saini export json report.json |
Configuration Commands
| Command | Description | Example |
|---|---|---|
saini config show |
Show all settings | saini config show |
saini config pomodoro [on|off] |
Toggle Pomodoro timer | saini config pomodoro on |
saini config idle [on|off] |
Toggle idle detection | saini config idle on |
saini config idle-time [min] |
Set idle threshold | saini config idle-time 15 |
Project Tree Commands
| Command | Description | Example |
|---|---|---|
saini tree |
Show project tree | saini tree |
saini tree -p [path] |
Specify custom path | saini tree -p /path/to/project |
saini tree -d [depth] |
Limit depth | saini tree -d 3 |
saini tree -a |
Show hidden files | saini tree -a |
saini tree -s |
Show file sizes | saini tree -s |
saini tree -o [file] |
Save to file | saini tree -o tree.txt |
saini tree -f [format] |
Output format (text|json) | saini tree -f json |
saini tree -i [pattern] |
Ignore pattern | saini tree -i "*.log" |
saini tree --no-icons |
Disable icons | saini tree --no-icons |
๐ก Usage Examples
Example 1: Daily Development Workflow
# Morning - Start your day
saini config pomodoro on
saini start "Sprint planning and standup"
# Check what you're tracking
saini status
# Output:
# โก Active Session
# Project: my-awesome-app
# Branch: feature/user-auth
# Task: Sprint planning and standup
# Duration: 15m 30s
# ๐
Pomodoro: Work Session #1
# Time Left: 9m 30s
# Switch to coding
saini switch "Implementing JWT authentication"
# Lunch break
saini pause
# Back from lunch
saini resume
# End of day - see what you accomplished
saini stop
saini report today
Example 2: Project Analysis
# Understand project structure
saini tree -s -d 3
# Output:
# ๐ my-awesome-app
# โโโ ๐ src
# โ โโโ ๐ components
# โ โ โโโ โ๏ธ Header.jsx [2.3KB]
# โ โ โโโ โ๏ธ Footer.jsx [1.8KB]
# โ โโโ ๐ main.py [5.2KB]
# โ โโโ ๐ config.json [892B]
# โโโ ๐ tests
# โ โโโ ๐ test_main.py [3.1KB]
# โโโ ๐ README.md [4.5KB]
# โโโ ๐ package.json [1.2KB]
#
# ๐ 3 directories, 8 files, Total size: 19.0KB
# Save for documentation
saini tree -o STRUCTURE.md
# Export as JSON for analysis
saini tree -o structure.json -f json
# Analyze only source code (ignore build files)
saini tree -i "dist" -i "node_modules" -i "*.min.js"
Example 3: Weekly Review
# See weekly summary
saini report week
# Output:
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Time Tracking Report
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
#
# ๐
This Week (starting 2024-01-15)
#
# By Project:
# my-awesome-app 12h 30m
# client-website 8h 45m
# saini-package 5h 20m
#
# Total: 26h 35m
# Export for timesheet
saini export csv
Example 4: Multi-Project Development
# Working on project A
cd ~/projects/project-a
saini start "Feature development"
# Switch to project B (auto-detects new project)
cd ~/projects/project-b
saini switch "Bug fix"
# Check time per project
saini report project project-a
saini report project project-b
Example 5: Pomodoro Power User
# Enable Pomodoro with idle detection
saini config pomodoro on
saini config idle on
saini config idle-time 10
# Start focused work
saini start "Deep work - algorithm optimization"
# You'll get notifications:
# After 25 min: "Pomodoro Complete! ๐
Time for a break! (5 min)"
# After 5 min break: "Break Over! โฐ Ready to focus?"
# If idle for 10 min: "Auto-Paused โธ No git activity for 10m"
# Check status anytime
saini status
# Output:
# โก Active Session
# Project: algorithm-lab
# Branch: optimization
# Task: Deep work - algorithm optimization
# Duration: 1h 45m 30s
# ๐
Pomodoro: Work Session #5
# Time Left: 18m 12s
๐จ Screenshots
Time Tracking Status
โก Active Session
Project: saini
Branch: main
Task: Adding tree visualization feature
Started: 2024-01-15 10:00:00
Duration: 45m 30s
๐
Pomodoro: Work Session #2
Time Left: 12m 15s
Project Tree
๐ saini
โโโ ๐ saini
โ โโโ ๐ __init__.py
โ โโโ ๐ cli.py
โ โโโ ๐ tracker.py
โ โโโ ๐ pomodoro.py
โ โโโ ๐ idle_detection.py
โ โโโ ๐ reports.py
โ โโโ ๐ config.py
โ โโโ ๐ tree.py
โ โโโ ๐ utils.py
โโโ ๐ README.md
โโโ ๐ setup.py
โโโ ๐ requirements.txt
โโโ ๐ง install.sh
โโโ ๐ง publish.sh
๐ 2 directories, 13 files
Configuration
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Time Tracker Configuration โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Setting Value
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Pomodoro Mode โ Enabled
Pomodoro Work Time 25 minutes
Pomodoro Break Time 5 minutes
Pomodoro Long Break 15 minutes
Idle Detection โ Enabled
Idle Threshold 10 minutes
โ๏ธ Configuration
Configuration is stored in ~/.saini/config.json:
{
"pomodoro_enabled": true,
"pomodoro_work_time": 1500,
"pomodoro_break_time": 300,
"pomodoro_long_break": 900,
"idle_detection_enabled": true,
"idle_threshold": 600
}
Data Storage
All data is stored in ~/.saini/:
sessions.csv- Time tracking sessionsconfig.json- User configurationcurrent_session- Active session datapaused_session- Paused session datapomodoro_state- Pomodoro timer stateidle_check- Idle detection state
๐ง Development
Local Installation
# Clone the repository
git clone https://github.com/rohitsainier/saini.git
cd saini
# Install in development mode
./install.sh
# Or use Make
make install
Running Tests
# Install test dependencies
pip install pytest pytest-cov
# Run tests
pytest tests/
# With coverage
pytest --cov=saini tests/
Building the Package
# Build
./install.sh -c
python -m build
# Or use Make
make build
Publishing
# Test publish (TestPyPI)
./publish.sh -t
# Production publish (PyPI)
./publish.sh
# With version bump
./publish.sh -v patch # 1.0.0 -> 1.0.1
./publish.sh -v minor # 1.0.0 -> 1.1.0
./publish.sh -v major # 1.0.0 -> 2.0.0
# Or use Make
make test-publish
make publish
๐ ๏ธ Makefile Commands
make install # Install package locally
make reinstall # Reinstall package
make clean # Clean build artifacts
make test # Run tests
make build # Build package
make test-publish # Publish to TestPyPI
make publish # Publish to PyPI
make version-patch # Bump patch version
make version-minor # Bump minor version
make version-major # Bump major version
๐ Requirements
- Python >= 3.7
- Git (for project/branch detection and idle detection)
- Dependencies:
- click >= 8.0.0
- rich >= 10.0.0
- gitpython >= 3.1.0
- pandas >= 1.3.0
- tabulate >= 0.8.9
๐ Troubleshooting
Issue: Command not found after installation
# Make sure pip bin directory is in PATH
export PATH="$HOME/.local/bin:$PATH"
# Add to ~/.bashrc or ~/.zshrc for persistence
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
Issue: Notifications not working
macOS: Notifications should work out of the box.
Linux: Install notify-send:
sudo apt-get install libnotify-bin # Ubuntu/Debian
sudo yum install libnotify # Fedora/CentOS
Windows: Notifications are shown in terminal.
Issue: Git detection not working
# Make sure you're in a git repository
git init
# Or specify path explicitly
saini tree -p /path/to/git/repo
Issue: Permission denied on install
# Use pip with --user flag
pip install --user saini
# Or use sudo (not recommended)
sudo pip install saini
๐บ๏ธ Roadmap
Version 1.x
- Time tracking with pause/resume
- Pomodoro timer with notifications
- Idle detection
- Project tree visualization
- Multiple report formats
- CSV/JSON export
Version 2.x (Planned)
-
.gitignoreaware tree generation - Code complexity analysis
- Duplicate code detection
- Dead code finder
- Unused dependency detection
- Integration with Jira/GitHub Issues
- Team collaboration features
- Cloud sync for time tracking
- Web dashboard
- Custom tree themes
- Tree diff between git commits
- AI-powered time estimation
- Automatic time categorization
๐ค Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Install and test:
./install.sh -r - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Guidelines
- Follow PEP 8 style guide
- Add tests for new features
- Update documentation
- Run tests before submitting PR
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐จโ๐ป Author
Rohit Saini
- GitHub: @rohitsainier
- Email: rohitsainier@example.com
- Twitter: @rohitsainier
๐ Acknowledgments
- Inspired by the need for better developer productivity tools
- Built with Click and Rich
- Thanks to all contributors and users!
๐ Stats
๐ฌ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: rohitsainier@example.com
๐ Star History
If you find Saini useful, please consider giving it a star! โญ
๐ Changelog
Version 1.0.0 (2024-01-15)
- Initial release
- Time tracking with pause/resume
- Pomodoro timer integration
- Idle detection
- Project tree visualization
- Report generation (today, yesterday, week)
- CSV/JSON export
- Configuration management
- Beautiful CLI with Rich
- Installation and publishing scripts
Made with โค๏ธ by Rohit Saini
Boost your productivity, one commit at a time!
## Additional Documentation Files
### `CONTRIBUTING.md`
```markdown
# Contributing to Saini
Thank you for your interest in contributing to Saini! ๐
## Getting Started
1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/saini.git`
3. Create a branch: `git checkout -b feature/your-feature`
4. Make your changes
5. Test your changes: `./install.sh -r && pytest`
6. Commit: `git commit -m 'Add some feature'`
7. Push: `git push origin feature/your-feature`
8. Open a Pull Request
## Development Setup
```bash
# Install in development mode
./install.sh
# Install dev dependencies
pip install pytest pytest-cov black flake8 mypy
# Run tests
pytest tests/
# Format code
black saini/
# Lint
flake8 saini/
Code Style
- Follow PEP 8
- Use Black for formatting
- Add docstrings to all functions
- Write tests for new features
Pull Request Guidelines
- Update README.md if needed
- Add tests for new features
- Ensure all tests pass
- Update CHANGELOG.md
Questions?
Open an issue or discussion!
### `CHANGELOG.md`
```markdown
# Changelog
All notable changes to this project will be documented in this file.
## [1.0.0] - 2024-01-15
### Added
- Initial release
- Time tracking functionality
- Pomodoro timer with desktop notifications
- Idle detection based on git activity
- Project tree visualization with icons
- Multiple report formats (today, yesterday, week, project)
- CSV and JSON export
- Configuration management
- Beautiful CLI with Rich library
- Installation script (install.sh)
- Publishing script (publish.sh)
- Makefile for common tasks
### Features
- Auto-detect project and branch from git
- Pause/resume time tracking
- 25-minute Pomodoro sessions with 5-minute breaks
- Customizable idle detection threshold
- File size information in tree view
- Export tree to text or JSON
- Comprehensive documentation
## [Unreleased]
### Planned
- .gitignore aware tree
- Code complexity analysis
- Duplicate code detection
- Integration with GitHub/Jira
- Team collaboration features
Now you have a complete, professional README! ๐
Want me to create any other documentation files like:
- API documentation
- Architecture diagram
- Tutorial/Guide
- FAQ section?
Project details
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 saini-1.0.3.tar.gz.
File metadata
- Download URL: saini-1.0.3.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12904afff38ee2a331eb0a7069fe4fc3b75e1980940ca1737a2d6f3ff0e7523e
|
|
| MD5 |
a43270fd0ba6d9b8426d95ebb58f2e04
|
|
| BLAKE2b-256 |
35320c55db96a7732e208beecb7a32e110e4238cb0d5036268ff23d7984b855b
|
File details
Details for the file saini-1.0.3-py3-none-any.whl.
File metadata
- Download URL: saini-1.0.3-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4932d8bba17982889c50cdca628a3771f4d28c35930a231d9c908eb72b855254
|
|
| MD5 |
6dc198d462d8511a568021db99adc2df
|
|
| BLAKE2b-256 |
1f7b4d0cb7272b54a32c99ebeed55b92c72d047c12c164608dee943ff71474ec
|