Need help managing your time? Are you having trouble balancing everything? Look no further. This is the beginning of a series of blog posts where I show you how to use PowerShell and PowerBI to automate time management!
PS Clockify Part 1: Getting Started
Background
Time remains one of the few things in life that is impervious to outside influence. Everyday we are all alloted the same 24 hours to do with as we please. Being able to properly manage time can boost productivity and efficiency. About a year ago, I wrote a PowerShell API wrapper for Clockify, a free time management tool and wanted to take the time to show how it can be used to juggle the many day to day challenges we are faced with. We will start with importing and using the module and end up with a Power BI Dashboard that can be used to visually see where you are spending most of your time.
Setting Up Clockify
First, we will need to create a Clockify account, which can be done here.
Next let’s generate an API key by clicking on the avatar at the top right and then Profile Settings or by navigating directly to https://clockify.me/user/settings. Scroll to the bottom of the page and click Generate.
Finally, we will need the workspace name. This can be found on the General tab of Settings or to the left of the upgrade button on the top bar. Feel free to edit the name to be whatever you like.
Installing the Module
Source Code - The module was written with PS Core and works on both Mac and Windows!
Let’s download the code and import it as a PowerShell module using the following code:
Using the Module
Connect to Clockify Workspace
Let’s get connected to Clockify by running the following command (replacing with your API Key and Workspace name from above). If you want to confirm that you are connected, you can run the Test-Session command.
Creating Stuff
Let’s get started by creating a project called chores. We can do that using the module with the following command:
And we can’t forget to add some tasks to the project:
Event Tracking
Lastly, we need to be able to track the time we spend on each task. Let’s track some time doing laundry!
And when we are finished, we can simply run Stop-Timer.
And More
The module can be used to do pretty much anything you can do in the UI. Try playing around with some other commands to create, set, or delete any object (Clients, Projects, Tags, Tasks, and Timers)!
Examples:
Disconnecting a Session
When you are finished working with Clockify, the following command can be used to log out: