clockidup

⏱ A CLI for generating a Jetstack standup entry using your Clockify time entries

View on GitHub

clockidup, the CLI for generating your standup entry using Clockify

The clockidup CLI helps you generating your standup entry using the time entries from Clockify. Imagine that you recorded your activity and your Clockify day looks like this:

example-clockify

The clockidup CLI allows you to generate the following standup message:

% clockidup today
Wednesday:

- [.8] prod/cert-manager: cert-manager standup
- [1.2] prod/cert-manager: triaging #2037: HTTPS support for the solver’s listener
- [4.6] prod/cert-manager: preparing for 1.2: get #3505 merged
- [4.1] prod/cert-manager: work on jsp-gcm: add manual test for cas-issuer

Features

Installation

go install github.com/maelvls/clockidup@latest

You can also use the pre-built binaries available on the GitHub Release page (for Linux and macOS).

GitHub tagCoverage Status

Usage

To login with Clockify:

clockidup login

One-liner to submit your standup Slack message (to get a token, open http://slackcat.chat/configure):

TOKEN=xoxp-173d646577f-5586534d56b8a-8c7fa2a0a818b-7af170367a53e9ee3e29465efe807a9e
clockidup --billable today | tee /dev/stderr >/tmp/standup && curl -s -X POST "https://slack.com/api/chat.postMessage" -d "token=$TOKEN" -d as_user=true -d channel=$(curl -s -X POST "https://slack.com/api/conversations.list" -d "token=$TOKEN" -d types=im,public_channel,private_channel -d limit=1000 | jq '.channels[] | select(.name == "stand-ups") | .id' -r) --data-urlencode text="$(echo '```'; cat /tmp/standup; echo '```')" | jq

If you are using multiple Clockify workspaces, you can also switch between workspaces using clockidup select

% clockidup select
? Choose a workspace  [Use arrows to move, type to filter]
  jetstack-mael-valais
> personal

You can print your standup message for yesterday:

% clockidup yesterday
Thursday:

- [.5] prod/cert-manager: cert-manager standup
- [.7] prod/cert-manager: reviewing PR 3574
- [1.0] prod/cert-manager: cert-manager v1.2-alpha.1 release with irbe and maartje
- [.4] prod/cert-manager: cert-manager-dev biweekly meeting

You can also print today’s message:

% clockidup today
Monday:

- [2.8] no-project: easy-slack-oauth

Note: I did not set the project for today’s entries, which is an invalid standup message; in this case, clockidup will show no-project.

You can even use an arbitrary human-readable relative date as specified by tj/go-naturaldate. Some examples:

clockidup tuesday
clockidup "4 days ago"
clockidup "28 Jan"

Note that the following commands are equivalent:

clockidup tuesday
clockidup "last tuesday"

Tasks in Clockify are also supported and can be optionally used. If a time entry has an associated task, the task name will prefix the entry description. Imagine that you have a time entry “fix progress bar” and this time entry is linked to a broader task “download feature”, then the output will be:

- [0.50] prod/my-super-product: download feature: add progress bar
  <----project name----> <---task name---> <--entry name-->

The date printed on the first line is compatible with the expected standup date format. It either shows the week day e.g. “Monday” if the given day is within the past week and “2021-01-28” if not.

For example, when the day is within the week:

% clockidup today
Wednesday:

- [.8] prod/cert-manager: cert-manager standup
- [1.2] prod/cert-manager: triaging #2037: HTTPS support for the solver’s listener
- [4.6] prod/cert-manager: preparing for 1.2: get #3505 merged
- [4.1] prod/cert-manager: work on jsp-gcm: add manual test for cas-issuer

And when the day is more than 7 days ago, you can use the ISO 8601, calendar date format as input (as of v0.2.0):

% clockidup 2021-01-27
2021-01-27:

- [2.6] prod/cert-manager: work on jsp-gcm
- [.6] admin: coffee with Mattias Gees
- [.0] prod/cert-manager: cert-manager standup
- [.7] prod/cert-manager: reviewing josh comments on PR 3574
- [.1] prod/cert-manager: review of Design: cert-manager certificates.k8s.io Adoption
- [.1] prod/cert-manager: review of Design: cert-manager Identity
- [.1] prod/cert-manager: review of Design cert-manager Policy
- [1.6] prod/cert-manager: investigate #3603 "multiple certificaterequests"
- [.9] prod/cert-manager: cert-manager v1.2-alpha.1 release with irbe and maartje
- [.6] prod/cert-manager: cert-manager internal meeting
- [.4] prod/cert-manager: cert-manager-dev biweekly meeting

You can use the --billable flag if you only want to see the Clockify entries that have the billable: true property.

End-to-end tests

The end-to-end tests are using pre-recorded HTTP interactions. The interactions have been recorded using a dummy account (mael+clockify-end-to-end-tests@vls.dev) with two workspaces (times are GMT+2):

Both “live” and “recorded” tests are run in GitHub Actions. To run the “live” tests, set CLOCKIFY_TOKEN and run:

RECORD=1 go test ./...
🐓 Edit this page