Code Monkey home page Code Monkey logo

timetagger_cli's Introduction

CI

timetagger_cli

Track your time from the command-line

Introduction

This is a command line interface (CLI) that connects to a TimeTagger server. This can be the server at https://timetagger.app, or a self-hosted server.

The idea is to provide a quick way to track time for devs who are already using a terminal.

Installation

The TimeTagger CLI requires Python 3.6 or higher. Install with pip:

$ pip install timetagger_cli

After installation, you should be able to use the timetaggercommand.

Start by running timetagger setup to setup the API's url and authentication token.

Docs

Run timetagger without arguments to get the list of available subcommands:

$ timetagger
usage: timetagger command [arguments]

Track your time from the command-line, a CLI for https://timetagger.app.

Available commands:

    version
        Print version.
    help
        Show this help message and exit.
    app
        Open the TimeTagger app in your default browser.
    setup
        Edit the API URL and token by opening the config file in your default editor.
    status
        Get an overview of today and this week. The exact content may change.
    start DESCRIPTION
        Start timer with the given description. Use '#' to create tags.
    stop
        Stop any running timers.

Example

$ timetagger status
Hours clocked this week: 11:42
Hours clocked today: 7:00
Running: 0:01 - #timeapp #oss more cli

Todays records:
          Started           Stopped  Duration  Description
 2021-03-23 09:05             09:42      0:37  #oss #vispy prep
 2021-03-23 09:42             12:12      2:30  #timeapp #oss cli
 2021-03-23 13:06             14:00      0:53  #timeapp #oss cli
 2021-03-23 14:00             14:58      0:58  #oss #vispy #meeting
 2021-03-23 15:23             15:23      0:00  HIDDEN #oss #vispy #meeting
 2021-03-23 15:24             17:13      1:49  #timeapp #oss cli
 2021-03-23 17:13                 -      0:12  #timeapp #oss more cli

License

MIT

Developers

Additional developer dependencies:

pip install invoke black flake8 pytest
  • invoke -l to see available invoke tasks
  • invoke clean to remove temporary files
  • invoke format to autoformat the code (using black)
  • invoke lint to detect linting errors (using flake8)
  • invoke tests to run tests (using pytest)

timetagger_cli's People

Contributors

almarklein avatar edgardleal avatar kwillno avatar mythicaleinhorn avatar slarrain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

timetagger_cli's Issues

Offline mode

Sorry if this question is misplaced here.

Among Timetagger's features, it lists:

TimeTagger gives you the same smooth time-tracking experience on any device, no matter the screen size. It can be used off-line, and your data gets automatically synced.

I assume this refers to the web-client which operates from cache / browser local storage and just syncs with the server once a connection is re-established, right?

The CLI does not support any way of storing time tracking locally when offline, and syncing it back with the server at a later point, or does it?

Avoid create dupilcates for same title

When using scripts like this on ~/.bashrc or ~/.zshrc, I end up with lots of entries with the same title if navigate through different folders.

function cd()
{
    builtin cd "$@"
    [ -f "./.init" ] && source ".init" 
    ls -l ./
    if [ -f package.json ]; then
      local name=$(awk '/name/{print $2}' package.json | sed 's/"\(.*\)",\+/\1/')
      timetagger start "#coding #${name}" 
    fi
}

timetagger setup error on WSL

Hi,
I recently installed your awesome Time Tagger App on my Synology NAS via Docker, following your post on Reddit.
It's working great via the web UI, but I spend most of my time on the terminal, so I installed the awesome timetagger_cli companion app.

However, when I run timetagger setup on Ubuntu on WSL, I get the following error:

Config file: /home/santiago/.config/timetagger_cli/config.txt
Will now (try to) open the config file. Just edit and safe the file.
Traceback (most recent call last):
  File "/home/santiago/.local/bin/timetagger", line 8, in <module>
    sys.exit(main())
  File "/home/santiago/.local/lib/python3.8/site-packages/timetagger_cli/__main__.py", line 78, in main
    func(*argv[1:])
  File "/home/santiago/.local/lib/python3.8/site-packages/timetagger_cli/core.py", line 82, in setup
    open_with_os_default(filename)
  File "/home/santiago/.local/lib/python3.8/site-packages/timetagger_cli/utils.py", line 32, in open_with_os_default
    subprocess.call(("xdg-open", path))
  File "/usr/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'xdg-open'

I would probably do something like:

try:
    subprocess.call(("xdg-open", path))
except FileNotFoundError:
    subprocess.call(("vi", path))

On

subprocess.call(("xdg-open", path))
as a quickfix.

Resume task cmd

It'd be great I could resume the last task, or pick from recent items with a TUI.

Discard deleted records

Deleted records are in fact hidden. They are marked deleted by letting their description start with the word "HIDDEN". We should properly discard such records here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.