Skip to content

NishantCoder108/trackgoal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TrackGoal 🎯

A powerful command-line goal tracking and time management tool built with Rust. Track your goals, manage deadlines, and sync with Google Calendar.

Features

  • Goal Management: Add, edit, delete, and track goals with categories and deadlines
  • Time Tracking: Automatic time tracking for each goal with live timer display
  • Smart Deadlines: Visual indicators for overdue, today's, and upcoming deadlines
  • Google Calendar Sync: Two-way sync between local goals and Google Calendar
  • Clean Interface: Beautiful colored terminal output with aligned tables
  • ID Reuse: Automatically reuses deleted goal IDs to keep numbering compact

Quick Start

Installation

# Clone the repository
git clone https://github.com/NishantCoder108/trackgoal
cd trackgoal

# Build and install
cargo build --release
cargo install --path .



# Or install directly 
cargo install trackgoal

Basic Usage

# Add a new goal (defaults to +24 hours deadline)
trackgoal add "Complete project documentation"

# Add a goal with specific deadline
trackgoal add "Submit proposal" -d "25-12-2026 17:00"

# Add a goal with category and deadline
trackgoal add "Learn Rust" -c "Learning" -d "30-12-2026 18:00" 

# View all goals
trackgoal show

# Mark a goal as completed
trackgoal done 3

# Edit a goal
trackgoal edit 1 "Updated goal title"

# Delete a goal
trackgoal delete 2

πŸ“‹ Commands Reference

Goal Management

Command Description Example
add Add a new goal trackgoal add "Task name" -c "Category" -d "25-12-2026 17:00"
show Display all goals with status trackgoal show
edit Edit goal title trackgoal edit 3 "New title"
done Mark goal as completed trackgoal done 2
delete Delete a goal trackgoal delete 1

Time Tracking

Command Description Example
start Start timer for a goal trackgoal start 3
stop Stop current timer trackgoal stop
stat Show current timer status trackgoal stat

Calendar Integration

Command Description Example
calendar add Add goals to Google Calendar trackgoal calendar add 1 2 3
calendar update Update existing calendar events trackgoal calendar update 1 2
calendar show Show calendar events trackgoal calendar show
calendar auth Authenticate with Google trackgoal calendar auth

πŸ“… Date Formats

TrackGoal supports multiple date formats:

  • DD-MM-YYYY HH:MM (e.g., 25-12-2026 17:00)
  • YYYY-MM-DD HH:MM (e.g., 2026-12-25 17:00)
  • DD-MM-YYYY (defaults to 23:59)

🎨 Status Indicators

Goals are color-coded for quick status identification:

  • πŸ”΄ Overdue: Red background with ! indicator
  • 🟑 Today: Yellow deadline for tasks due today
  • 🟒 Upcoming: Green for future deadlines
  • βœ… Completed: Shows completion time

πŸ”§ Google Calendar Setup

  1. Get Google Cloud Credentials:

    • Go to Google Cloud Console
    • Create a new project
    • Enable Google Calendar API
    • Create OAuth 2.0 credentials
    • Set redirect URI to http://localhost:8080
  2. Set Environment Variables:

    export GOOGLE_CLIENT_ID="your-client-id"
    export GOOGLE_CLIENT_SECRET="your-client-secret"
  3. Authenticate:

    trackgoal calendar auth
  4. Sync Goals:

    # Add specific goals to calendar
    trackgoal calendar add 1 2 3
    
    # Update existing calendar events
    trackgoal calendar update 1 2

πŸ“Š Understanding the Output

Goal Table

================================================================
  YOUR GOALS (3 total)

  #   Title           Category   Deadline       Status     Timer     
  --------------------------------------------------------------
  1   Project X       Work       TODAY 17:00    PENDING    02:15:30  
  2   Learn Rust      Learning   25-12 18:00    PENDING    00:45:12  
  3   Exercise        Health     -              PENDING    01:23:45  
  --------------------------------------------------------------
  Summary:  3 pending  |  0 completed  |  0 overdue
  ================================================================

Columns:

  • #: Goal ID (reuses deleted IDs)
  • Title: Goal name (truncated if too long)
  • Category: Optional category
  • Deadline: Due date with color coding
  • Status: Current status (PENDING/DONE/OVERDUE)
  • Timer: Accumulated time for this goal

πŸ—οΈ Development

Building from Source

# Clone repository
git clone <repository-url>
cd trackgoal

# Install dependencies
cargo build

# Run tests
cargo test

# Install locally
cargo install --path .

Project Structure

trackgoal/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ commands/     # Command implementations
β”‚   β”‚   β”œβ”€β”€ goal.rs  # Goal management
β”‚   β”‚   β”œβ”€β”€ track.rs # Time tracking
β”‚   β”‚   └── calendar.rs # Calendar integration
β”‚   β”œβ”€β”€ models/       # Data models
β”‚   β”œβ”€β”€ db.rs        # Database operations
β”‚   β”œβ”€β”€ cli.rs       # Command-line interface
β”‚   └── main.rs     # Entry point
β”œβ”€β”€ Cargo.toml
└── README.md

Database

TrackGoal uses SQLite for local storage:

  • Database location: ~/Library/Application Support/com.trackgoal.trackgoal/data.db (macOS)
  • Automatic ID reuse for deleted goals
  • Migrations handled automatically

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Run tests: cargo test
  5. Submit a pull request

πŸ†˜ Troubleshooting

Common Issues

Google Calendar Authentication Fails:

  • Verify environment variables are set
  • Check redirect URI matches Google Cloud Console
  • Ensure Calendar API is enabled

Database Errors:

  • Clear database: rm -rf "~/Library/Application Support/com.trackgoal.trackgoal"
  • Restart application

Build Issues:

  • Update Rust: rustup update
  • Clean build: cargo clean && cargo build

Getting Help

# Show general help
trackgoal --help

# Show command-specific help
trackgoal add --help
trackgoal calendar --help

🎯 Tips & Tricks

  1. Use Categories: Organize goals by work, personal, learning, etc.
  2. Set Realistic Deadlines: Default is +24 hours if not specified
  3. Regular Reviews: Use trackgoal show to monitor progress
  4. Calendar Sync: Keep Google Calendar updated for mobile access
  5. Time Tracking: Start/stop timers to track actual time spent

TrackGoal - Built by Nishant with ❀️ in Rust for productive goal tracking!

About

Track goal by terminal and also sync with google calendar

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages