Clockify CLI
A simple cli to manage your time entries on Clockify from terminal
Features
- List time entries from a day
- Report time entries using a date range
- Inform date range as parameters
- "auto filter" for last month
- "auto filter" for this month
- Start a new time entry
- Using a GitHub issue
- Using a Trello card
- Cloning last time entry
- Ask input interactively
- Stop the last entry
- List workspace projects
- Link a Clockify Project with Github:Issues repository
- Link a Clockify Project with Trello board
- List Clockify Workspaces
- List Clockify Workspaces Users
- List Clockify Tags
- Edit time entry
- Configuration management
- Initialize configuration
- Update individual configuration
- Show current configuration
How to install
brew install lucassabreu/tap/clockify-cli
sudo snap install clockify-cli
Using go get
go get -u github.com/lucassabreu/clockify-cli
By Hand
Go to the releases page and download the pre-compiled
binary that fits your system.
Getting Started
After you install the CLI, run clockify-cli config --init
to setup your environment variables. You’ll be prompted to enter your user information. You can get your clockify api token here.
foo@bar:~$ clockify-cli config --init
? User Generated Token: <your-api-token>
? Choose default Workspace: <workspace-id> - John Doe's workspace
? Choose your user: <user-id> - John Doe
? Should try to find project by its name? Yes
? Should use "Interactive Mode" by default? Yes
? Which days of the week do you work? monday, tuesday, wednesday, thursday, friday
? Should allow starting time entries with incomplete data? No
The CLI saves your workspace info and an API token to ~/.clockify-cli.yaml
for future use.
❗ If you have installed the client using snap
this file will not be accessible to you, but the configs will still be persisted.
Now you’re ready to create your first Clockify entry:
foo@bar:~$ clockify-cli in -i
? Choose your project: project-id - Example Project
? Description: Clockify CLI Test
? Start: (2020-09-04 16:02:45)
? End (leave it blank for empty):
+---------------------+----------+----------+---------+-------------------------------+-------------------+------+
| ID | START | END | DUR | PROJECT | DESCRIPTION | TAGS |
+---------------------+----------+----------+---------+-------------------------------+-------------------+------+
| time-entry-id | 16:02:45 | 16:03:47 | 0:01:02 | project-id - Example Project | Clockify CLI Test | |
+---------------------+----------+----------+---------+-------------------------------+-------------------+------+
After finishing your work you can stop the entry using clockify-cli out
foo@bar:~$ clockify-cli out
+---------------------+----------+----------+---------+---------+-------------------+------+
| ID | START | END | DUR | PROJECT | DESCRIPTION | TAGS |
+---------------------+----------+----------+---------+---------+-------------------+------+
| time-entry-id | 16:02:45 | 16:08:06 | 0:05:21 | | Clockify CLI Test | |
+---------------------+----------+----------+---------+---------+-------------------+------+
If you want to re-start the last entry you can use clockify-cli clone last
foo@bar:~$ clockify-cli clone last
+---------------------+----------+----------+---------+---------+-------------------+------+
| ID | START | END | DUR | PROJECT | DESCRIPTION | TAGS |
+---------------------+----------+----------+---------+---------+-------------------+------+
| time-entry-id | 16:10:57 | 16:11:09 | 0:00:12 | | Clockify CLI Test | |
+---------------------+----------+----------+---------+---------+-------------------+------+
Help
Allow to integrate with Clockify through terminal
Usage:
clockify-cli [command]
Available Commands:
clone Copy a time entry and starts it (use "last" to copy the last one)
completion Generate completion script
config Manages configuration file parameters
delete Delete a time entry, use id "current" to apply to time entry in progress
edit Edit a time entry, use id "current" to apply to time entry in progress
gendocs Generate Markdown documentation for the clockify-cli.
help Help about any command
in Create a new time entry and starts it (will close time entries not closed)
log List the entries from a specific day
manual Creates a new completed time entry (does not stop on-going time entries)
me Show the user info
out Stops the last time entry
project List projects from a workspace
report List all time entries in the date ranges and with more data (format date as 2016-01-02)
tags List tags of workspace
version Version of the command
workspaces List user's workspaces
Flags:
--allow-project-name allow use of project name when id is asked (defaults to env $CLOCKIFY_ALLOW_PROJECT_NAME)
--config string config file (default is $HOME/.clockify-cli.yaml)
--debug show debug log (defaults to env $CLOCKIFY_DEBUG)
-h, --help help for clockify-cli
-i, --interactive show interactive log (defaults to env $CLOCKIFY_INTERACTIVE)
-t, --token string clockify's token (defaults to env $CLOCKIFY_TOKEN)
Can be generated here: https://clockify.me/user/settings#generateApiKeyBtn
-u, --user-id string user id from the token (defaults to env $CLOCKIFY_USER_ID)
-w, --workspace string workspace to be used (defaults to env $CLOCKIFY_WORKSPACE)
Use "clockify-cli [command] --help" for more information about a command.
See more information about the sub-commands at: https://clockify-cli.netlify.app/en/commands/clockify-cli/