Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ• TimeCard - Simple Time Tracking

A lightweight, command-line time tracking application built in Rust. Track your work hours, manage projects, and generate reports with ease.

✨ Features

  • πŸ• Simple Time Tracking: Clock in/out with project and description support
  • πŸ“Š Status Overview: See current status and daily/weekly summaries
  • πŸ“ˆ Detailed Reports: Generate reports for different time periods
  • πŸ“‹ Entry Management: List, filter, and manage time entries
  • βž• Manual Entries: Add time entries manually with flexible datetime formats
  • πŸ“„ CSV Export: Export reports to CSV for further analysis
  • πŸ’Ύ Local Storage: All data stored locally in JSON format

πŸš€ Quick Start

Installation

  1. Clone the repository:
git clone <repository-url>
cd timecard
  1. Build the application:
cargo build --release
  1. Run the application:
./target/release/timecard --help

Basic Usage

Clock In/Out

# Clock in
timecard in --project "Web Development" --description "Working on frontend"

# Clock out
timecard out --description "Completed frontend work"

Check Status

# Show current status and summaries
timecard status

Generate Reports

# Today's report
timecard report --period today

# This week's report with CSV export
timecard report --period week --csv

# Project-specific report
timecard report --period month --project "Web Development"

List Entries

# List all entries
timecard list

# List entries for specific project
timecard list --project "Web Development"

# List last 10 entries
timecard list --limit 10

Add Manual Entry

# Add entry with full datetime
timecard add --start "2024-01-15 09:00" --end "2024-01-15 17:00" --project "Meeting" --description "Team standup"

# Add entry with just time (assumes today)
timecard add --start "09:00" --end "17:00" --project "Development"

πŸ“– Command Reference

Global Options

  • --data-file <FILE>: Specify data file location (default: timecard.json)

Commands

in - Clock In

Start tracking time for a new session.

Options:

  • -p, --project <PROJECT>: Project name
  • -d, --description <DESCRIPTION>: Description of work

Examples:

timecard in
timecard in -p "Development" -d "Working on new feature"

out - Clock Out

Stop tracking time for the current session.

Options:

  • -d, --description <DESCRIPTION>: Description of completed work

Examples:

timecard out
timecard out -d "Feature completed"

status - Show Status

Display current tracking status and summaries.

Examples:

timecard status

report - Generate Report

Generate time reports for different periods.

Options:

  • -p, --period <PERIOD>: Time period (today, yesterday, week, last-week, month, last-month)
  • --project <PROJECT>: Filter by project
  • --csv: Export to CSV file

Examples:

timecard report --period today
timecard report --period week --project "Development" --csv

list - List Entries

Display time entries with filtering options.

Options:

  • --project <PROJECT>: Filter by project
  • --limit <LIMIT>: Limit number of entries

Examples:

timecard list
timecard list --project "Development" --limit 5

add - Add Manual Entry

Add a manual time entry.

Options:

  • -p, --project <PROJECT>: Project name
  • -d, --description <DESCRIPTION>: Description
  • -s, --start <START>: Start time
  • -e, --end <END>: End time

Examples:

timecard add --start "09:00" --end "17:00" --project "Meeting"
timecard add --start "2024-01-15 09:00" --end "2024-01-15 17:00" --project "Development" --description "Full day of coding"

πŸ“… Time Periods

The following time periods are supported for reports:

  • today: Current day
  • yesterday: Previous day
  • week or this-week: Current week (Monday to Sunday)
  • last-week: Previous week
  • month or this-month: Current month
  • last-month: Previous month

πŸ• DateTime Formats

When adding manual entries, you can use various datetime formats:

  • 2024-01-15 14:30:00 - Full datetime
  • 2024-01-15 14:30 - Date and time
  • 2024-01-15 - Date only
  • 14:30:00 - Time only (assumes today)
  • 14:30 - Time only (assumes today)

πŸ“ Data Storage

All time tracking data is stored locally in a JSON file. By default, this is timecard.json in the current directory. You can specify a different location using the --data-file option.

Data Structure:

{
  "time_entries": [
    {
      "id": "uuid",
      "project": "Project Name",
      "description": "Work description",
      "start_time": "2024-01-15T09:00:00Z",
      "end_time": "2024-01-15T17:00:00Z",
      "created_at": "2024-01-15T09:00:00Z",
      "updated_at": "2024-01-15T17:00:00Z"
    }
  ],
  "projects": [],
  "created_at": "2024-01-15T09:00:00Z",
  "updated_at": "2024-01-15T17:00:00Z"
}

πŸ”§ Configuration

The application uses minimal configuration and stores all settings in the data file. You can:

  • Use different data files for different contexts
  • Backup your data file for safekeeping
  • Share data files between machines

πŸš€ Advanced Usage

Multiple Data Files

# Work projects
timecard --data-file work.json in -p "Development"

# Personal projects
timecard --data-file personal.json in -p "Learning"

Backup and Restore

# Backup your data
cp timecard.json timecard_backup.json

# Restore from backup
cp timecard_backup.json timecard.json

CSV Export for Analysis

# Export this month's data
timecard report --period month --csv

# Import into spreadsheet applications
# The CSV file will be named: timecard_report_month.csv

πŸ› οΈ Development

Building from Source

# Clone the repository
git clone <repository-url>
cd timecard

# Build in debug mode
cargo build

# Build in release mode
cargo build --release

# Run tests
cargo test

Project Structure

src/
β”œβ”€β”€ main.rs          # Application entry point
β”œβ”€β”€ models.rs        # Data models and structures
β”œβ”€β”€ storage.rs       # File I/O operations
└── commands/        # Command implementations
    β”œβ”€β”€ mod.rs
    β”œβ”€β”€ clock.rs     # Clock in/out functionality
    β”œβ”€β”€ status.rs    # Status display
    β”œβ”€β”€ report.rs    # Report generation
    β”œβ”€β”€ list.rs      # Entry listing
    └── add.rs       # Manual entry addition

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with Rust for performance and reliability
  • Uses minimal dependencies for simplicity
  • Inspired by the need for a simple, local time tracking solution

πŸ“ž Support

If you encounter any issues or have questions:

  1. Check the command help: timecard --help
  2. Review the examples in this README
  3. Open an issue on the project repository

Happy Time Tracking! πŸ•βœ¨

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages