trackgoal 0.1.0

Track Goal by terminal and also sync with Google Calendar
trackgoal-0.1.0 is not a library.

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 <repository-url>
cd trackgoal

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

# Or install directly from crates.io (when published)
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 with ❤️ in Rust for productive goal tracking!