Code Monkey home page Code Monkey logo

openpomodoro-cli's Introduction

Open-Pomodoro CLI

A command-line Pomodoro tracker which uses the Open Pomodoro Format

Table of Contents

Installation

  1. Download the latest package for your platform from the Releases page.
  2. Untar the package with tar -zxvf openpomodoro-cli*.tar.gz.
  3. Move the extracted openpomodoro-cli file to a directory in your $PATH (for most systems, this will be /usr/local/bin/).

Or, if you have a Go development environment:

go get -u github.com/open-pomodoro/openpomodoro-cli/cmd/pomodoro

If you already have another command named pomodoro, use go get github.com/open-pomodoro/openpomodoro-cli to install the openpomodoro-cli command.

Usage

Start a Pomodoro

$ pomodoro start
25:00 ๐Ÿ…

# Start a Pomodoro in the past
$ pomodoro start --ago 10m
15:00 ๐Ÿ…

# Set the Pomodoro duration in minutes
$ pomodoro start --duration 30
30:00 ๐Ÿ…

# Set the Pomodoro duration in seconds
$ pomodoro start --duration 22m30s
22:30 ๐Ÿ…

# Provide a description and tags
$ pomodoro start "Blog post" -t writing,personal
25:00 ๐Ÿ…
Blog post
writing,personal

# Block until the Pomodoro finishes
$ pomodoro start --wait
25:00 ๐Ÿ…
24:99

Amend the current Pomodoro

$ pomodoro start "Blog postt" --tags writing,personal
25:00 ๐Ÿ…
Blog postt
writing,personal

# Pass any options accepted by start. Only passed options will be changed.
$ pomodoro amend "Blog post"
24:30 ๐Ÿ…
Blog post
writing,personal

Check the status of the current Pomodoro

$ pomodoro status
12:34 ๐Ÿ…

# When the Pomodoro has finished
$ pomodoro status
โ—๐Ÿ…

# Customize the status format
$ pomodoro status -f "%mr %c/%g ๐Ÿ…"
12 ๐Ÿ… 2/8

# Block until the Pomodoro finishes
$ pomodoro status --wait
12:34 ๐Ÿ…
12:33

See below for documentation on the status format string.

Clear a finished Pomodoro

$ pomodoro status
โ—๐Ÿ…
$ pomodoro clear
$ pomodoro status

Cancel an active Pomodoro

$ pomodoro status
12:34 ๐Ÿ…
$ pomodoro cancel
$ pomodoro status

Finish a Pomodoro early (or late)

$ pomodoro status
1:23 ๐Ÿ…
$ pomodoro finish
23:37
$ pomodoro status
โ—๏ธ๐Ÿ…

Take a break

$ pomodoro break
4:59

$ pomodoro break 15
14:59

Repeat the last Pomodoro

$ pomodoro repeat
25:00 ๐Ÿ…
Writing a blog post
writing,personal

# Block until the Pomodoro finishes
$ pomodoro repeat --wait
25:00 ๐Ÿ…
Writing a blog post
writing,personal
24:59

Show Pomodoro history

$ pomodoro history
2015-06-14T12:34:00-04:00 description="Blog post" duration=25 tags=writing,personal

# Output in JSON format
$ pomodoro history --output json
{
  "pomodoros": [
    {
      "start_time": "2015-06-14T12:34:56-04:00",
      "description": "Blog Post",
      "duration": 25,
      "tags": [
        "writing",
        "personal"
      ]
    }
  ]
}

# Output in iCal format
$ pomodoro history --output ical > ~/Pomodoros.ics

Tmux Color

tmux-color returns a color for the current Pomodoro status.

# Active Pomodoro
$ pomodoro tmux-color
colour2 # Green

# Finished Pomodoro
$ pomodoro tmux-color
colour1 # Red

Nothing is output if no Pomodoro is active.

Colors can be used within a Tmux configuration like so:

set -g status-left '#[bg=#(pomodoro tmux-color)]๐Ÿ…'

You can also define custom colors:

# Active Pomodoro
$ pomodoro tmux-color --active colour166 --done colour165
colour166 # Orange

# Finished Pomodoro
$ pomodoro tmux-color --active colour166 --done colour165
colour165 # Purple

Status Format

All commands which display the status of a single Pomodoro can take an additional --format / -f argument. This argument controls how to display the Pomodoro.

By default, it displays the time remaining (or an Emoji exclamation point if zero), an Emoji tomato, the description, and tags. Consecutive spaces and newlines are de-duplicated.

$ pomodoro status
12:34 ๐Ÿ… 
Writing a blog post
writing,personal

$ pomodoro status --format "%R โฑ %c/%g ๐Ÿ…\n%d"
13 โฑ 2/8 ๐Ÿ…
Writing a blog post

Available Parts

# Time
%r  - Time remaining in mm:ss
%R  - Time remaining in minutes, rounded
%!r - Same as %r, but with an exclamation point if the Pomodoro is done
%!R - Same as %R, but with an exclamation point if the Pomodoro is done
%l  - Length of the Pomodoro in mm:ss
%L  - Length of the Pomodoro in minutes

# Metadata
%d  - Pomodoro description
%t  - Pomodoro tags, joined by a comma

# Goals
%g  - Daily Pomodoro goal
%!g  - Daily Pomodoro goal, with a preceding slash
%c  - Completed Pomodoros today
%l  - Pomodoros remaining (left) to reach goal

Hooks

Hooks can be run when Pomodoros change state. There are 3 possible hooks:

  • break
  • start
  • stop

Commands which run hooks:

  • break: break immediately, stop when break is over
  • cancel: stop
  • clear: stop
  • finish: stop
  • repeat: start
  • start: start

To enable a hook, create an executable file in the hooks subdirectory within your configuration directory. For example:

#!/usr/bin/env bash
set -exo pipefail

say "Pomodoro started"
$ chmod +x ~/.pomodoro/hooks/start

openpomodoro-cli's People

Contributors

juergenhoetzel avatar justincampbell 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.