### Start a New Time Entry with Clockify CLI Source: https://clockify-cli.netlify.app/en/usage This command starts a new time entry. By default, it prompts for project, task, description, tags, start time, and end time. Leaving the end time blank starts a timer. The output displays the newly created time entry details. The interactive mode can be disabled globally or for a specific command. ```bash $ clockify-cli in ? Choose your project: 621948458cb9606d934ebb1c - Clockify Cli | Client: Myself (6202634a28782767054eec26) ? Choose your task: 62ae29e62518aa18da2acd14 - In Command ? Description: Some description ? Choose your tags: 62ae28b72518aa18da2acb49 - Development ? Start: 2022-06-30 22:49:34 ? End (leave it blank for empty): +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ | ID | START | END | DUR | PROJECT | DESCRIPTION | TAGS | +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ | 62be52d2f2c0e80ba36fce0a | 23:02:41 | 23:02:41 | 0:00:00 | Clockify Cli | Some description | Development (62ae28b72518aa18da2acb49) | +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ ``` -------------------------------- ### Example: Add Project with Name Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_add This example demonstrates how to add a new project by providing only its name. The output shows the details of the newly created project, including its ID, name, and associated client (if any). ```bash $ clockify-cli project add --name "New One" +--------------------------+---------+--------+ | ID | NAME | CLIENT | +--------------------------+---------+--------+ | 62a8b52d67f40258719037f2 | New One | | +--------------------------+---------+--------+ ``` -------------------------------- ### Example: Add Project with Client and CSV Output Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_add This example shows how to add a project associated with a specific client and output the details in CSV format. This is useful for integrating Clockify data with other systems. ```bash $ clockify-cli project add --name "Other" --client="Uber" --csv --color=#fff id,name,client.id,client.name 62a8b607027fe4592ef1520b,Other,62964b36bb48532a70730dbe,Uber Special ``` -------------------------------- ### Start Clockify Timer with Project, Description, Tags, and Relative Start Time Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_in Starts a new Clockify time entry with a project ID, description, tags, and a start time relative to the current time (e.g., '-10m' for 10 minutes ago). The '--interactive=0' flag disables interactive prompts. ```bash clockify-cli in -i=0 -p 621948458cb9606d934ebb1c -d "Documenting in command" -s -10m --tag dev ``` -------------------------------- ### Example: Set Client for a Project Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_edit Demonstrates how to associate a client with a specific project using the `--client` flag. It shows the command and the resulting project details. ```bash # set a client form the project $ clockify-cli project edit cli --client Myself +--------------------------+--------------+--------------------------------+ | ID | NAME | CLIENT | +--------------------------+--------------+--------------------------------+ | 621948458cb9606d934ebb1c | Clockify Cli | Myself | | | | (6202634a28782767054eec26) | +--------------------------+--------------+--------------------------------+ ``` -------------------------------- ### Start Clockify Timer with Project and Description Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_in Starts a new Clockify time entry with a specified project and description, beginning at the current time. The '--interactive=0' flag disables interactive prompts. ```bash clockify-cli in -i=0 "Clockify CLI" "Documenting in command" ``` -------------------------------- ### Clockify CLI Config List Command Example Output Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_config_list An example of the output when running the 'clockify-cli config list' command. This demonstrates the default YAML format and displays various user settings, including authentication tokens, IDs, and behavioral flags. ```bash $ clockify-cli config list allow-incomplete: false allow-name-for-id: true allow-project-name: true debug: false description-autocomplete: true description-autocomplete-days: 15 interactive: true no-closing: false show-task: false show-custom-fields: false show-total-duration: true token: Yamdas569 user: id: ffffffffffffffffffffffff workspace: eeeeeeeeeeeeeeeeeeeeeeee workweek-days: - monday - tuesday - wednesday - thursday - friday ``` -------------------------------- ### Example: Clone a Time Entry with Description and Tags Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_clone This example demonstrates cloning a time entry using the 'last' identifier. It specifies a description and a tag ('pair programming') for the new entry. The output shows the details of the newly created cloned entry. ```bash $ clockify-cli clone last -d "Adding examples to in" -T pair --task "in command" --md ID: `62ae4dfe4ebb4f143c932106` Billable: `yes` Locked: `no` Project: Clockify Cli (`621948458cb9606d934ebb1c`) Task: In Command (`62ae29e62518aa18da2acd14`) Interval: `2022-06-18 22:13:14` until `now` Description: > Adding examples to in Tags: * Pair Programming (`621948708cb9606d934ebba7`) ``` -------------------------------- ### Example: Create a New Time Entry and Clone it Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_clone This example first creates a new time entry using the 'clockify-cli in' command, specifying project, tag, description, and task. It then demonstrates cloning this newly created entry using its ID. The output shows the details of the original entry and then the cloned entry. ```bash $ clockify-cli in --project cli --tag dev -d "Adding docs to clone" --task "clone" --md ID: `62ae4b304ebb4f143c931d50` Billable: `yes` Locked: `no` Project: Clockify Cli (`621948458cb9606d934ebb1c`) Task: Clone Command (`62ae4af04ebb4f143c931d2e`) Interval: `2022-06-18 22:01:16` until `now` Description: > Adding docs to clone Tags: * Development (`62ae28b72518aa18da2acb49`) ``` -------------------------------- ### Start Clockify Timer with Description and Specific Start Time Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_in Starts a new Clockify time entry with a description and a specified start time (e.g., '14:00'). The '--interactive=0' flag disables interactive prompts. ```bash clockify-cli in -i=0 -d "Documenting in command" -s "14:00" ``` -------------------------------- ### Example: Add Project with Name and Quiet Output Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_add This example adds a project with a specified name and uses the `--quiet` flag to display only the project's ID. This is useful for scripting or when only the identifier is needed. ```bash $ clockify-cli project add --name=Other -q 62a8b59067f40258719038fc ``` -------------------------------- ### Example: Error Handling for Existing Project with Random Color Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_add This example demonstrates an error message when attempting to add a project that already exists and a random color is requested. It indicates a conflict and provides an error code. ```bash $ clockify-cli project add --name Other --random-color add project: Other project for client Uber Special already exists. (code: 501) ``` -------------------------------- ### Add Manual Time Entry with Clockify CLI Source: https://clockify-cli.netlify.app/en/usage This command allows users to create a time entry with a specified start and end time, project, description, and tags without affecting a currently running timer. It is useful for logging past activities. ```bash clockify-cli manual -s "yesterday 17:50" -e "yesterday 18:00" -T meet -d 'About the Calendar' \ -p cli ``` -------------------------------- ### Start Clockify Timer with Project, Task, and Relative Start Time Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_in Starts a new Clockify time entry using a project ID, task name, and a start time relative to the current time (e.g., '-10m'). The '--interactive=0' flag disables interactive prompts. Only the entry ID is displayed. ```bash clockify-cli in -i=0 -p 621948458cb9606d934ebb1c -d "Documenting in command" -s -10m --task "in command" ``` -------------------------------- ### Generate Daily Time Entries Report with Clockify CLI Source: https://clockify-cli.netlify.app/en/usage This command generates a report of all time entries for the current day. The report includes entry ID, start time, end time, duration, project, description, and tags. ```bash clockify-cli report ``` -------------------------------- ### Start Clockify Timer without Description Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_in Starts a new Clockify time entry using a project ID and a task name, with a start time relative to the current time (e.g., '-10m'). The '--interactive=0' flag disables interactive prompts. Only the entry ID is displayed. ```bash clockify-cli in -i=0 -p 621948458cb9606d934ebb1c -s -10m --task "in command" ``` -------------------------------- ### Example: Error Handling for Conflicting Flags Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_add This example shows an error message when attempting to use mutually exclusive flags, such as `--color` and `--random-color`, for adding a project. The command lists the flags that cannot be used together. ```bash $ clockify-cli project add --name "Something" --client="Uber" --color=#fff the following flags can't be used together: color and random-color ``` -------------------------------- ### Split a time entry into multiple entries Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_split This command splits an existing time entry (identified by its ID, 'current', 'last', or relative position like '^n') into new entries based on the provided times. The output can be formatted using Go templates, allowing for customized display of entry details like ID and start time. The example shows splitting an entry at 12:00 and 13:30 and formatting the output to show the original entry's ID and start time, followed by the new entries' IDs and start times. ```bash # splits the time entry at lunch and now $ clockify-cli split 12:00 13:30 --format '{{.ID}},{{.TimeInterval.Start|ft}}' ``` -------------------------------- ### Example: Adding a client with a specific name Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_client_add Demonstrates how to add a client with the name 'Special'. The output shows the details of the newly created client, including its ID, Name, and Archived status. ```bash $ clockify-cli client add --name Special +--------------------------+---------+----------+ | ID | NAME | ARCHIVED | +--------------------------+---------+----------+ | eeeeeeeeeeeeeeeeeeeeeeee | Special | NO | +--------------------------+---------+----------+ ``` -------------------------------- ### Initialize Clockify CLI Configuration Source: https://clockify-cli.netlify.app/en/usage This command interactively sets up the Clockify CLI environment by prompting for user-generated token, default workspace, user ID, project/task/tag name matching preferences, interactive mode default, workdays, incomplete data handling, and task display preference. The configurations are saved to `$HOME/.clockify-cli.yaml`. ```bash $ clockify-cli config init ? User Generated Token: ? Choose default Workspace: - John Doe's workspace ? Choose your user: - John Doe ? Should try to find projects/tasks/tags by their names? 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 ? Should show task on time entries as a separated column? Yes ``` -------------------------------- ### List Active Clockify Clients with Custom Format Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_client_list This example shows how to list only active (not archived) clients and apply a custom Go template format to display only the client names enclosed in angle brackets. ```bash $ clockify-cli client list --not-archived --format "<{{ .Name }}>" ``` -------------------------------- ### Example: Archive Multiple Projects Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_edit Illustrates how to archive multiple projects simultaneously by listing their names and using the `--archived` flag. The output confirms the archived status for each project. ```bash # archive multiple projects $ clockify-cli project first second \ --archived \ --format "{{.Name}} | {{.Archived}}" First | true Second | true ``` -------------------------------- ### List Archived Clockify Clients as CSV Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_client_list This example demonstrates how to list only archived clients from a Clockify workspace and format the output as CSV. This is useful for data export and analysis. ```bash $ clockify-cli client list --archived --csv 62964b36bb48532a70730dbe,Client 2,true ``` -------------------------------- ### Clone Last Time Entry with Clockify CLI Source: https://clockify-cli.netlify.app/en/usage This command clones the last completed time entry, creating a new entry with the same project, task, description, and tags. The '-i=0' flag prevents the CLI from prompting for confirmation, starting the new timer immediately. The output displays the newly cloned time entry. ```bash $ clockify-cli clone last -i=0 +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ | ID | START | END | DUR | PROJECT | DESCRIPTION | TAGS | +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ | 62be5684f2c0e80ba36fcecd | 23:05:53 | 23:05:56 | 0:00:03 | Clockify Cli | Some description | Development (62ae28b72518aa18da2acb49) | +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ ``` -------------------------------- ### Example: Clone the Last Time Entry with Description Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_clone This example shows how to clone the most recent time entry using the 'last' keyword. It includes a new description for the cloned entry and uses the `--md` flag for Markdown formatted output. The output details the cloned time entry. ```bash $ clockify-cli clone last -d "Adding examples to clone" --md ID: `62ae4b304ebb4f143c931d50` Billable: `yes` Locked: `no` Project: Clockify Cli (`621948458cb9606d934ebb1c`) Task: Clone Command (`62ae4af04ebb4f143c931d2e`) Interval: `2022-06-18 22:11:16` until `now` Description: > Adding examples to clone Tags: * Development (`62ae28b72518aa18da2acb49`) ``` -------------------------------- ### Example: Remove Client from a Project Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_edit Illustrates how to remove an associated client from a project using the `--no-client` flag. The output shows the project without a client assigned. ```bash # remove client from a project $ clockify-cli project edit cli --no-client +--------------------------+--------------+--------+ | ID | NAME | CLIENT | +--------------------------+--------------+--------+ | 621948458cb9606d934ebb1c | Clockify Cli | | +--------------------------+--------------+--------+ ``` -------------------------------- ### Get Formatted User Name and Email (Shell) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_me Retrieves the user's name and email, formatted using a Go text/template. This allows for custom output strings combining user attributes. ```shell clockify-cli user me --format "{{ .Name }} ({{ .Email }})" ``` -------------------------------- ### Clockify CLI Out Command - Example: Stop with Markdown Output Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_out This example demonstrates how to stop the currently running time entry and display the details in Markdown format. The `--md` flag is used for Markdown output. This is useful for reviewing the details of the stopped time entry. ```bash # stop running time entry with current time $ clockify-cli out --md ID: `62af6b0f4ebb4f143c94880e` Billable: `yes` Locked: `no` Project: Clock Out Command (`62af66454ebb4f143c948263`) Interval: `2022-06-19 18:29:32` until `2022-06-19 18:52:13` Description: > Adding examples Tags: * Development (`62ae28b72518aa18da2acb49`) ``` -------------------------------- ### Edit Time Entry - Basic Example Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_edit An example of editing the description of the currently running time entry. It uses the keyword 'current' to refer to the active time entry and the '-d' flag to provide the new description. The '--md' flag formats the output in Markdown. ```bash # starting a time entry $ clockify-cli in --project cli --tag dev -d "Adding docs to edit" --task "edit" --md ID: `62ae4b304ebb4f143c931d50` Billable: `yes` Locked: `no` Project: Clockify Cli (`621948458cb9606d934ebb1c`) Task: Edit Command (`62ae4af04ebb4f143c931d2e`) Interval: `2022-06-18 22:01:16` until `now` Description: > Adding docs to edit Tags: * Development (`62ae28b72518aa18da2acb49`) # changing the description on the running time entry $ clockify-cli edit current -d "Adding examples to edit" --md ID: `62ae4b304ebb4f143c931d50` Billable: `yes` Locked: `no` Project: Clockify Cli (`621948458cb9606d934ebb1c`) Task: Edit Command (`62ae4af04ebb4f143c931d2e`) Interval: `2022-06-18 22:01:16` until `now` Description: > Adding examples to edit Tags: * Development (`62ae28b72518aa18da2acb49`) ``` -------------------------------- ### Example: Modify Project Name, Color, and Public Status Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_edit Shows how to change a project's name, color, and make it public using `--name`, `--public`, and `--color` flags. The `--format` flag customizes the output. ```bash # change name, color and make public $ clockify-cli project 62f19c254a912b05acc6d6cf \ --name First --public --color #0f0 \ --format "{{.Name}} | {{.Public}} | {{.Color}}" First | true | #00ff00 ``` -------------------------------- ### Example: Update Billable Status, Archive, and Add Note Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_edit Demonstrates modifying a project to be not billable and archived, and adding a note from a file using `--not-billable`, `--archived`, and `--note`. The output is formatted to show these changes. ```bash # change to not billable, archived and leave a note $ clockify-cli project second --not-billable --archived \ --note "$(cat notes.txt)" \ --format 'n: {{.Name}}\nb: {{.Billable}}\na: {{.Archived}}\nn:\n{{ .Note }}' n: Noted b: false a: false n: one line two lines three lines ``` -------------------------------- ### Example: Attempting to add a client with an existing name Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_client_add Shows the error message returned when attempting to add a client with a name that already exists in the workspace. The error includes a specific error code. ```bash $ clockify-cli client add --name "Special" # same name as existing one add client: Client with name 'Special' already exists (code: 501) ``` -------------------------------- ### Example: Adding a client with a name containing spaces and quiet output Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_client_add Illustrates adding a client named 'Very Special' and suppressing detailed output using the `--quiet` flag, which results in only the client ID being returned. ```bash $ clockify-cli client add --name "Very Special" --quiet aaaaaaaaaaaaaaaaaaaaaaaa ``` -------------------------------- ### Example: Mark Multiple Time Entries as Not Invoiced (Shell) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_mark-not-invoiced This example demonstrates marking multiple time entries as not invoiced simultaneously by providing a space-separated list of their IDs. The `--quiet` flag is used to display only the IDs of the processed entries. ```shell # setting multiple time entries as not invoiced $ clockify-cli mark-not-invoiced 62b5b51085815e619d7ae18d 62b5d55185815e619d7af928 --quiet 62b5b51085815e618d 62b5d55185815e619d7af928 ``` -------------------------------- ### Clockify CLI Out Command - Example: Stop with Custom End Time Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_out This example shows how to stop a time entry at a specific future time. The `--when` flag is set to `+10m` to indicate the entry should end 10 minutes from the current time. The `--md` flag is used for Markdown output. ```bash # clone last and stopping it in 10 minutes $ clockify-cli clone last -i=0 -d 'More examples' -q 62af70d849445270d7c09fbd $ clockify-cli out --when +10m --md ID: `62af70d849445270d7c09fbd` Billable: `yes` Locked: `no` Project: Clockify Cli (`621948458cb9606d934ebb1c`) Task: Out Command (`62af666349445270d7c09285`) Interval: `2022-06-19 18:54:12` until `2022-06-19 19:08:26` Description: > More examples Tags: * Development (`62ae28b72518aa18da2acb49`) ``` -------------------------------- ### List Clockify Clients by Name (Quiet Mode) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_client_list This example filters clients by a specified name (or part of a name) and uses the '--quiet' flag to display only the matching client IDs. This is efficient for scripting and automation. ```bash $ clockify-cli client list --name "1" --quiet 6202634a28782767054eec26 ``` -------------------------------- ### Create a New Time Entry (Synopsis) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_manual The basic command structure for creating a new time entry. It allows specifying project ID, start time, end time, and a description. Flags can modify behavior, such as allowing incomplete entries or setting billable status. ```bash clockify-cli manual [] [] [] [] [flags] ``` -------------------------------- ### Delete Time Entry Examples (CLI) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_delete Demonstrates various use cases for the 'clockify-cli delete' command, including attempting to delete a non-existent entry, deleting the currently running entry, deleting the last entry, and deleting multiple entries by their IDs. ```bash # trying to delete a time entry that does not exist, or from other workspace $ clockify-cli delete 62af70d849445270d7c09fbc delete time entry "62af70d849445270d7c09fbc": TIMEENTRY with id 62af70d849445270d7c09fbc doesn't belong to WORKSPACE with id cccccccccccccccccccccccc (code: 501) # deleting the running time entry $ clockify-cli delete current # no output # deleting the last time entry $ clockify-cli delete last # no output # deleting multiple time entries $ clockify-cli delete 62b5b51085815e619d7ae18d 62b5d55185815e619d7af928 # no output ``` -------------------------------- ### Enable Zsh Completion Script Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_completion To enable Zsh completion for clockify-cli, add the provided 'source' command to your ~/.zshrc file. This command loads the completion script dynamically when you start a new Zsh session. ```zsh source <(clockify-cli completion zsh) ``` -------------------------------- ### Generate Project Time Report This Month (Clockify CLI) Source: https://clockify-cli.netlify.app/en/usage This command generates a time report for a specified project for the current month. It filters timers by project name and formats the output to display only the total duration. Dependencies include the clockify-cli tool. ```bash $ clockify-cli report this-month -p cli --duration-formatted 6:23:52 ``` -------------------------------- ### Edit Time Entry - Multiple Fields Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_edit This example demonstrates editing a time entry by updating its description, task, and tags simultaneously. It uses the '-d' flag for the description, '--task' for the task name, and '-T' for tags. The '--md' flag is used for Markdown output formatting. ```bash # change the description, task, and tags $ clockify-cli edit -d "Adding examples to edit" -T pair --task "in command" --md ID: `62ae4b304ebb4f143c931d50` Billable: `yes` Locked: `no` Project: Clockify Cli (`621948458cb9606d934ebb1c`) Task: In Command (`62ae29e62518aa18da2acd14`) Interval: `2022-06-18 22:13:14` until `now` Description: > Adding examples to edit Tags: * Pair Programming (`621948708cb9606d934ebba7`) ``` -------------------------------- ### POST /config/init Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_config_init Initializes the Clockify CLI configuration by setting up essential parameters such as API token, user ID, workspace, and interactive behavior options. ```APIDOC ## clockify-cli config init ### Description Setups the CLI parameters with tokens, default workspace, user and behaviors. ### Method POST ### Endpoint /config/init ### Parameters #### Query Parameters - **token** (string) - Optional - Clockify's token. Can be generated here: https://clockify.me/user/settings#generateApiKeyBtn - **user-id** (string) - Optional - User ID from the token. - **workspace** (string) - Optional - Workspace to be used. - **allow-name-for-id** (boolean) - Optional - Allows the use of project/client/tag's name when an ID is asked. - **interactive** (boolean) - Optional - Will prompt the user to confirm/complement commands input before executing the action. - **interactive-page-size** (integer) - Optional - Sets how many items will be shown in interactive mode. (default 7) - **log-level** (string) - Optional - Sets the log level. Allowed values: { none | debug | info }. (default "none") ### Request Example ```json { "token": "YOUR_CLOCKIFY_TOKEN", "user-id": "YOUR_USER_ID", "workspace": "YOUR_WORKSPACE_ID", "interactive": true, "log-level": "debug" } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the configuration has been updated. #### Response Example ```json { "message": "Clockify CLI configuration initialized successfully." } ``` ``` -------------------------------- ### Example: Mark a Specific Time Entry as Not Invoiced (Shell) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_mark-not-invoiced This example demonstrates how to mark a single time entry, identified by its ID ('62b49641f4b27f4ed7d20e75'), as not invoiced. If the workspace does not permit invoicing, a 403 Forbidden error will be returned. ```shell # when the workspace does not allow invoicing $ clockify-cli mark-not-invoiced 62b49641f4b27f4ed7d20e75 Forbidden (code: 403) ``` -------------------------------- ### Command Options for adding a client Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_client_add Lists the available flags for the `clockify-cli client add` command, including options for output formatting (`--csv`, `--format`, `--json`), specifying the client name (`--name`), and controlling output verbosity (`--quiet`). ```bash -v, --csv print as CSV -f, --format string golang text/template format to be applied on each Client -h, --help help for add -j, --json print as JSON -n, --name string the name of the new client -q, --quiet only display ids ``` -------------------------------- ### Clockify CLI Config Get Command Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_config_get Retrieves a specific configuration parameter set by the user. Supports different output formats like JSON and YAML. Inherits various flags for interactive mode, logging, and authentication. ```bash clockify-cli config get [flags] # Examples: $ clockify-cli config get token Yamdas569 $ clockify-cli config get workweek-days --format=json ["monday","tuesday","wednesday","thursday","friday"] # Options: -f, --format string { yaml | json } output format (default "yaml") -h, --help help for get # 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 ``` -------------------------------- ### Example: Mark Current Running Time Entry as Not Invoiced (Shell) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_mark-not-invoiced This example shows how to mark the currently running time entry as not invoiced using the `current` keyword. The `--quiet` flag ensures that only the time entry ID is printed to the console upon successful execution. ```shell # set the running time entry as not invoiced $ clockify-cli mark-not-invoiced current --quiet 62b49641f4b27f4ed7d20e75 ``` -------------------------------- ### Custom Go Template Formatting Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_report_this-month Allows applying a custom Go template format to each time entry. This provides extensive control over the output structure and content, enabling complex reporting scenarios. ```bash clockify-cli report this-month -f "{{.Description}} - {{.Duration}}" ``` -------------------------------- ### Edit Current Time Entry Tags with Clockify CLI Source: https://clockify-cli.netlify.app/en/usage This command allows editing the current time entry. In this example, it modifies the tags associated with the current time entry by adding 'pair' and 'web' tags. The output shows the updated time entry details. This command can be used to modify various attributes of the current or a specified time entry. ```bash $ clockify-cli edit current -T pair -T web +--------------------------+----------+----------+---------+--------------+------------------+---------------------------------------------+ | ID | START | END | DUR | PROJECT | DESCRIPTION | TAGS | ``` -------------------------------- ### Get User ID Only (Shell) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_me Retrieves only the user ID in quiet mode. This is useful for scripting or when only the unique identifier is needed. ```shell clockify-cli user me --quiet ``` -------------------------------- ### Configure Clockify CLI Allow Incomplete Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_in Changes validation timing for workspace and project rules to occur when starting or inserting a time entry, rather than only when stopping it. ```bash clockify-cli config set allow-incomplete false ``` -------------------------------- ### Configure Name-Based Resource IDs Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_manual Enables the use of resource names (like project or client names) instead of their IDs when creating time entries. This can make commands more readable but may increase execution time as the CLI looks up IDs. ```bash clockify-cli config set allow-name-for-id true ``` -------------------------------- ### List Workspaces Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_workspace Lists all available Clockify workspaces associated with the authenticated user. Supports filtering by name and custom output formatting. ```APIDOC ## clockify-cli workspace ### Description Lists your available Clockify workspaces. ### Method GET ### Endpoint /workspaces ### Parameters #### Query Parameters - **-f, --format** (string) - Optional - golang text/template format to be applied on each workspace. - **-n, --name** (string) - Optional - Filters the workspaces by name. - **-q, --quiet** (boolean) - Optional - Only display workspace IDs. - **-h, --help** (boolean) - Optional - help for workspace command. - **--allow-name-for-id** (boolean) - Optional - Allows using project/client/tag's name when an ID is asked. - **-i, --interactive** (boolean) - Optional - Prompts to confirm/complement commands input before executing the action. - **-L, --interactive-page-size** (int) - Optional - Sets how many items will be shown in interactive mode (default 7). - **--log-level** (string) - Optional - Sets the log level ({ none | debug | info }, default "none"). - **-t, --token** (string) - Required - Clockify API token. Can be generated at https://clockify.me/user/settings#generateApiKeyBtn. - **-u, --user-id** (string) - Required - The user ID associated with the token. - **-w, --workspace** (string) - Optional - Specifies the workspace to be used for the command. ### Request Example ```bash clockify-cli workspace -n "My Project Workspace" -t "YOUR_API_TOKEN" -u "YOUR_USER_ID" ``` ### Response #### Success Response (200) - **workspaces** (array) - A list of workspace objects. - **id** (string) - The unique identifier of the workspace. - **name** (string) - The name of the workspace. - **imageUrl** (string) - The URL of the workspace's image. - **isOwner** (boolean) - Indicates if the current user is the owner of the workspace. - **hourlyRate** (object) - Default hourly rate settings for the workspace. - **amount** (number) - The amount for the hourly rate. - **currency_symbol** (string) - The currency symbol for the hourly rate. - **currency_decimals** (number) - The number of decimal places for the currency. - **timeEstimateSetting** (object) - Time estimate settings for the workspace. - **isTimeEstimatesEnabled** (boolean) - Whether time estimates are enabled. - **isOvertimeEnabled** (boolean) - Whether overtime is enabled. - **defaultTag** (object or null) - Default tag settings. - **defaultProject** (object or null) - Default project settings. #### Response Example ```json [ { "id": "60b8d1b2e1c3a4001f8e4d5a", "name": "My Workspace", "imageUrl": "https://images.clockify.me/default.png", "isOwner": true, "hourlyRate": { "amount": 0, "currency_symbol": "$", "currency_decimals": 2 }, "timeEstimateSetting": { "isTimeEstimatesEnabled": true, "isOvertimeEnabled": false }, "defaultTag": null, "defaultProject": null } ] ``` ``` -------------------------------- ### Project Add Command Options Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_add This section lists the available options for the 'clockify-cli project add' command. These flags allow users to configure various aspects of the new project, such as its name, client, color, and visibility. ```bash -b, --billable make the new project as billable --client string the id/name of the client the new project will go under -c, --color string color of the new project -v, --csv print as CSV -f, --format string golang text/template format to be applied on each Project -h, --help help for add -j, --json print as JSON -n, --name string name of the new project -N, --note string note for the new project -p, --public make the new project public -q, --quiet only display ids --random-color use a random color for the project ``` -------------------------------- ### List Available Completion Shells Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_completion This command displays the available shells for which clockify-cli can generate completion scripts. You can specify 'bash', 'zsh', 'fish', or 'powershell'. ```bash clockify-cli completion { bash | zsh | fish | powershell } ``` -------------------------------- ### Output User Details as JSON (Shell) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_me Displays the user's details in JSON format. This is helpful for integrating with other systems or for structured data processing. ```shell clockify-cli user me --json ``` -------------------------------- ### Stop Current Time Entry with Clockify CLI Source: https://clockify-cli.netlify.app/en/usage This command stops the currently running timer and updates the time entry. The output shows the completed time entry with its duration. This command can also be run in interactive mode if it was disabled globally. ```bash $ clockify-cli out +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ | ID | START | END | DUR | PROJECT | DESCRIPTION | TAGS | +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ | 62be52d2f2c0e80ba36fce0a | 22:49:34 | 23:02:41 | 0:13:07 | Clockify Cli | Some description | Development (62ae28b72518aa18da2acb49) | +--------------------------+----------+----------+---------+--------------+------------------+----------------------------------------+ ``` -------------------------------- ### Clockify CLI Config List Command Options Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_config_list Available options for the 'clockify-cli config list' command. This includes flags for specifying the output format (YAML or JSON) and a help flag. ```bash -f, --format string { yaml | json } output format (default "yaml") -h, --help help for list ``` -------------------------------- ### List Clockify CLI Configuration Parameters Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_config_list This command lists all user-defined configuration parameters for the Clockify CLI. It shows settings such as token, user ID, workspace, and various behavioral flags. The output can be formatted as YAML or JSON. ```bash clockify-cli config list [flags] ``` -------------------------------- ### Add Clockify Task via CLI Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_task_quick-add This snippet demonstrates how to add a new task to a Clockify project using the command-line interface. It requires the task name and the project identifier. Optional flags can be used for different output formats (CSV, JSON, quiet) and to specify the project. ```bash clockify-cli task quick-add ... [flags] # Example: Add a task named 'Very Important' to project 'special' clockify-cli task quick-add -p special "Very Important" # Example: Add a task and only display its ID clockify-cli task quick-add -p special "Very Cool" -q # Example: Add multiple tasks and output as CSV clockify-cli task quick-add -p special Billable "Not Billable" --csv ``` -------------------------------- ### Show Time Entry Information (CLI) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_show This command displays information about a Clockify time entry. It can show the currently running entry if no ID is provided, or a specific entry using its ID, 'last', or relative references like '^2' for the second to last entry. Various flags allow for customized output formats such as CSV, JSON, Markdown, or plain text durations. ```shell clockify-cli show [ | current | last | ^n ] [flags] # Examples: # Show running time entry (if none exists): $ clockify-cli show # Output: looking for running time entry: time entry was not found # Show the last ended time entry (quiet mode - only ID): $ clockify-cli show last -q # Output: 62af70d849445270d7c09fbd # Show the time entry before the last one (quiet mode - only ID): $ clockify-cli show ^2 -q # Output: 62af668b49445270d7c092e4 # Show time entry with specific format: $ clockify-cli show -f "{{.Description}}" # Show time entry in JSON format: $ clockify-cli show -j # Show time entry in CSV format: $ clockify-cli show -v # Show time entry in Markdown format: $ clockify-cli show -m # Show duration as a float hour: $ clockify-cli show -F # Show duration formatted: $ clockify-cli show -D # Specify timezone: $ clockify-cli show --tz UTC ``` -------------------------------- ### Project Edit Command Options Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_project_edit Lists the available flags for the `clockify-cli project edit` command, detailing options for managing project status (active, archived, billable, private, public), clients, names, colors, notes, and output formatting. ```bash -a, --active set the projects as active -A, --archived set projects as archived -b, --billable set the projects as billable --client string the id/name of the client the projects will go under -c, --color string color of the projects -v, --csv print as CSV -f, --format string golang text/template format to be applied on each Project -h, --help help for edit -j, --json print as JSON -n, --name string name of the project --no-client set projects as not having clients -B, --not-billable set the projects as not billable -N, --note string note for the projects -P, --private set the projects as private -p, --public set projects as public -q, --quiet only display ids ``` -------------------------------- ### Display User Details (Shell) Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_me Shows details about the user who owns the token used by the CLI. This command displays the user's ID, Name, Email, Status, and Timezone. It supports various flags for output customization. ```shell clockify-cli me [flags] ``` -------------------------------- ### Stop Running Timer with Specific End Time using Clockify CLI Source: https://clockify-cli.netlify.app/en/usage This command stops a running timer and sets its end time to a specific value using the `--when` flag. This is useful if you forgot to stop the timer manually and want to specify the exact end time. ```bash clockify-cli out --when 23:35 ``` -------------------------------- ### Clockify CLI Clone Command Usage Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_clone This snippet demonstrates the basic syntax for the clockify-cli clone command. It shows how to specify the time entry ID or use relative identifiers like 'last' or '^n' to clone an entry. It also indicates that flags can be appended for further customization. ```bash clockify-cli clone { | last| ^ } [flags] ``` -------------------------------- ### Edit multiple time entries to use a different task Source: https://clockify-cli.netlify.app/en/commands/clockify-cli_edit-multiple This example demonstrates how to edit multiple time entries to use a new task. It specifies that interactive mode should be disabled (`-i=0`), uses a format string `F` for displaying entry details, targets 'current', 'last', and a previous entry (`^2`), and sets the new task to 'multiple'. The output shows the updated time entries with the new task assigned. ```bash # just to help show the data $ export F="{{.ID}} :: {{ .Description }} When: {{ fdt .TimeInterval.Start }} util {{ ft (.TimeInterval.End | now) }} Task: {{ .Task.Name }} ({{ .Project.Name}}) Tags: {{ .Tags }} " $ clockify-cli report --format "$F" 62af667c4ebb4f143c9482bb :: Edit multiple entries When: 2022-06-19 18:10:01 util 18:10:15 Task: Edit Command (Clockify Cli) Tags: [Development (62ae28b72518aa18da2acb49)] 62af668b49445270d7c092e4 :: Adding examples When: 2022-06-19 18:10:15 util 18:29:32 Task: Edit Command (Clockify Cli) Tags: [Development (62ae28b72518aa18da2acb49)] 62af6b0f4ebb4f143c94880e :: More examples When: 2022-06-19 18:29:32 util 18:38:12 Task: Edit Command (Clockify Cli) Tags: [Development (62ae28b72518aa18da2acb49)] # change all to use other task $ clockify-cli edit-multiple -i=0 -f "$F" current last ^2 --task multiple 62af6b0f4ebb4f143c94880e :: More examples When: 2022-06-19 18:29:32 util 18:43:04 Task: Edit Multiple Command (Clockify Cli) Tags: [Development (62ae28b72518aa18da2acb49)] 62af668b49445270d7c092e4 :: Adding examples When: 2022-06-19 18:10:15 util 18:29:32 Task: Edit Multiple Command (Clockify Cli) Tags: [Development (62ae28b72518aa18da2acb49)] 62af668b49445270d7c092e4 :: Adding examples When: 2022-06-19 18:10:15 util 18:29:32 Task: Edit Multiple Command (Clockify Cli) Tags: [Development (62ae28b72518aa18da2acb49)] ```