Clockify Time Manager is a powerful automation tool designed to streamline your time tracking experience with Clockify. Instead of manually logging time entries, this tool allows you to fetch, delete, and add entries efficiently with minimal effort. Developed in PowerShell and executed via a batch file, it simplifies time tracking and ensures accurate logging of work hours.
- Weekday Time Entry Automation – Automatically adds work hours for weekdays (Monday to Friday) within the given date range, excluding weekends.
- Avoids Overlapping Entries – Checks for existing time entries within the specified date range and deletes them before adding new ones.
- Last Run Date Tracking – Stores the last entered date and uses it as the start date for the next execution.
- Efficient Bulk Management – Fetch, delete, and add multiple time entries seamlessly.
- Easy Configuration – Simple setup using an environment variables file.
- User-Friendly Execution – Run the script with a single command or batch file.
ClockifyTimeManager/
│── .env # Stores environment variables (API keys, IDs, etc.)
│── ClockifyTimeManager.ps1 # Core script handling time entries
│── ClockifyTimeManagerEntry.ps1 # Script for user interaction
│── LastRunDate.txt # Tracks the last execution date
│── runClockifyManager.bat # Batch file to execute the entry script
│── sample.env # Sample environment variables file
│── LICENSE # License information
│── README.md # Documentation (this file)
To get started, clone the repository using Git:
git clone https://github.com/mvillan10/clockify_automation.git
cd ClockifyTimeManagerBefore running the script, configure your Clockify API credentials:
-
Copy the sample environment file and rename it:
cp sample.env .env
-
Open
.envand replace the placeholder values with your actual Clockify API key and IDs:API_KEY=your_api_key_here WORKSPACE_ID=your_workspace_id_here USER_ID=your_user_id_here PROJECT_ID=your_project_id_here TASK_ID=your_task_id_here
Execute the script using the provided batch file or via the command line:
./runClockifyManager.batAlternatively, you can run the PowerShell script directly:
powershell -ExecutionPolicy Bypass -File ClockifyTimeManagerEntry.ps1Upon execution, the script will prompt you to enter the date range:
- Start Date – Enter in
YYYY-MM-DDformat or pressEnterto use the last recorded run date. - End Date – Enter in
YYYY-MM-DDformat or pressEnterto use today's date.
- Load Environment Variables – The script reads
.envto retrieve API credentials and workspace details. - Fetch Existing Entries – It retrieves current time entries from Clockify within the specified range.
- Delete Entries – If any existing entries are found, they are removed for a clean slate.
- Add New Entries – New weekday time entries are generated based on the provided project and task IDs.
- Permission Errors: Ensure you have the necessary execution permissions for PowerShell scripts.
- API Issues: Verify that your API key and workspace ID are correctly set in the
.envfile. - Date Format Issues: Ensure dates are entered in the
YYYY-MM-DDformat.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or contributions, feel free to open an issue or submit a pull request on GitHub!