A simple CLI tool to randomly assign tasks to weekdays (Monday-Friday) with automatic email scheduling.
- ✅ Add and remove tasks interactively
- ✅ Add subtasks to existing tasks
- ✅ Random task assignment to weekdays
- ✅ Email delivery of weekly schedules
- ✅ Automatic scheduling via cron jobs
- ✅ Beautiful HTML email formatting
- ✅ Fixed Monday tasks (Job Search activities)
# Navigate to the project directory
cd tasks-scheduler
# Install Node.js dependencies
npm install# Make the main script executable
chmod +x tasks
# Make the setup script executable
chmod +x setup-cron.shCopy the example environment file and configure your email settings:
cp env.example .env
nano .env # or your preferred editorFor Gmail users:
- Enable 2-factor authentication
- Generate an App Password (Google Account → Security → App Passwords)
- Use the App Password as
EMAIL_PASSin your.envfile
./setup-cron.shThis will create a cron job that runs every Monday at 12:00 AM.
The tool provides a simple command-line interface. All commands should be run from the project directory.
# Add a new task
./tasks add "Water the plants"
# List all tasks
./tasks list
# Remove tasks interactively
./tasks remove
# Generate and display weekly schedule (no email)
./tasks assign
# Generate and send weekly schedule via email
./tasks schedule
# Add a subtask to an existing task
./tasks add-subtask 1 "Buy fertilizer"# Send to default email (EMAIL_TO env var)
./tasks schedule
# Send to specific email address
./tasks schedule [email protected]| Command | Description | Example |
|---|---|---|
add "Task Name" |
Add a new task | ./tasks add "Call dentist" |
add-subtask N "Subtask" |
Add subtask to task #N | ./tasks add-subtask 1 "Buy toothpaste" |
list |
Show all current tasks | ./tasks list |
remove |
Interactive task removal | ./tasks remove |
assign |
Generate and display schedule | ./tasks assign |
schedule |
Generate and email schedule | ./tasks schedule |
schedule [email protected] |
Send to specific email | ./tasks schedule [email protected] |
# Add simple tasks
./tasks add "Water the plants"
./tasks add "Call dentist"
./tasks add "Grocery shopping"
# Add tasks with subtasks
./tasks add "Clean kitchen"
./tasks add-subtask 3 "Wash dishes"
./tasks add-subtask 3 "Wipe counters"./tasks listExample output:
Current Tasks:
1. Water the plants
2. Call dentist
3. Clean kitchen
- Wash dishes
- Wipe counters
4. Grocery shopping
./tasks removeThis will show an interactive menu where you can select tasks to remove.
The tool assigns tasks to weekdays as follows:
- Monday: Fixed tasks (Job Search, Application Send, Follow Ups)
- Tuesday-Friday: Randomly assigned from your task list
# Display schedule without sending email
./tasks assign
# Generate and email schedule
./tasks scheduleExample schedule output:
🎲 Your randomized task schedule:
Monday:
• Application Send
• Follow Ups
• Job Search
Tuesday:
• Water the plants
Wednesday:
• Call dentist
Thursday:
• Clean kitchen
- Wash dishes
- Wipe counters
Friday:
• Grocery shopping
- HTML Formatting: Beautiful styled emails with your weekly schedule
- Date Range: Shows the week's date range
- Task Organization: Tasks organized by day (Monday-Friday)
- Fallback Text: Plain text version for email clients that don't support HTML
Create a .env file in the project directory with these variables:
| Variable | Description | Required |
|---|---|---|
EMAIL_USER |
Your email address | Yes |
EMAIL_PASS |
Your email password/app password | Yes |
EMAIL_TO |
Default recipient email address | No |
SMTP_HOST |
SMTP server (default: smtp.gmail.com) | No |
SMTP_PORT |
SMTP port (default: 587) | No |
Example .env file:
[email protected]
EMAIL_PASS=your-app-password
[email protected]The setup script creates a cron job that runs:
- When: Every Monday at 12:00 AM
- What: Generates and emails your weekly task schedule
- Where: Uses your configured email settings
# View current cron jobs
crontab -l
# Edit cron jobs manually
crontab -e
# Remove all cron jobs
crontab -rtasks-scheduler/
├── tasks # Main CLI script
├── package.json # Dependencies
├── setup-cron.sh # Automatic setup script
├── env.example # Environment variables template
├── .env # Your email configuration (create this)
├── tasks.json # Task storage (created automatically)
└── README.md # This file
# Make scripts executable
chmod +x tasks
chmod +x setup-cron.sh- Check
.envfile exists and has correct values:cat .env - Verify Gmail App Password is correct
- Test manually:
./tasks schedule [email protected]
- Check cron service:
sudo systemctl status cron - View cron logs:
grep CRON /var/log/syslog - Test cron job manually:
./tasks schedule
# Add some tasks first
./tasks add "Your first task"
./tasks list # Verify tasks are added# 1. Set up the tool
npm install
chmod +x tasks
cp env.example .env
# Edit .env with your email settings
# 2. Add your tasks
./tasks add "Water the plants"
./tasks add "Call dentist"
./tasks add "Grocery shopping"
./tasks add-subtask 3 "Buy milk"
./tasks add-subtask 3 "Buy bread"
# 3. View your tasks
./tasks list
# 4. Generate a schedule
./tasks assign
# 5. Send schedule via email
./tasks schedule
# 6. Set up automatic scheduling (optional)
./setup-cron.shWe welcome contributions to improve the Weekly Task Scheduler! Here's how you can help:
- Fork the repository on GitHub
- Create a feature branch for your changes:
git checkout -b feature/your-feature-name
- Make your changes and test them thoroughly
- Commit your changes with clear, descriptive commit messages
- Push to your fork and submit a pull request
# Clone your fork
git clone https://github.com/your-username/tasks-scheduler.git
cd tasks-scheduler
# Install dependencies
npm install
# Make scripts executable
chmod +x tasks
chmod +x setup-cron.sh
# Set up environment
cp env.example .env
# Edit .env with your email settings for testing# Test basic functionality
./tasks add "Test task"
./tasks list
./tasks assign
# Test email functionality (requires .env setup)
./tasks schedule [email protected]- Bug fixes: Report and fix any issues you encounter
- New features: Add useful functionality like:
- Task categories/tags
- Priority levels
- Recurring tasks
- Calendar integration
- Mobile app companion
- Documentation: Improve README, add examples, create tutorials
- Code quality: Refactor, optimize, add tests
- UI/UX: Enhance email templates, improve CLI output
- Use clear, descriptive variable and function names
- Add comments for complex logic
- Follow existing code formatting
- Test your changes thoroughly
- Update documentation as needed
When reporting bugs or requesting features:
- Check if the issue already exists
- Provide a clear description of the problem
- Include steps to reproduce the issue
- Mention your operating system and Node.js version
- Include any error messages or logs
- Keep changes focused and atomic
- Include tests if applicable
- Update documentation for new features
- Ensure all existing functionality still works
- Add your name to contributors if you'd like
Thank you for contributing to make this tool better for everyone!
MIT License - feel free to modify and distribute!