A lightweight, command-line time tracking application built in Rust. Track your work hours, manage projects, and generate reports with ease.
- π 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
- Clone the repository:
git clone <repository-url>
cd timecard- Build the application:
cargo build --release- Run the application:
./target/release/timecard --help# Clock in
timecard in --project "Web Development" --description "Working on frontend"
# Clock out
timecard out --description "Completed frontend work"# Show current status and summaries
timecard status# 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 all entries
timecard list
# List entries for specific project
timecard list --project "Web Development"
# List last 10 entries
timecard list --limit 10# 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"--data-file <FILE>: Specify data file location (default:timecard.json)
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"Stop tracking time for the current session.
Options:
-d, --description <DESCRIPTION>: Description of completed work
Examples:
timecard out
timecard out -d "Feature completed"Display current tracking status and summaries.
Examples:
timecard statusGenerate 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" --csvDisplay 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 5Add 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"The following time periods are supported for reports:
today: Current dayyesterday: Previous dayweekorthis-week: Current week (Monday to Sunday)last-week: Previous weekmonthorthis-month: Current monthlast-month: Previous month
When adding manual entries, you can use various datetime formats:
2024-01-15 14:30:00- Full datetime2024-01-15 14:30- Date and time2024-01-15- Date only14:30:00- Time only (assumes today)14:30- Time only (assumes today)
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"
}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
# Work projects
timecard --data-file work.json in -p "Development"
# Personal projects
timecard --data-file personal.json in -p "Learning"# Backup your data
cp timecard.json timecard_backup.json
# Restore from backup
cp timecard_backup.json timecard.json# Export this month's data
timecard report --period month --csv
# Import into spreadsheet applications
# The CSV file will be named: timecard_report_month.csv# 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 testsrc/
βββ 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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Rust for performance and reliability
- Uses minimal dependencies for simplicity
- Inspired by the need for a simple, local time tracking solution
If you encounter any issues or have questions:
- Check the command help:
timecard --help - Review the examples in this README
- Open an issue on the project repository
Happy Time Tracking! πβ¨