• Stars
    star
    420
  • Rank 102,566 (Top 3 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 10 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command-line tool to track project hours

clocker

track project hours

clocker

example

To start tracking hours, just do clocker start:

$ clocker start -t BAZCORP

The -t is optional.

Some hours pass, then:

$ clocker stop

Run clocker start and clocker stop as you have more hours to track.

You can list the hours you've racked up with clocker list:

$ clocker list
1392707136  2014-02-17  [ 23:05:36 - 02:15:00 ]  (03:09:24)  [BAZCORP]
1392751800  2014-02-18  [ 11:30:00 - 16:20:00 ]  (04:50:00)  [BAZCORP]
1393020600  2014-02-21  [ 14:10:00 - 18:32:00 ]  (04:22:00)  [BAZCORP]

You can see a report of all logged hours of a specific day with clocker report command:

$ clocker report --day 2018-05-23
Report for 23 May 2018:
1527053106  2018-05-23  [ 07:25:06 - 08:09:25 ]  (00:44:19)  [TYPE_A]
1527056838  2018-05-23  [ 08:27:18 - 11:30:00 ]  (03:02:42)  [TYPE_B]
1527067800  2018-05-23  [ 11:30:00 - 11:58:18 ]  (00:28:18)  [TYPE_C]
1527073296  2018-05-23  [ 13:01:36 - 16:31:54 ]  (03:30:18)  [TYPE_B]

TYPE_A: 00:44:19
TYPE_B: 06:33:00
TYPE_C: 00:28:18

total: 07:45:37

Without the --day option, the report command will list all logged hours of the current day.

You can generate a json dump with clocker data:

$ clocker data BAZCORP --rate 125
[
  {
    "title": "consulting",
    "rate": 125,
    "hours": [
      {
        "date": "2014-02-18",
        "hours": 7.1
      },
      {
        "date": "2014-02-17",
        "hours": 0.9
      },
      {
        "date": "2014-02-21",
        "hours": 4.4
      }
    ]
  }
]

This json output can be fed into invoicer to generate a PDF invoice:

$ clocker data BAZCORP --rate 125 | invoicer -r BAZCORP -o invoice.pdf

usage

usage:

  clocker start {-t TYPE, -m MESSAGE} [-- DATA]
    Start the clock. Optionally give a TYPE and MESSAGE.
    Optionally set additional DATA in the format --KEY=VALUE.

  clocker stop {-m MESSAGE} [STAMP]
    Stop the clock.

  clocker restart [STAMP]
    Restart either last clock or clock at STAMP.

  clocker status
    Show the elapsed time if the clock is active or "stopped".

  clocker data {-t TYPE, -r RATE, --title TITLE, --gt DATE, --lt DATE, -a}
    Generate invoicer-compatible json output.
    Show dates between lt and gt. Show archived dates with -a.
    Optionally filter by TYPE, a string or /regex/.

  clocker list {-v, --gt DATE, --lt DATE, -a, -t TYPE}
    Show hourly data with STAMPS on the leftmost column.
    In verbose mode (-v), also show clocked messages.
    Show dates between lt and gt. Show archived dates with -a.
    Optionally filter by TYPE, a string or /regex/.

  clocker report {-v, --day DATE}
    Show all logged hours of a specific day.
    In verbose mode (-v), also show clocked messages.
    If no --day is set, the current day will be used.

  clocker csv {--gt DATE, --lt DATE, --props FIELDS, -a}
    Generate CSV output.
    Show dates between lt and gt. Show archived dates with -a.
    Additionally display the properties FIELDS.

  clocker add START END {-t TYPE, -m MESSAGE}
    Add a hours from START to END as date strings.

  clocker get STAMP
    Get the data at STAMP.

  clocker rm STAMP...
    Remove the data at STAMP.

  clocker set [STAMP] KEY VALUE
    Adjust time stamp boundaries or other properties of either last clock
    or clock at STAMP.
    Time stamp boundaries are parsed, like '20:11' or '10 minutes ago'.

  clocker edit STAMP {KEY}
    Launch $EDITOR to edit the record at STAMP.
    Optionally edit a single KEY.

  clocker move [STAMP] START
    Move the data at STAMP to the new START, maintaining the elapsed time.

  clocker archive {--lt=DATE, --gt=DATE}
  clocker archive [STAMP...]
    Archive a range of clocked records or a list of STAMPs.
 
  clocker unarchive {--lt=DATE, --gt=DATE}
  clocker unarchive [STAMP...]
    Un-archive a range of clocked records or a list of STAMPs.

install

With npm do:

npm install -g clocker

to get the clocker command.

license

MIT

More Repositories

1

xsd2json

Translate XML Schema into equivalent JSON Schema
Prolog
150
star
2

CHR.js

Compile and run Constraint Handling Rules (CHR) in JavaScript
JavaScript
103
star
3

magento2-matomo

Matomo Analytics Module for Magento 2
PHP
50
star
4

swivm

SWI-Prolog Version Manager - Bash script to manage multiple active SWI-Prolog versions
Shell
41
star
5

dgtchess

An event-driven JavaScript connector for electronic DGT chess boards
JavaScript
23
star
6

geospatial-demo

Example location-based app to demonstrate the power of MongoDB, node.js and Websockets
JavaScript
17
star
7

transportation

node.js module to display and manipulate public transport data
JavaScript
16
star
8

plammar

A Prolog grammar written in Prolog, for parsing and serialising Prolog code.
Prolog
12
star
9

tap

Write TAP tests with SWI-Prolog
Prolog
12
star
10

dcg4pt

Extend Definite Clause Grammars for Prolog by the corresponding parse tree
Prolog
9
star
11

feedback-to-gitlab

Server to generate GitLab issues for user feedback
JavaScript
9
star
12

timetraveller

Webservice to explore spatio-temporal data in an interactive way.
JavaScript
7
star
13

talks

A little collection of talks I gave
JavaScript
7
star
14

CHR.js-website

The code that runs http://chrjs.net
JavaScript
7
star
15

date_time

Logical arithmetic on dates and times in Prolog
Prolog
6
star
16

race

Prolog client for the SOAP interface of the Attempto Reasoner RACE
Prolog
6
star
17

CHR-Constraint-Server

A Persistent CHR Webserver
Prolog
5
star
18

CHR-Minesweeper

Simple Minesweeper application with Prolog and Constraint Handling Rules (CHR)
Prolog
5
star
19

dcg-visualiser

JavaScript
5
star
20

CHR-Linear-Equation-Solver

Linear Equation Solving using Constraint Handling Rules
Prolog
4
star
21

cli_table

Pretty unicode tables for the CLI with Prolog
Prolog
4
star
22

RKI-Data-Diff-lfs

Shell scripts to get a minimal set of SQL commands for persistent yet efficient storage of RKI data for COVID19
Shell
4
star
23

Thesis-Makefile

Curated Makefile with best practices, conventions, and tips for writing LaTeX theses.
Makefile
3
star
24

CHR-Benchmarks

Compare the execution runtimes of different implementations of Constraint Handling Rules (CHR)
C
3
star
25

babel-plugin-chr

Babel plugin that precompiles CHR.js source code
JavaScript
3
star
26

CTX

Chess Tournament Exchange Format
Shell
3
star
27

tablediff

Shell scripts to get a minimal set of SQL commands for table synchronisation.
Shell
2
star
28

alexa.pl

Alexa skill development with SWI-Prolog
Prolog
2
star
29

chess.json

JSON Schema for saving Chess Tournaments
JavaScript
2
star
30

xsd

Prolog
2
star
31

CHR-Constraint-Store

Incremental constraint store for Prolog's Constraint Handling Rules (CHR) module.
Prolog
1
star
32

zeitpunkt

Tools to work with GeoJSON LineStrings with given time components
JavaScript
1
star
33

fnogatz.github.io

Personal Website of Falco Nogatz
JavaScript
1
star
34

cli-cal

[DEPRECATED] Github-like calendar graph for the command line
JavaScript
1
star
35

tconsole

Render objects in the console
JavaScript
1
star
36

swtparser.js

Parse SWT Swiss-Chess Tournament files with JavaScript
JavaScript
1
star
37

SWT-structure-files

Structure files for SWT Swiss Chess Tournament files
1
star
38

quickchess

OCR for chess game notations
TypeScript
1
star
39

uniwue-lernplaetze-scraper

Save the occupancy rates of working spaces in the libraries of the University of Würzburg, Germany.
JavaScript
1
star