All Projects → zenhob → Hcl

zenhob / Hcl

Licence: mit
Command-line tool for manipulating Harvest timesheets

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Hcl

Klog
A plain-text file format and command line tool for time tracking
Stars: ✭ 222 (+1.37%)
Mutual labels:  time-tracker, command-line
Notica
Send browser notifications from your terminal. No installation. No registration.
Stars: ✭ 215 (-1.83%)
Mutual labels:  command-line
Learn gnugrep ripgrep
Example based guide to mastering GNU grep and ripgrep
Stars: ✭ 204 (-6.85%)
Mutual labels:  command-line
Ronor
Sonos smart speaker controller API and command-line tools
Stars: ✭ 212 (-3.2%)
Mutual labels:  command-line
Facebook Dl
📼 Very minimal Facebook downloader written in 28 lines of Python code (not including comments and blank spaces)
Stars: ✭ 207 (-5.48%)
Mutual labels:  command-line
Nvidia Htop
A tool for enriching the output of nvidia-smi.
Stars: ✭ 213 (-2.74%)
Mutual labels:  command-line
Saldl
A lightweight well-featured CLI downloader optimized for speed and early preview.
Stars: ✭ 203 (-7.31%)
Mutual labels:  command-line
Kmdr Cli
🧠 The CLI tool for learning commands from your terminal
Stars: ✭ 218 (-0.46%)
Mutual labels:  command-line
Geek Life
The Todo List / Task Manager for Geeks in command line
Stars: ✭ 212 (-3.2%)
Mutual labels:  command-line
Mac
macOS Mojave v. 10.14 setup for developers.
Stars: ✭ 209 (-4.57%)
Mutual labels:  command-line
Node Cli Boilerplate
Boilerplate to kickstart creating a Node.js command-line tool
Stars: ✭ 209 (-4.57%)
Mutual labels:  command-line
Kube Linode
🐳 Provision a Kubernetes/CoreOS cluster on Linode
Stars: ✭ 207 (-5.48%)
Mutual labels:  command-line
Joal
An open source command line RatioMaster with an optional WebUI.
Stars: ✭ 213 (-2.74%)
Mutual labels:  command-line
Argparse4j
Java port of Python's famous argparse command-line argument parser.
Stars: ✭ 206 (-5.94%)
Mutual labels:  command-line
Bv
Quickly view satellite imagery, hyperspectral imagery, and machine learning image outputs directly in your iTerm2 terminal.
Stars: ✭ 215 (-1.83%)
Mutual labels:  command-line
Gpymusic
Google Py Music: A simple TUI client for Google Play Music
Stars: ✭ 204 (-6.85%)
Mutual labels:  command-line
Aws Sso Util
Smooth out the rough edges of AWS SSO (temporarily, until AWS makes it better).
Stars: ✭ 208 (-5.02%)
Mutual labels:  command-line
Dry Cli
General purpose Command Line Interface (CLI) framework for Ruby
Stars: ✭ 210 (-4.11%)
Mutual labels:  command-line
Pdd
📅 Tiny date, time diff calculator with piggybacked timers
Stars: ✭ 218 (-0.46%)
Mutual labels:  command-line
Webpack Command
[DEPRECATED] Lightweight, modular, and opinionated webpack CLI that provides a superior experience
Stars: ✭ 218 (-0.46%)
Mutual labels:  command-line

Harvest Command Line

HCl is a command-line tool for interacting with Harvest time sheets using the Harvest time tracking API.

View this documentation online.

Build Status Gem Version

GETTING STARTED

You can install hcl directly from rubygems.org:

gem install hcl

or you can install from source:

rake doc && rake install

Once installed, you can view this README as a man page:

gem man hcl

I recommend aliasing your man command to additionally load gem man pages:

alias man="gem man -ls"

SYNOPSIS

hcl [start] @<task_alias> [+<time>] [<message>]
hcl note <message>
hcl stop [<message>]
hcl resume [@<task_alias>]
hcl log @<task_alias> [+<time>] [<message>]
hcl show [<date>]
hcl tasks [<project_code>]
hcl alias <task_alias> <project_id> <task_id>
hcl unalias <task_alias>
hcl aliases
hcl (cancel | nvm | oops)
hcl config
hcl status

DESCRIPTION

Available Projects and Tasks

To start a new timer you need to identify the project and task. The tasks command displays a list of available tasks with their project and task IDs.

hcl tasks

You can also pass a project code (this is the short optional code associated with each project) to list only the tasks for that project.

Starting a Timer

Since it's not practical to enter two long numbers every time you want to identify a task, HCl supports task aliases:

hcl alias tacodev 1234 5678
hcl @tacodev Adding a new feature

Starting a Timer with Initial Time

You can also provide an initial time when starting a new timer. This can be expressed in floating-point or HH:MM. The following two commands are equivalent:

hcl @tacodev +0:15 Doing some stuff
hcl +.25 @tacodev Doing some stuff

Getting the Current Status

The show command can give you a live view of your current day including any running tasks, last note, and total time.

hcl show

Show can also be used with a variety of date formats. See Date Formats for more information

Adding Notes to a Running Task

While a task is running you can append lines to the task notes:

hcl note Then I did something else

Note that show only displays the last line of the timer notes. You can list all the notes for a running timer by issuing the note command without any arguments:

hcl note

Stopping a Timer

The following command will stop a running timer (currently only one timer at a time is supported). You can provide a message when stopping a timer as well:

hcl stop All done doing things

Toggling a Timer

Toggle the most recently stopped or running timer. Specify a task to toggle the last timer for that specific task:

hcl toggle
hcl toggle @xdev

Canceling a Timer

If you accidentally started a timer that you didn't mean to, you can cancel it:

hcl cancel

This will delete the running timer, or the last-updated timer if one isn't running. You can also use nvm or oops instead of cancel.

Logging without Starting a Timer

You can log time and notes without leaving a timer running. It takes the same arguments as start:

hcl log @xdev +1 Worked for an hour.

The above starts and immediately stops a one-hour timer with the given note.

ADVANCED USAGE

Bash Tab Completions

You can enable auto-completion of commands, project ids, task ids and task aliases by adding this to your shell configuration:

source $(ruby -e "print File.dirname(Gem.bin_path('hcl', 'hcl'))")/_hcl_completions

Configuration Profiles

You can modify your credentials with the --reauth option, and review them with hcl config. If you'd rather store multiple configurations at once, specify an alternate configuration directory in the environment as HCL_DIR. This can be used to interact with multiple harvest accounts at once.

Here is a shell alias myhcl with a separate configuration from the main hcl command, and another command to configure alias completion:

alias myhcl="env HCL_DIR=~/.myhcl hcl"
complete -F _hcl myhcl

Adding something like the above to your bashrc will enable a new command, myhcl. When using myhcl you can use different credentials and aliases, while hcl will continue to function with your original configuration.

Interactive Console

An interactive Ruby console is provided to allow you to use the fairly powerful Harvest API client built into HCl, since not all of its features are exposed via the command line. The current {HCl::App} instance is available as hcl.

It's also possible to issue HCl commands directly (except alias, see below), or to query specific JSON end points and have the results pretty-printed:

hcl console
hcl> show "yesterday"
# => prints yesterday's timesheet, note the quotes!
hcl> hcl.http.get('daily')
# => displays a pretty-printed version of the JSON output

Note that the HCl internals may change without notice. Also, commands (like alias) that are also reserved words in Ruby can't be issued directly (use send :alias instead).

Date Formats

Dates can be expressed in a variety of ways. See the Chronic documentation for more information about available date input formats. The following commands show the time sheet for the specified day:

hcl show yesterday
hcl show last friday
hcl show 2 days ago
hcl show 1 week ago

Harvest service status

Harvest provides a status API, which you can query using the hcl status command. This will tell you whether Harvest itself is up, along with a timestamp of when it was last tested.

AUTHOR

HCl was designed and implemented by Zack Hobson.

See LICENSE for copyright details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].