Giter Club home page Giter Club logo

moro's Introduction

Moro

Command line tool for tracking work hours, as simple as it can get.

Build Status Downloads Greenkeeper badge Sponsored All Contributors

Demo

alt tag

Screen recorded video tutorial

moro is really simple but you can watch this screen recording to see all the features Moro has: link in 15 minutes.

install

npm install -g moro

You need node version 4.8.0 or higher (we haven't tested lower versions)

update

npm update -g moro

How it works?

Short version:

When you start your work day, you run $: moro. And when you are leaving, you run moro again. And it tells you how many hours you have worked.

Long version:

The formula to calculate work hours is simple: (time the work ends) - (time the work starts) - (breaks) = work time, e.g. 17 - 9 - 1 = 7. However, it gets tricky when you don't remember when you came to work this morning. Or yesterday...

Moro saves the three parameters, start, en, break, for each day and at the end of the day tells you how many hours you have worked. All data is saved on your computer and doesn't leave it.

  1. when you come to work you say moro:
$: moro
your start of the day is set at 9:00
...
  1. When you are about to leave work you say moro once more, and you find out how long you have worked!
$ moro

Your end of the day registered as  17:15

 Today looks like this:

┌────────────────┬────────────────────────┐
│ Today          │ 7 Hours and 30 Minutes │
├────────────────┼────────────────────────┤
│ Start          │ 09:15                  │
├────────────────┼────────────────────────┤
│ End            │ 17:15                  │
├────────────────┼────────────────────────┤
│ Break duration │ 30 minutes             │
├────────────────┼────────────────────────┤
│ Date           │ 2017-03-08             │
└────────────────┴────────────────────────┘

moro subtracts 30 minutes for the lunch time by default.

That's it! You know you have worked 7 hours and 30 minutes!

What if you forgot to say moro when you start or finish your day?

If you forget to say moro in the morning, or when you're leaving, don't worry. You can do that later on the same day, but not tomorrow for example.

To specify the start and end of your workday afterward moro has two commands: hi and bye

hi is for setting the start of the day, check the format of time HH:mm

$ moro hi 10:45

bye is to set the end of your work day

$ moro bye 15:56

You can also use break to set the total minutes of break. The default is 30 minutes. So if you just have 30 minutes break on the day, don't touch this one.

# Imagine you notice you had 45 minutes of break instead of 30, do this to set it
$ moro break 45

to see all your registered hours:

$ moro report --all

Adding a note

You can add one or more notes to your workday.

$ moro note foo

They'll appear in reports. You can for example use them to devide your time between different tasks.

Clear data

To flush your data

$ moro clear --yes

Configuration

To change the Date format for a report use a pattern

# this will change the output to 'Fr, 2017-03-17'
moro.js config --format 'dd, YYYY-MM-DD'

For more possible formats see the Moment.js documentation

Setting work day duration and break time default

In Finland a full work day is 7.5 hours, which is the default in moro. To change it use this:

# for example to make it 6.5 hours
moro config --day 6.5

Also the default break time can be changed from 30 minutes

# to make default break 45 minutes
moro config --break 45

Backup the data

Moro uses a single database file to keep your data. Default location is in your home directory, and the file name is .moro-data.db. You can backup that file however you like.

Easy way to back up is to move the moro database file into your DropBox folder and then use the following command to tell moro to use that database file:

moro config --database-path /home/GraceHopper/Dropbox/moro-data.db

# This works on my linux machine :)

Why not do it by a one liner?

Well I hear you! My colleague, Henri, gave me this:

echo 'You have worked:' $(echo 'scale=2;(' $(date -d 'now' +%s) - $(date -d "$(journalctl -t systemd-logind -b | grep 'Lid opened' | tail -n1 | awk '{print $1, $2, $3}')" +%s) ')' / 3600 | bc) 'hours'

Contributing

Yes please! Open an issue, or make a pull request!

Code of conduct

Code is important but people are more important. If you like to contribute to moro please read and follow our code of conduct found in this file: CODE_OF_CONDUCT.md

To run tests

yarn run test

Automated run script

There's a shell script that runs all the features and you can see the results in terminal, to make sure things work.

./tests/automated-script.sh

what does moro mean?

Moro means hello in Finnish.

Supporters

I thank Futurice (link) my employer for sponsoring this project trough its Spice program

Supported by the Spice Program

Contributors

Thanks goes to these wonderful people (emoji key):


Omid Hezaveh

💬 🐛 💻 📖 👀 ⚠️

Mario

💻 📖 ⚠️

Karl Fleischmann

💻

Niloofar Motamed

📖

Wolf-Rost

📖

Henri Koski

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

moro's People

Contributors

fleischie avatar greenkeeper[bot] avatar heppu avatar mario-s avatar niloomotita avatar wolf-rost avatar

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.