Giter VIP home page Giter VIP logo

kanban.bash's Introduction


commandline kanban #notetaking #todomanager #scriptable for teams AND personal CSV kanban for minimalist productivity hackers.

WHY? online issuetrackers are great for teams, but how to manage (personal) todo's on a crossrepo-, macro-, or micro-level? This is a very simple powerful tool to do that AND measure productivity. Just store the CSV-file(s) inside repos, clouddrives and local filesystems. #teamfriendly #symlinktheplanet #nestedkanbans

Install

$ curl -LO "https://raw.githubusercontent.com/coderofsalvation/kanban.bash/master/kanban"
$ chmod 755 kanban

Show me the kanban board!

$ ./kanban init
$ ./kanban add TODO PERSONAL "buy rose for girlfriend foo bar"
$ ./kanban show

NOTE: columns are configurable, and board resizes according to terminal width

Usage

$ ./kanban
Usage:

  kanban init                             # initialize kanban in current directory
  kanban add                              # add item interactive (adviced) 
  kanban show [status] ....               # show ascii kanban board [with status]
  kanban <id>                             # edit or update item 
  kanban <id> <status>                    # update status of todo id (uses $EDITOR as preferred editor)
  kanban <status> .....                   # list only todo items with this status(es)
  kanban list                             # list all todos (heavy)
  kanban tags                             # list all submitted tags
  kanban add <status> <tag> <description> # add item (use quoted strings for args)  
  kanban stats status [tag]
  kanban stats tag 
  kanban stats history 
  kanban csv                              # edit raw csv

  NOTE #1: statuses can be managed in ~/.kanban/.kanban.conf
  NOTE #2: the database csv can be found in ~/.kanban/.kanban.csv

Examples:

  kanban add TODO projectX "do foo"
  kanban TODO DOING HOLD                 
  kanban stats status projectX
  kanban stats tag projectX 
  watch NOCOLOR=1 kanban show
  # notekeeping by entering a filename as description:
  echo hello > note.txt && kanban add DOING note.txt
  # store in github repo
  git clone https://../foo.git && cd foo.git && kanban init && git add .kanban

Environment:

  X=120 kanban ....         # set max line-width to 120
  NOCOLOR=1 kanban ....     # disable colors
  PLAIN=1 kanban ...        # plaintext, disable utf8 chars

Change status

$ ./kanban show
.------.              .------.              .-------.
| TODO |_______       | HOLD |_______       | DOING |_______
|                     |                     |
| 1 foobar                                  | 3 ipsum
| 2 lorem                                   

$ ./kanban 2 DOING
TODO -> DOING

Edit item

NOTE: make sure you have your favorite editor set in ~/.bashrc (export EDITOR=vim e.g.)

$ ./kanban 2        # this executes ${EDITOR} 

Todo grep

$ ./kanban TODO DOING | grep projectfoo 

Nice to get project-specific kanban overviews.

Note-taking

adding a filename as a description, will trigger kanban to launch $EDITOR:

$ echo -e "hello\nworld" > my_idea.txt
$ kanban add TODO note my_idea.txt
$ kanban list
  id  status   tag        description
  -   -        -          -                                                                                                                                                                -
  4   TODO     note       my_idea.txt
$ k 4

TIP: use symlinks to share notes across boards (cd myproject && ln -s ~/.kanban/timelog.txt timelog.txt e.g.)

Simple listing of status

NOTE: from here we use the k-alias, see the 'Attention Unix ninjas' on how to use it

$ k TODO
id   status  tag   description                 history
-    -       -     -                           -
185  TODO    bly   fooo bar flop               BTBDHDHDHT
199  TODO    bly   meeting about techdesign    BT
245  TODO    lb    checkout testsuite          BT
246  TODO    nus   add field to db             BT
242  TODO    nus   fix db lag                  BT 

as you can see in the history, todo 185 is quite problematic. It went from Backlog->Todo->Backlog->Doing->Hold->... and so on. Obviously the person who assigned this todo should rethink it, and chop it up into seperate todos.

$ k TODO 2015-08
id   status  tag   description                 history
-    -       -     -                           -
246  TODO    nus   add field to db             BT
242  TODO    nus   fix db lag                  BT

Here you can see all todo's which were 'touched' in august 2015

Configuration

see ~/.kanban/.kanban.conf (gets created automatically) You can define the kanban statuses, and limit the maximum amount of todos per status.
See .kanban/kanban.conf in case you initialized a board in your current dir (using kanban init)

Idiotproof csv-editing

Safest way to keep the CSV sane:

$ ./kanban add
enter description:
> do laundry
enter one of statuses: BACKLOG TODO IN_PROGRESS HOLD DONE
> TODO
enter one of tags: projectA, projectB 
> projectA
$

Responsive kanban.

As mentioned earlier, the status/categorynames can be changed in .kanban/.kanban.conf. No widescreen? Show a tag-less, simplified kanban board by hiding some categories:

XSMALL=119                           # show simplified kanban for terminalwidth < 119 chars
SMALLSCREEN=('DOING' 'TODO' 'HOLD')  # define simplified kanban board statuses

Nested kanbans

$ kanban init
$ mkdir featureX           
$ kanban add TODO featureX 
$ cd featureX
$ kanban init
$ kanban add TODO foobar
$ cd ..
$ kanban show
 .____.
| TODO |_____
|
| 12 featureX

$ kanban 12                         # shows kanban inside featureX 
 .____.
| TODO |_____
|
| 1  foobar 

Or, how about centralized kanbans in your dotfiles repo + 1 in a projectrepo

$ cd ~                         # go to homedir (where your dotfiles live)
$ kanban init                  # creates ~/.kanban
$ cd projects/foo 
$ kanban init                 
$ mv .kanban ~/.kanban/foo    
$ ln -s ~/.kanban/foo .kanban  # link dotfiles-folder to here
$ cd ~
$ git add .kanban && git commit -m "dotfiles: updated kanbans"
$ cd projects/bar
$ kanban init
$ git add .kanban && git commit -m "added kanban to project repo"

Scriptable / Kanban Bot

kanban items are SCRIPTABLE using your favorite language. This allows dynamic statuses, tags & descriptions in the CSV-file:

"$(~/.kanban/bot status_day TODO '1 4')","script","database backup","T","2021-10-04@15:36"

this will call the following (executable) shellscript (~/.kanban/bot)

#!/bin/bash
status_day(){
  [[ "$2" =~ $(date +%u) ]] && printf $1 || printf BACKLOG
}

"$@"

Profit!
The database backup item will have status TODO on mondays & fridays, otherwise BACKLOG

TIP: use curl to generate dynamic descriptions, for example:

"$(curl https://api.github.com/repos/coderofsalvation/kanban.bash/issues | grep total_count | sed 's/[^0-9]//g') open issues"

Blinking text

Just wrap a word with stars (*iamblinking* e.g.) in your csv to catch more attention.

Attention UNIX ninjas

type 'k' instead of './kanban'

$ cp kanban ~/bin 
$ echo 'export PATH=$PATH:~/bin' >> ~/.bashrc
$ echo 'alias k=kanban'          >> ~/.bashrc
$ source ~/.bashrc

(now all terminals will recognize 'k' as a command)

Cleanup your kanban board with some bash-fu:

$ for i in {19,36,49}; do kanban $i BACKLOG; done
DONE -> BACKLOG
DONE -> BACKLOG
DONE -> BACKLOG

mass-renames:

$ sed -i 's/FOO/BAR/g' ~/.kanban.csv

Open a terminal on an extra monitor/screen/tmux:

$ NOCOLOR=1 watch kanban show

Run ninja-commands like: 'k 23 DONE' and withness the update:

$ k 34 DONE 
TODO -> DONE
$ k add TODO NINJW workout" "$(date --date='tomorrow' +'%Y-%m-%d') deadline"

Automatically display boards

Put the following in ~/.bashrc to display boards whenever you enter a directory with a kanban:

cd(){
  builtin cd ${1:+"$@"} && [[ -d ./.kanban ]] && kanban show
}

Statistics

With the power of grep you can get overviews:

$ k stats status

            DONE   155 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
         BACKLOG    73 ▆▆▆▆▆▆▆▆▆▆ 
            HOLD     9 ▆▆ 
            TODO     5 ▆ 
           DOING     5 ▆ 

$ k status 2015-08

            DONE   155 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
         BACKLOG    73 ▆▆▆▆▆▆▆▆▆▆ 
            HOLD     9 ▆▆ 
            TODO     5 ▆ 
           DOING     5 ▆ 

$ k stats status DONE 2015-08 

      projectfoo    62 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
      opensource    43 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
        projectX     3 ▆ 
           admin     2 ▆ 

$ k stats status projectfoo 

            DONE    56 ▆▆▆▆▆▆▆▆ 
         BACKLOG    33 ▆▆▆▆▆ 
            HOLD     6 ▆ 
            TODO     2 ▆ 
           DOING     1 ▆ 

Lets see what the slacking / project ratio is :)

$ k stats tag 2015-08

         slacking   76 ▆▆▆▆▆▆▆▆ 
         projecfoo  36 ▆▆▆▆ 

What are are typical tasktransitions:

$ k stats history
              T   129 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
        BTDHDHD    16 ▆▆▆ 
              T   129 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
             BD    16 ▆▆▆  ```


View which projects were put on hold at least 2 times in 2014:

```bash
$ k stats history HDHD 2014 

   project30     6 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
   project40     4 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
   project20     4 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 
   project10     3 ▆▆▆▆▆▆▆▆▆▆ 

Realtime Web-based kanban boards

Create the following index.html:

<!DOCTYPE html>
<pre id="log"></pre>
<script>
  // helper function: log message to screen
  function log(msg) { document.getElementById('log').textContent += msg + '\n'; }
  // setup websocket with callbacks
  var ws = new WebSocket('ws://localhost:8080/');
  ws.onopen = function() { console.log('CONNECT'); };
  ws.onclose = function() { console.log('DISCONNECT'); };
  ws.onmessage = function(event) { log(event.data); };
</script>

And then serve it to the web:

$ sudo apt-get install websocketd
$ X=120 NOCOLOR=1 PLAIN=1 websocketd -passenv 'X,NOCOLOR,PLAIN' -port 8080 -staticdir . ./kanban show
Mon, 04 Oct 2021 18:23:08 +0200 | INFO   | server     |  | Serving using application   : ./kanban show
Mon, 04 Oct 2021 18:23:08 +0200 | INFO   | server     |  | Serving static content from : .
Mon, 04 Oct 2021 18:23:08 +0200 | INFO   | server     |  | Starting WebSocket server   : ws://localhost:8080/

Now surf to http://localhost:8080 and PROFIT!

Tab completion

Somehow source kanban.completion in your ~/.bashrc or just copy it to /etc/bash_completion.d

Why

For developers, there's no such thing as the ultimate todo-utility

KANBAN.bash brings the lean and mean kanban board to the console. It uses csv as database backend, a very popular tabular format. The commandline usage is very minimal so few keystrokes can do magic.

Developer info

tests oneliners:

  • run: cd test; for test in test-*; do ./$test &>/dev/null; done && echo OK || echo ERROR
  • debug: cd test; for test in test-*; do bash -x $test; done && echo OK || echo ERROR

Todo

  • more testing
  • easier way of adding todos

kanban.bash's People

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kanban.bash's Issues

Bash 4 default conf file syntax error operand expected

Preconditions:

  • GNU bash, version 4.4.12
  • kanban.bash as of 90d0a93 2018-09-21
  • Debian GNU/Linux 9.6

Steps:

  1. Be sure you have no existing ~/.kanban.conf file before doing this test to see the error
  2. Get the latest kanban script ( 90d0a93 2018-09-21 ) for example following the official install instructions at https://github.com/coderofsalvation/kanban.bash
  3. ./kanban

Result:

/home/you/.kanban.conf: line 8: 'HOLD': syntax error: operand expected (error token is "'HOLD'")
Usage:
...

Expected:

Usage:
...
  • in other words show the usage, without showing that error

Related:

  • Issue #5 Error with the default conf file, but srkiNZ84 fixed by changing the configuration file to ... a lower case "-a" does not work for bash 4

Mishandling paths with spaces

When ./kanban init is run within a directory that has spaces in it's path the script does not properly handle path formatting.

anon@domain:~/USB STICK/kanban$ k init mkdir: cannot create directory ‘/home/user/USB/.kanban’: No such file or directory /home/user/bin/kanban: line 133: /home/user/USB/.kanban/.kanban.conf: No such file or directory touch: cannot touch '/home/user/USB/.kanban/.kanban.csv': No such file or directory tput: unknown terminfo capability 'normal'
It attempts to run on the path up to the space: /home/user/USB instead of the full path: /home/user/USB\ STICK/

Feature request: Import from Trello

Hey! I think that would be nice if this app will have possibility to import from trello. ATM trello has [ REST API so it wouldn't be that hard to implement that. It would help to save a time to someone who used trello and want now kanban in unix-way

Incorrect behavior when not using tags from the beginning

Okay, so I've just installed this tool and did the following:

  1. Created a couple of tasks without a tag.
  2. Created a task with a tag.

Expected behavior: Everything to be working correctly.

Real behavior: Those tasks that I initially created didn't have a tag field in a CSV file, while the tags I've created with a tag had it. As a result, kanban show returned the name of the tag as a description of the tasks with a tag.

Workaround: Simply adding a blank field in the tasks that I've initially created without using tags did the trick. Everything's working fine since then.

Error with the default conf file

getting /Users/sjmarshy/.kanban.conf: line 7: declare: -A: invalid option
after a fresh install on macOS Sierra 10.12.4 using zsh.

Terminal mode

When used in a normal terminal, kanban show uses ncurses commands to control the layout. But when used in a non-interactive terminal, this can have side effects.

An easy way to see this is to run:

$ watch kanban show

This will print spurious control characters: ^[H^[2J before the list and ^[?12l^[?25h after it. kanban show should attempt to detect the terminal mode to see whether or not to output layout control characters.

Using square brackets are not supported

The line sed -i "s|$item|$(cat $TMP.update | tail -n1)|g" $KANBANFILE does nothing if attempting to update $item with "[" and "]". I was bitten by this first time trying to update an item which accidentally had square brackets.

Multi-user/multi-system via a git repo

Would it be worth considering adding awareness of the data store files being in a git repo and do relevant pull, add commit and push actions when the state changes or add kanban push and kanban pull commands to handle updates, that would allow the tool to be used in teams or single dev on multiple machines.

Support .kanban folder in project repo

Add comments?

The kanban solutions I have used so far I often use the comments sections to document for instance progress. Have a comments section been discussed before? Would it be possible to include in a future release or are there any reasons not to do it?

First tag is not listed

I created a new entry with kanban add and write a new (first) tag. Then, when I list tag with kanban tags my tag doesn't appear. Then I write new entries and when list tags the first is hide.

Add labels as colours?

I don't know enough to implement it myself, but have a need and idea to be able to add labels to tasks and get them colour-coded to easier distinguish between different kind of tasks and/or projects on the board. For instance I would use:
red = blocked
yellow = deadline
other colours for different projects.

Issues with commas in description

If a description has a comma, it throws off the list function:

$ mv ~/.kanban.csv{,.orig} # optionally rename existing file to start fresh
$ ./kanban add BACKLOG petstore "pet Spot, Rex, and Fluffy"
$ ./kanban list
id  status   tag       description  history
-   -        -         -            -
2   BACKLOG  petstore  pet Spot      Rex
1   status   tag       description  history

Notice how " Rex" is under the history column

what does `kanban show status` do?

Hi!

thanks for creating and maintaining this awesome piece of software!
What does kanban show status do? Or what is it supposed to do? This is my experience:

[pur@lithium ~]$ kanban show 

┌──────┐              ┌──────┐              ┌───────┐             ┌──────┐              ┌───────┐             ┌─────────┐
│ TODO │_______       │ HOLD │_______       │ DOING │_______      │ DONE │_______       │ NOTES │_______      │ BACKLOG │_____
│                     │                     │                     │                     │                     │
│ 2   #linu encr                                                  │ 1   #test 1                               
│ 3   #test test                                                                                              

[pur@lithium ~]$ kanban show status 
/home/pur/.local/bin/kanban: line 256: cd: status: No such file or directory
[kanban] showing nested kanban 'status'

┌──────┐              ┌──────┐              ┌───────┐             ┌──────┐              ┌───────┐             ┌─────────┐
│ TODO │_______       │ HOLD │_______       │ DOING │_______      │ DONE │_______       │ NOTES │_______      │ BACKLOG │_____
│                     │                     │                     │                     │                     │
│ 2   #linu encr                                                  │ 1   #test 1                               
│ 3   #test test                                                                                              

[pur@lithium ~]$ 

Could this maybe be some code relating to old config?
Thanks!

Word wrap

Depending on the size of your terminal, some issue titles may be too long for a column on kanban show and are truncated. It would be nice if they could wrap to the next line instead.

tput: unknown terminfo capability 'normal'

tput: unknown terminfo capability 'normal'

Appears after every invocation.

$ uname -a
Linux m4ch1n4 5.4.38-gentoo #2 SMP Fri Jun 5 14:48:09 2020 x86_64 Intel(R) Core(TM) i5 CPU 660 @ 3.33GHz GenuineIntel GNU/Linux
$ env | grep term
TERM=xterm-256color

bug: not helpful when missing $EDITOR

STEPS:

  • Tried to "kanban 1" (editing of id 1) on a machine where $EDITOR was not set.

EXPECTED:

  • Some error message that is meaningful for missing variable

HAPPENS:

  • Some cryptic error message. I found out that this was missing by guesswork.

I understand that you pretty much best have that set anyways, but it would be helpful to add a better message. Show, init, etc. usually works (I have this "tput: unknown terminfo capability 'normal'" other error though, but everything seems to work with it).

SOLUTION:

  • Add EDITOR env var on your machines
  • But would be nice if software tells us.

Sort in columns?

I usually do a prioritization of my boards where the top task in each column is the most important one. In Kanban.bash it seems the order will always be the order the tasks were created. Would it be possible to be able to sort tasks in the columns? I suppose I could move rows around manually in the csv file but that quickly becomes complicated as the file grows.

MacOS 11.6.1

Tried to run it, complained about needing gawk-cmd

Ran brew install gawk

Then ran kanban, got following error:

conditional binary operator expected
kanban: line 222: syntax error near "maximum_todo[$status]"' kanban: line 222: [[ -v "maximum_todo[$status]" ]] && maxlines=${maximum_todo[$status]}'

Code there looks like:

maxlines=0
[[ -v "maximum_todo[$status]" ]] && [[ maxlines=${maximum_todo[$status]} ]]
[[ ${maximum_todo[$status]} > -1 ]] && [[ $nlines > ${maximum_todo[$status]} ]] && label$
echo -e ".$(strtoline "$label" "~")~~.\n| $label |_______\n|" > $TMP.col.$i

Support for local config files

Currently, only one global config file in the home directory is supported.

I think it would be nicer if the user has the option of actually modifying local configurations, as different projects make use of different lists, based on the work flow differences.

Example: At work I have two projects that differ slightly: One would need a larger amount of backlog lists for fine-grained control of priorities, while the other one works fine with the default settings.
For my personal kanban I don't need the HOLD and CODE sections and would like to rename the others.

As this local file behavior is already implemented for the CSV file, it should not be too much of a problem to adapt this for the config file.

Create manual pages

Hi! It'd be great if this project had a man page. This would help new users learn how to use it, and eventually encourage packaging for Debian.

'pr' on OS X doesn't recognise the "-S" option

It seems that the "pr" command on OS X doesn't support the "String" option

./kanban show
...
 pr: illegal option -- S
usage: pr [+page] [-col] [-adFfmprt] [-e[ch][gap]] [-h header]
          [-i[ch][gap]] [-l line] [-n[ch][width]] [-o offset]
          [-L locale] [-s[ch]] [-w width] [-] [file ...]

Can't seem to see an analogous option.

Strange output in `watch -n 2 kanban show`

Description

Hello!
Firstly, great work here with this super cool script!

Secondly, I found that when I run the show command within a watch, it outputs a strange string at the end:

image

This doesn't happen when I run kanban show without watch or when I run watch with another command:

image

Any idea what can be happening here?

Versions

bash: 5.1.0

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.