clockify-cli in

clockify-cli in

Create a new Clockify time entry

Synopsis

Create a new Clockify time entry

Running time entry will be stopped using the start time of this new entry.

If no start time (--when) is set then the current time will be used.

By default, the CLI will ask the information interactively; use --interactive=0 to disable it.

If you prefer that it never don’t do that by default, run the bellow command, and use --interactive when you want to be asked:

$ clockify-cli config set interactive false

When setting a date/time input (--when and --when-to-close) you can use any of the following formats to set then:

  • Full Date and Time: “2016-02-01 15:04:05”
  • Date and Time (assumes 0 seconds): “2016-02-01 15:04”
  • Yesterday with Time: “yesterday 15:04:05”
  • Yesterday with Time (0 seconds): “yesterday 15:04”
  • Today at Time: “15:04:05”
  • Today at Time (assumes 0 seconds): “15:04”
  • 10mins in the future: +10m
  • 1min and 30s ago: -90s
  • 1hour and 10min ago: -1:10s
  • 1day, 10min and 30s ago: -1d10m30s

To be able to use names of resources instead of its IDs you must enable the feature ‘allow-name-for-id’, to do that run the command (the commands may take longer to look for the resource id):

$ clockify-cli config set allow-name-for-id true

By default, the CLI (and Clockify API) only validates if the workspace and project rules are respected when a time entry is stopped, if you prefer to validate when starting/inserting it run the following command:

$ clockify-cli config set allow-incomplete false

Use clockify-cli report --help for more information about printing time entries.

clockify-cli in [<project-id>] [<description>] [flags]

Examples

# start a timer with project and description, starting now
$ clockify-cli in -i=0 "Clockify CLI" "Documenting in command"
+--------------------------+----------+----------+---------+--------------+------------------------+------+
|            ID            |  START   |   END    |   DUR   |   PROJECT    |      DESCRIPTION       | TAGS |
+--------------------------+----------+----------+---------+--------------+------------------------+------+
| 62ae2744c22de9759e73d038 | 13:28:01 | 13:28:04 | 0:00:03 | Clockify Cli | Documenting in command |      |
+--------------------------+----------+----------+---------+--------------+------------------------+------+

# start a timer with description, starting at 14:00
$ clockify-cli in -i=0 -d "Documenting in command" -s "14:00"
+--------------------------+----------+----------+---------+---------+------------------------+------+
|            ID            |  START   |   END    |   DUR   | PROJECT |      DESCRIPTION       | TAGS |
+--------------------------+----------+----------+---------+---------+------------------------+------+
| 62ae27cd49445270d7bf0333 | 14:00:00 | 14:30:21 | 0:30:21 |         | Documenting in command |      |
+--------------------------+----------+----------+---------+---------+------------------------+------+

# start a timer with description, project and tags, starting 10 min ago
$ clockify-cli in -i=0 -p 621948458cb9606d934ebb1c -d "Documenting in command" -s -10m --tag dev
+--------------------------+----------+----------+---------+--------------+------------------------+--------------------------------+
|            ID            |  START   |   END    |   DUR   |   PROJECT    |      DESCRIPTION       |              TAGS              |
+--------------------------+----------+----------+---------+--------------+------------------------+--------------------------------+
| 62ae29104ebb4f143c92f458 | 14:25:41 | 14:35:44 | 0:10:03 | Clockify Cli | Documenting in command | Development                    |
|                          |          |          |         |              |                        | (62ae28b72518aa18da2acb49)     |
+--------------------------+----------+----------+---------+--------------+------------------------+--------------------------------+

# start a timer with description, project and task, starting at 10 min, but only showing its ID
$ clockify-cli in -i=0 -p 621948458cb9606d934ebb1c -d "Documenting in command" -s -10m --task "in command"
62ae29fdc22de9759e73d343

# start a timer without description, with task and project
$ clockify-cli in -i=0 -p 621948458cb9606d934ebb1c -s -10m --task "in command"
62ae29fdc22de9759e73d343

# start a timer interactively
$ clockify-cli in -i
? Choose your project: 621948458cb9606d934ebb1c - Clockify Cli      | Client: Myself (6202634a28782767054eec26)
? Choose your task: 62ae29e62518aa18da2acd14 - In Command
? Description: Adding more examples
? Choose your tags: 62ae28b72518aa18da2acb49 - Development, 621948708cb9606d934ebba7 - Pair Programming
? Start: now
? End (leave it blank for empty):
+--------------------------+----------+----------+---------+--------------+----------------------+-----------------------------------------+
|            ID            |  START   |   END    |   DUR   |   PROJECT    |     DESCRIPTION      |                  TAGS                   |
+--------------------------+----------+----------+---------+--------------+----------------------+-----------------------------------------+
| 62ae37b84ebb4f143c930523 | 17:38:14 | 17:38:17 | 0:00:03 | Clockify Cli | Adding more examples | Pair Programming                        |
|                          |          |          |         |              |                      | (621948708cb9606d934ebba7) Development  |
|                          |          |          |         |              |                      | (62ae28b72518aa18da2acb49)              |
+--------------------------+----------+----------+---------+--------------+----------------------+-----------------------------------------+

Options

  -A, --allow-incomplete       allow creation of incomplete time entries to be edited later
  -b, --billable               this time entry is billable
  -c, --client string          client of the project to use for time entry
  -v, --csv                    print as CSV
  -d, --description string     time entry description
  -F, --duration-float         prints only the sum of duration as a "float hour"
  -D, --duration-formatted     prints only the sum of duration formatted
  -f, --format string          golang text/template format to be applied on each time entry
  -h, --help                   help for in
  -j, --json                   print as JSON
  -m, --md                     print as Markdown
  -n, --not-billable           this time entry is not billable
  -p, --project string         project to use for time entry
  -q, --quiet                  print only ID
  -T, --tag strings            add tags to the entry (can be used multiple times)
      --task string            add a task to the entry
      --tz string              time zone to be used on the time entries can be 'Local' to use the systems timezone, UTC or valid TZ identifier from the IANA TZ database https://en.wikipedia.org/wiki/List_of_tz_database_time_zones (default "Local")
  -s, --when string            when the entry should be started, if not informed will use current time (default "2024-06-15 17:21:50")
  -e, --when-to-close string   when the entry should be closed, if not informed will let it open (same formats as when)

Options inherited from parent commands

      --allow-name-for-id           allow use of project/client/tag's name when id is asked
  -i, --interactive                 will prompt you to confirm/complement commands input before executing the action 
  -L, --interactive-page-size int   will set how many items will be shown on interactive mode (default 7)
      --log-level string            { none | debug | info } set log level (default "none")
  -t, --token string                clockify's token
                                    Can be generated here: https://clockify.me/user/settings#generateApiKeyBtn
  -u, --user-id string              user id from the token
  -w, --workspace string            workspace to be used

SEE ALSO

  • clockify-cli - Allow to integrate with Clockify through terminal
Auto generated by spf13/cobra on 15-Jun-2024