Files in the top-level directory from the latest check-in
- haskerdeux.hs
- LICENSE
- README.markdown
Haskerdeux - A Simple Command Line Client for Teuxdeux in Haskell
Written with the dual purpose of being a learning exercise for Haskell and also because I really wanted a command line tool for Teuxdeux. As it stands this is a bit rough and ready, but it does work.
It used to use Network.Curl, but I can't get that to work anymore so I'm doing straight system calls to curl which means it's not very Haskelly and ultimately a bit of a pointless use of Haskell, but it's for me, so there.
Status
Alive! Official status is "Messy and works for me, unlikely to improve"; It was dead for years because I didn't think it was possible to get the new API to work.
Requirements
You need the following Haskell packages installed:
- Data.List.Split
- Text.JSON
I also suggest you compile it to use it - it's much faster to use that way.
Just do ghc --make haskerdeux.hs
. If you don't compile it then replace
./haskerdeux
in the examples below with runhaskell haskerdeux.hs
.
Features/Commands
Haskerdeux works in the following way:
haskerdeux <date> <number / command> <other args>
I.e. the date supplied is the date the commands act on. It understands "today", "tomorrow", "mon", "tues", etc and dates in "YYYY-MM-DD" format. All commands recognise and require a date.
The <number / command>
bit is because I did something because I could, not
necessarily because I should. It's best understood by reading through the
following commands (and makes more sense when you use it)
Todos
For listing todos only (as that is all I want to see)
haskerdeux today todos
haskerdeux tomorrow todos
haskerdeux wed todos
haskerdeux 2017-02-28 todos
This returns a numbered list, like so:
0 - Write README for Haskerdeux
1 - Write Blog post about Haskerdeux
2 - Split development work in different branch
3 - Perhaps do some actual work you are paid to do
You can use those numbers with the PutOff and CrossOff commands, etc.
New
For creating new tasks
haskerdeux today new "<A todo item for today>"
haskerdeux tomorrow new "<A todo item for tomorrow>"
PutOff
For putting off a task until the next day. This is where the <number /
command>
bit comes in. Rather than have a consistent order of arguments of
date
, command
and then other stuff it takes the number of the todo it's
acting on before the command:
haskerdeux today <tasknumber from todos list> putoff
E.g:
haskerdeux today 3 putoff
I.e. you pick the day you are looking at, then the todo and then what you want to do to it.
MoveTo
For moving a task to another date.
haskerdeux today <tasknumber from todos list> moveto <date in YYYY:MM:DD>
E.g:
haskerdeux today 11 moveto 2012-09-01
CrossOff
For marking a task as complete
haskerdeux today <tasknumber from todos list> crossoff
Delete
For completely removing a task
haskerdeux today <tasknumber from todos list> delete
Using .netrc For Storing Username and Password
It's compulsory. It used to support passing username/password as command line
args, but no more. The <username>
and <password>
are read from .netrc
.
Just add an entry to .netrc
as follows:
machine teuxdeux.com
login superprocrastinator
password mysecretpassword
Or the single line format:
machine teuxdeux.com loging superprocrastinator password mysecretpassword
It should work ok with either format. It won't work if you have spaces in your password though.
Development
Nope.
Thanks
Some resources that helped me figure this out:
- A Haskell Newbies Guide to Text.JSON and especially the comments explaining the generic approach.
- For the new API and making me realise it was possible to make this work once again, dmi3's TeuxDeux Unofficial API for Python.