kevinpapst / kimai2-console

Console application for Kimai remote access - time-tracking via bash
https://www.kimai.org/store/console-phar.html
MIT License
11 stars 1 forks source link
kimai kimai-bundle kimai-client kimai-plugin kimai-timetracking kimai2 phar symfony-console

Kimai - Remote Console

A PHP application to access your Kimai 2 installation via its API (http).

Requirements

Installation

To install the Kimai console tools, execute the following commands:

curl -LO https://github.com/kevinpapst/kimai2-console/releases/latest/download/kimai.phar
curl -LO https://github.com/kevinpapst/kimai2-console/releases/latest/download/kimai.phar.sha1
sha1sum --check kimai.phar.sha1
rm kimai.phar.sha1
chmod +x kimai.phar
mv kimai.phar /usr/local/bin/kimai

Configuration file

Before using it the first time, you have to create a configuration file, which holds the connection infos for Kimai. By default this config file will be located at ~/.kimai2-console.json:

kimai configuration

Make sure the file is only readable for your own user:

chmod 600 ~/.kimai2-console.json

That's it, you can use Kimai from the command line now.

By default, the configuration file targets the demo installation and will work... but now it's time to target your own Kimai, so please edit the config file and change the settings:

FAQ:

Available commands

You get a list of all available commands with kimai.

To get help for a dedicated command use the --help switch, eg: kimai project:list --help

Start a timesheet

This command tries to detect customer, project and activity from your input in the following way:

This most simple example will display a select list for all customers, then a filtered list for the projects of the chosen customer and finally a select list for all activities for the chosen project:

bin/kimai start

Example to start a new timesheet by search terms only, adding a description and some tags:

bin/kimai start --customer Schowalter --project analyzer --activity iterate --description "working for fun" --tags "test, bla foo, tagging"

 [OK] Started timesheet                                                                                                 

 ------------- ------------------------------------ 
  ID            5085                                
  Begin         2020-01-03T23:34:26+0100            
  Description   working for fun                     
  Tags          bla foo                             
                test                                
                tagging                             
  Customer      Schowalter PLC                      
  Project       Grass-roots system-worthy analyzer  
  Activity      iterate viral infomediaries         
 ------------- ------------------------------------ 

Output format

The :listing commands display a formatted table of all found entities.

If you want to use the output in a script, instead of manually looking at them, please use the --csv switch.

Environment variables

The following environment variables are supported:

FAQ

Updating the Console tools

Redo the initial installation process and overwrite the file /usr/local/bin/kimai with the latest release.

Check the contents of the PHAR

There are several ways to see the contents of the PHAR, here are some:

phar extract -f kimai.phar
box info kimai.phar -l

The PHAR contents are GZ compressed and verified with a SHA512 signature by the PHAR interpreter.

Build from source

You need to have PHP cli installed with all required dependencies. The dependencies might differ from than the ones required for running the tools. Then install the humbug/box project, according to their installation docs.

Now compiling the PHAR is as simple as calling:

box compile

Release on GitHub