• Stars
    star
    331
  • Rank 127,323 (Top 3 %)
  • Language
    Rust
  • Created about 6 years ago
  • Updated about 3 years ago

Reviews

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

Repository Details

Minimalist command line tool you can use to track and examine your habits.

habitctl

habitctl is a minimalist command line tool you can use to track and examine your habits. It was born when I grew frustrated with tracking my habits in plain text files using hand-drawn ASCII tables. habitctl tries to get the job done and then get out of your way.

Installation

habitctl is written in the Rust programming language, so you'll need a working, up-to-date Rust installation. You'll probably want to run these commands:

$ curl -f https://sh.rustup.rs > rust.sh
$ sh rust.sh
$ source ~/.cargo/env

Then, compiling habitctl is as easy as this:

$ git clone https://github.com/blinry/habitctl
$ cd habitctl
$ cargo build --release

This will create the binary target/release/habitctl, which you can add to your $PATH. Additionally, I like to set up an alias called h.

Usage

When you run habitctl for the first time, it will set up the required files:

$ h
Welcome to habitctl!

Created /home/seb/.habitctl/habits. This file will list your currently tracked habits.
Created /home/seb/.habitctl/log. This file will contain your habit log.

You don't have any habits set up!
Run `habitctl edith` to modify the habit list using your default $EDITOR.
Then, run `habitctl`! Happy tracking!

Run h edith and change the content of the habits file, for example like this:

# The numbers specifies how often you want to do a habit:
# 1 means daily, 7 means weekly, 0 means you're just tracking the habit. Some examples:

1 Meditated
7 Cleaned the apartment
0 Had a headache
1 Used habitctl

Here are some more ideas of what to track:

  • got up at a certain time
  • used a spaced repetition software like Anki
  • took a multivitamin
  • cleared my email inbox
  • answered to all texts
  • visited and read all Slack workspaces
  • practiced a language
  • self reflection/used a diary
  • autogenic training
  • published something on my blog/homepage
  • worked on a project
  • did the dishes
  • tidied the apartment
  • closed all browser tabs
  • tracked caloric intake
  • happy
  • flow
  • relaxed
  • coffee intake
  • left my comfort zone
  • thanked someone

Then, simply run h regularly, specify whether or not you did the habit (or needed to skip the habit for some reason - eg. could not clean apartment because you were away for week), and get pretty graphs!

$ h
2018-09-15+02:00:
                Meditated โ”       โ” โ”  โ”โ”         โ”    โ”   โ” โ”   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”   โ” โ”   โ”[y/n/s/โŽ] y
    Cleaned the apartment โ”โ”€โ”€โ”€โ”€โ”€โ”€                 โ”โ”€โ”€โ”€โ”€โ”€โ”€           โ”โ”€โ”€โ”€โ”€โ”€โ”€    โ€ขยทยทยทยทยทยท[y/n/s/โŽ] n
           Had a headache             โ”  โ”     โ”โ”                  โ”โ”   โ”   โ”โ”        [y/n/s/โŽ] n
            Used habitctl    โ” โ”โ”โ” โ”  โ”โ”โ”   โ” โ” โ”       โ” โ” โ”  โ” โ” โ”โ” โ” โ” โ”โ”โ”โ”   โ”    [y/n/s/โŽ] y
2018-09-16+02:00:
                Meditated        โ” โ”  โ”โ”         โ”    โ”   โ” โ”   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”   โ” โ”   โ” [y/n/s/โŽ] y
    Cleaned the apartment โ”€โ”€โ”€โ”€โ”€โ”€                 โ”โ”€โ”€โ”€โ”€โ”€โ”€           โ”โ”€โ”€โ”€โ”€โ”€โ”€    โ€ขยทยทยทยทยทยท [y/n/s/โŽ] n
           Had a headache            โ”  โ”     โ”โ”                  โ”โ”   โ”   โ”โ”         [y/n/s/โŽ] n
            Used habitctl   โ” โ”โ”โ” โ”  โ”โ”โ”   โ” โ” โ”       โ” โ” โ”  โ” โ” โ”โ” โ” โ” โ”โ”โ”โ”   โ”    โ”[y/n/s/โŽ] y

(Some weeks later)

$ h log
                          โ–„โ–ƒโ–ƒโ–„โ–„โ–ƒโ–„โ–†โ–†โ–†โ–…โ–†โ–†โ–‡โ–†โ–„โ–ƒโ–„โ–†โ–ƒโ–†โ–ƒโ–†โ–‚โ–…โ–„โ–ƒโ–„โ–…โ–†โ–…โ–ƒโ–ƒโ–ƒโ–†โ–‚โ–„โ–…โ–„โ–…โ–…โ–…โ–†โ–„โ–„โ–†โ–‡โ–†โ–…โ–…โ–„โ–ƒโ–…โ–†โ–„โ–†โ–ƒโ–ƒโ–‚โ–…โ–†
                Meditated โ”       โ” โ”  โ”โ”         โ”    โ”   โ” โ”   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”   โ” โ”   โ”โ”
    Cleaned the apartment โ”โ”€โ”€โ”€โ”€โ”€โ”€                 โ”โ”€โ”€โ”€โ”€โ”€โ”€           โ”โ”€โ”€โ”€โ”€โ”€โ”€    โ€ขยทยทยทยทยทยท        
           Had a headache             โ”  โ”     โ”โ”                  โ”โ”   โ”   โ”โ”         
            Used habitctl    โ” โ”โ”โ” โ”  โ”โ”โ”   โ” โ” โ”       โ” โ” โ”  โ” โ” โ”โ” โ” โ” โ”โ”โ”โ”   โ”    โ”

                                         ... some habits omitted ...

Yesterday's score: 73.3%

The score specifies how many of the due habits you did that day and removes any you may have skipped from the calculation. The sparkline at the top give a graphical representation of the score. The thick lines in the graph say that you did the habit, the thin lines say that that it was okay that you didn't to it. A thick dot implies you had to skip or were unable to exercise a habit for whatever good reason, and a thin dot indicates the period for which a skip would normally be in effect (in the example above, we are suggesting you could not clean your apartment because you were on a business trip when you'd normally clean it and can thus excuse yourself.).

Also, on the day, if a habit chain is in danger of breaking because it's the last day you can do it before the consistency graph would have a gap in it, habitctl will give you a warning by turning the " " symbol you'd see on the day into an "!".

Enter h help if you're lost:

$ h help
USAGE:
    habitctl [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    ask      Ask for status of all habits for a day
    edit     Edit habit log file
    edith    Edit list of current habits
    help     Prints this message or the help of the given subcommand(s)
    log      Print habit log
    todo     Print unresolved tasks for today

License: GPLv2+

habitctl is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

More Repositories

1

gish

Open Source version of the award-winning physics platformer
C
310
star
2

sliderland

A (very) minimalist creative coding playground. Make animations using only 64 HTML sliders!
JavaScript
187
star
3

legit

An esoteric programming language where programs are defined by the graph of commits in a Git repository.
Ruby
138
star
4

wikidata-cardgame

Use Wikidata to generate fact cards on arbitrary topics!
JavaScript
64
star
5

nom

"Lose weight and hair through stress and poor nutrition"
Ruby
58
star
6

linux-puzzles

Linux puzzles (in your browser!)
JavaScript
39
star
7

nutsh

A framework for creating interactive command line tutorials, inspired by text adventures.
Go
31
star
8

vimboy

A dead simple personal wiki plugin for Vim
Vim Script
29
star
9

almightree

A jQuery plugin which makes large nested lists easier to navigate
JavaScript
21
star
10

wikidata-guessr

Guess the locations of random Wikidata items.
JavaScript
20
star
11

everything-exhibition

JavaScript
17
star
12

git-hydra

A tool that visualizes the internal structure of a Git repository in real-time. With snakes!
C++
17
star
13

json-explorer

Tiny browser for JSON APIs, especially ActivityPub
Svelte
15
star
14

dotfiles

My public Linux configuration files. See .README.md for setup instructions.
Shell
14
star
15

roboboy

A personal wiki for Android with Git synchronization
Java
14
star
16

glitchgallery

An online exhibition of pretty software bugs. Open for your submissions!
JavaScript
12
star
17

nelder-mead-optimizer

An easy-to-use Nelder-Mead optimizer for n-Vectors
C++
12
star
18

blinry.org

JavaScript
11
star
19

soft-drink-recipes

A collection of DIY soft drink recipes.
10
star
20

sillypond

Generates unplayable music in the style of John Stump's "Faerieโ€™s Aire and Death Waltz".
Ruby
9
star
21

passivity-pub

Beginnings of a very lazy ActivityPub implementation
JavaScript
9
star
22

show-alt-text-userscript

A browser userscript that displays the alt text of images.
JavaScript
8
star
23

letterplotter

Generate map drawing from an address, for plotting on an envelope.
JavaScript
8
star
24

anki-fonts

Anki deck which will teach you to identify popular typefaces
Ruby
8
star
25

shader-workshop

An intro to GLSL
GLSL
8
star
26

advent-of-code-2019

My solutions for Advent of Code 2019. In Haskell! :O
Haskell
6
star
27

circus

Visualization tool for circle packing algorithms
CoffeeScript
6
star
28

cat-trees

Generative cat tree generator, using wave function collapse
JavaScript
5
star
29

mousetoy

Games with multiple mouse pointers
C
5
star
30

wurst-day-ever

2D puzzle game about repairing sausages
GDScript
5
star
31

anki-german-sign-language

Ruby
5
star
32

legit-brainfuck

4
star
33

compass-in-the-sky

A Game of Solar orientation
Svelte
4
star
34

clickbait

An action game where you need to close all popups. Made for GMTK Game Jam 2020.
GDScript
4
star
35

fake-java-println

Drop this into your coworkers Java project tomorrow
Java
3
star
36

1room

Lua
3
star
37

boids

GDScript
3
star
38

vimboy.nvim

A very simple personal wiki plugin โ€“ Lua version
Lua
3
star
39

map-of-rc

Map of the Recurse Center
Ruby
2
star
40

ten-little-letters

Compo entry for Ludum Dare 39
Lua
2
star
41

cg2

Lรถsungen der Aufgaben von โ€žEchtzeit-Computergrafikโ€œ der TU BS
C++
2
star
42

compass-belt-hardware

2
star
43

pomodoro-jukebox

Svelte
2
star
44

bachelor-thesis

"The Nut Shell โ€“ A Framework for Creating Interactive Command Line Tutorials"
TeX
2
star
45

x86-tests

Assembly
2
star
46

small-world

An explorable explanation about everything that's going on on Earth.
Svelte
1
star
47

operation-mindfuck-3

JavaScript
1
star
48

legit-hello

1
star
49

card10-north-sense

Python
1
star
50

gofuck

Converts Go games (in SGF format) to Brainfuck
Ruby
1
star
51

nessie

Barely working recursive DNS server written in Ruby. Made for the Recurse Center's "Domain Name Saturday"!
Ruby
1
star
52

stop-tree

Haskell
1
star
53

esolangs

Seminar paper about esoteric programming languages
TeX
1
star
54

pixelator

Shell
1
star
55

map.recurse.com

Web interface for the Map of RC
JavaScript
1
star
56

compass-belt-app

Java
1
star
57

time-barons

Shell
1
star
58

counter-ring

A 3D-printed, customizable counter ring.
OpenSCAD
1
star
59

tracery-bots

Tracery grammars of some bots I'm maintaining.
1
star
60

legit-quine

A quine for the legit programming language, written by LegionMammal978
1
star
61

nutsh-vorkurs

1
star
62

webboy

Compile a plaintext wiki to HTML
Ruby
1
star
63

operation-mindfuck-4

JavaScript
1
star
64

operation-mindfuck-5

JavaScript
1
star
65

rc3-wikipaka-clock

Lua
1
star
66

bloody

"A Bloody Small World" โ€“ a game for Ludum Dare 38
Lua
1
star
67

compass-belt-firmware

Python
1
star
68

tour.recurse.com

A virtual photo tour of the Recurse Center
JavaScript
1
star
69

minitools

Miniature tools for working with x86 assembly and ELF files
Rust
1
star
70

hungry-spider

GDScript
1
star
71

glitchgallery-3d

A prototype for an explorable 3D museum, showcasing images from the Glitch Gallery.
GDScript
1
star
72

recipes-demo

Repo for testing Git workflow and pull requests
1
star
73

etherwiki

Real-time coediting wiki etherpad thing
Svelte
1
star
74

one-two-many

Svelte
1
star
75

shadow-yoga-instructor

A game about twisting your body, so that your shadow looks like letters. Bring your friends!
JavaScript
1
star