1.0.0-beta.4 • Published 3 years ago

@studiometa/cli-timer v1.0.0-beta.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

CLI Timer

A simple CLI tool to track your time when working on Jira issues, synchronized with Tempo.

Installation

Install it globally with NPM:

$ npm install -g @studiometa/cli-timer

The package is currently private, you will need an NPM token to be able to install it. Ask Titouan to generate one for you and add it to your .zshrc file: export NPM_TOKEN='...'.

Then configure the CLI with the config command:

# With the prompt
$ timer config

# Without the prompt
$ timer config \
  --username '<JIRA_USERNAME>' \
  --token '<JIRA_TOKEN>' \
  --org '<JIRA_ORG>' \
  --account-id '<JIRA_ACCOUNT_ID>' \
  --tempo-token '<TEMPO_TOKEN>' \
  --no-prompt

To configure the CLI, you will need the following informations:

  • You Jira username, usually your email address
  • Your Jira organization name, ORG_NAME in https://ORG_NAME.atlassian.net
  • A Jira API token, create one at https://id.atlassian.com/manage-profile/security/api-tokens
  • Your Jira account ID, find it when accessing your profile in Jira: https://ORG_NAME.atlassian.net/jira/people/ACCOUNT_ID
  • A Tempo API token, create one at https://ORG_NAME.atlassian.net/plugins/servlet/ac/io.tempo.jira/tempo-app#!/configuration/api-integration

Usage

# Start a timer
$ timer start DESK-1234 --message 'Working on something'
# or
$ timer start DESK-1234 -m 'Working on something'

# Check on a timer status
$ timer check
[DESK-1234] Working on something (2 minutes)

# Stop a timer and synchronize it in Tempo
$ timer stop --sync
# or
$ timer stop -s

# Display worklogs for yesterday
$ timer log yesterday

# Display worklogs for a given week
$ timer log Sep7-11

# Display help
$ timer --help

Display the current timer in your macOS menu bar

You can install Bitbar and create a custom plugin to trigger the timer check command and display your current timer in your menu bar.