Code Monkey home page Code Monkey logo

todo.txt-cli's Introduction

todo.txt format

Gitter

A complete primer on the whys and hows of todo.txt.

The first and most important rule of todo.txt:

A single line in your todo.txt text file represents a single task.

Why plain text?

Plain text is software and operating system agnostic. It's searchable, portable, lightweight, and easily manipulated. It's unstructured. It works when someone else's web server is down or your Outlook .PST file is corrupt. There's no exporting and importing, no databases or tags or flags or stars or prioritizing or insert company name here-induced rules on what you can and can't do with it.

The 3 axes of an effective todo list

Using special notation in todo.txt, you can create a list that's sliceable by 3 key axes.

Priority

Your todo list should be able to tell you what's the next most important thing for you to get done - either by project or by context or overall. You can optionally assign tasks a priority that'll bubble them up to the top of the list.

Project

The only way to move a big project forward is to tackle a small subtask associated with it. Your todo.txt should be able to list out all the tasks specific to a project.

In order to move along a project like "Cleaning out the garage," my task list should give me the next logical action to take in order to move that project along. "Clean out the garage" isn't a good todo item; but "Call Goodwill to schedule pickup" in the "Clean out garage" project is.

Context

Getting Things Done author David Allen suggests splitting up your task lists by context - ie, the place and situation where you'll work on the job. Messages that you need to send go in the @email context; calls to be made @phone, household projects @home.

That way, when you've got a few minutes in the car with your cell phone, you can easily check your @phone tasks and make a call or two while you have the opportunity.

This is all possible inside todo.txt.

todo.txt format rules

Your todo.txt is a plain text file. To take advantage of structured task metadata like priority, projects, context, creation, and completion date, there are a few simple but flexible file format rules.

Philosophically, the todo.txt file format has two goals:

  • The file contents should be human-readable without requiring any tools other than a plain text viewer or editor.
  • A user can manipulate the file contents in a plain text editor in sensible, expected ways. For example, a text editor that can sort lines alphabetically should be able to sort your task list in a meaningful way.

These two goals are why, for example, lines start with priority and/or dates, so that they are easily sorted by priority or time, and completed items are marked with an x, which both sorts at the bottom of an alphabetical list and looks like a filled-in checkbox.

Here are the rest.

Incomplete Tasks: 3 Format Rules

The beauty of todo.txt is that it's completely unstructured; the fields you can attach to each task are only limited by your imagination. To get started, use special notation to indicate task context (e.g. @phone ), project (e.g. +GarageSale ) and priority (e.g. (A) ).

A todo.txt file might look like the following:

(A) Thank Mom for the meatballs @phone
(B) Schedule Goodwill pickup +GarageSale @phone
Post signs around the neighborhood +GarageSale
@GroceryStore Eskimo pies

A search and filter for the @phone contextual items would output:

(A) Thank Mom for the meatballs @phone
(B) Schedule Goodwill pickup +GarageSale @phone

To just see the +GarageSale project items would output:

(B) Schedule Goodwill pickup +GarageSale @phone
Post signs around the neighborhood +GarageSale

There are three formatting rules for current todo's.

Rule 1: If priority exists, it ALWAYS appears first.

The priority is an uppercase character from A-Z enclosed in parentheses and followed by a space.

This task has a priority:

(A) Call Mom

These tasks do not have any priorities:

Really gotta call Mom (A) @phone @someday
(b) Get back to the boss
(B)->Submit TPS report

Rule 2: A task's creation date may optionally appear directly after priority and a space.

If there is no priority, the creation date appears first. If the creation date exists, it should be in the format YYYY-MM-DD.

These tasks have creation dates:

2011-03-02 Document +TodoTxt task format
(A) 2011-03-02 Call Mom

This task doesn't have a creation date:

(A) Call Mom 2011-03-02

Rule 3: Contexts and Projects may appear anywhere in the line after priority/prepended date.

  • A context is preceded by a single space and an at-sign (@).
  • A project is preceded by a single space and a plus-sign (+).
  • A project or context contains any non-whitespace character.
  • A task may have zero, one, or more than one projects and contexts included in it.

For example, this task is part of the +Family and +PeaceLoveAndHappiness projects as well as the @iphone and @phone contexts:

(A) Call Mom +Family +PeaceLoveAndHappiness @iphone @phone

This task has no contexts in it:

Email SoAndSo at [email protected]

This task has no projects in it:

Learn how to add 2+2

Complete Tasks: 2 Format Rules

Two things indicate that a task has been completed.

Rule 1: A completed task starts with an lowercase x character (x).

If a task starts with an x (case-sensitive and lowercase) followed directly by a space, it is marked as complete.

This is a complete task:

x 2011-03-03 Call Mom

These are not complete tasks.

xylophone lesson
X 2012-01-01 Make resolutions
(A) x Find ticket prices

We use a lowercase x so that completed tasks sort to the bottom of the task list using standard sort tools.

Rule 2: The date of completion appears directly after the x, separated by a space.

For example:

x 2011-03-02 2011-03-01 Review Tim's pull request +TodoTxtTouch @github

If you’ve prepended the creation date to your task, on completion it will appear directly after the completion date. This is so your completed tasks sort by date using standard sort tools. Many Todo.txt clients discard priority on task completion. To preserve it, use the key:value format described below (e.g. pri:A)

With the completed date (required), if you've used the prepended date (optional), you can calculate how many days it took to complete a task.

Additional File Format Definitions

Tool developers may define additional formatting rules for extra metadata.

Developers should use the format key:value to define additional metadata (e.g. due:2010-01-02 as a due date).

Both key and value must consist of non-whitespace characters, which are not colons. Only one colon separates the key and value.

todo.txt-cli'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  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

todo.txt-cli's Issues

Need feature to move invalid todo items quickly

First of all thank you for this project.I have been using this program for a while. I have got some suggestion to improve this awesome project.

I have a invalid.txt which stores invalid todo items.Currently i move items to this file by using todo.sh move command. I use it frequently , so i would like to have a shortcut like todo.sh del ## / todo.sh d ##

Puzzling about dates

Hello,
I'm new to this format, and I was wondering how I should interpret the following task:
x 2014-08-29 Test @context +project

It starts with a "x", so it is a completed task. So, 2014-08-29 might be interpreted as the "completion date".
However, the task could be seen as "no priority" and "no completion date", and then the date 2014-08-29 might be interpreted as well as the "creation date".

Any help would be appreciated.

Thanks,
Alessandro

On Windows, help command and short help (-h) flag add and empty task

Using the todo.txt-cli version 2.10 on Windows (under a Git Bash shell), both the help command and the -h flag add an empty task at the end of the todo.txt file.

Example:

$ tail -2 $TODO_FILE
2014-01-02 Test task 1
2014-01-02 Test task 2
$ t help
     # (help output ommited) 
$ tail -2 $TODO_FILE
2014-01-02 Test task #2
2014-01-02

An empty task with just today's date, 2014-01-02 is added at the end of the todo.txt file.

t -h also adds an empty task.

I know this is rather a Windows/Git Bash issue, but I wonder if the same happens on Cygwin, and if there's something that can be done in the script to avoid this.

Short help (-h) inaccessible when custom config file path is used

Note: I am running Mac OS 10.7.4.

If you specify a new config path using the -d option, the -h flag is inaccessible due to a bug.

Typing ./todo.sh -h will result in the error,

Fatal Error: Cannot read configuration file /Users/user/.todo/config

Typing ./todo.sh -h -d $HOME/CONFIG/PATH/HERE will result in the same error (using the old path, not the newly specified one).

Typing ./todo.sh -d $HOME/CONFIG/PATH/HERE -h will ignore the -h flag entirely, which is to be expected considering the usage text:

Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description]
Try 'todo.sh -h' for more information.

Also, I'm personally aliasing t to todo.sh -d $HOME/CONFIG/PATH so I would like it if -h could be specified after the -d flag and associated argument are specified.

documentation on use within a team

I know this is not the place to post this question, but after multiple attempts Yahoo won't let me join the mailing list, no clue why. anyway, question is: is there any documentation or articles on how to use todo.txt within a team project?

thanks

[Feature Request] iCloud Sync

It can be easily done via WebDAV (CalDAV) and the server https://pXX-caldav.icloud.com/DSID/calendars/ where XX is a server number (internally called partition) and DSID seems to be a unique identification number that is associated your Apple-ID. It can be found for example in some URLs on https://www.icloud.com (e.g. of the profile picture). The reminders are stored in a resource collection. All entries are separately stored in .ics format (using VTODO) and need to have a GUID as name.

Missing howto documentation?

I've got to be crazy but looking at this page on the wiki:

https://github.com/ginatrapani/todo.txt-cli/wiki/user-documentation

which is linked in a few places as describing how to install and use todo.cli, I can only find information about installing it, setting up bash completion, writings about why it's in plain text, where to find enhancements etc., but nowhere do I find basic todo.sh usage (I've never used it before).

I've got to simply be missing something but thought I'd file an issue just in case.

hide tasks

I use todo.txt together with Simpletask on my Android phone. On Simpletask I can create hiddden tasks, e.g. to define all my common projects and contexts so that they are also available if there is no task assigned. That's really useful because it allows you to always auto-complete projects and contexts, even if you just create the first task for it. Simpletask defines this hidden tasks by adding "h:1" to the task description. Is it possible to also hide this tasks from todo.txt-cli?

I would be also willing to write my own extension for it, if you give me some pointer how this could be done.

Create .todo/config

I just installed todotxt from MacPorts, but it wouldn't work properly until I created ~/.todo and a ~/.todo/config with something like:

export TODO_DIR="$HOME/Dropbox/todo"
export TODO_FILE="$TODO_DIR/todo.txt"
export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/report.txt"
export TMP_FILE="/tmp/todo.tmp"
export TODOTXT_DEFAULT_ACTION=ls

I couldn't find any documentation on these variables here, so I guess there's something I'm missing. If not, maybe these should go into the quick start guide?

prepend not correct on prioritized tasks

$ t add test
TODO: 'test' added on line 114.
$ t pri 114 a
114: (A) test
TODO: 114 prioritized (A).
$ t prepend 114
Prepend: pretest         
114: **pretest (A)** test

Symlink to todo.cfg

I installed the Todo.txt CLI with Homebrew:

$ brew install todo-txt

I then attempted to create an event:

$ todo.sh add "Test"
Fatal Error: Cannot read configuration file /Users/Mike/.todo/config

I can fix the above error by creating a symbolic link to todo.cfg:

$ sudo ln -s /usr/local/Cellar/todo-txt/2.10/todo.cfg /Users/Mike/.todo/config

But, I assume that the symlink will be broken when Brew updates todo-txt. Is this the case?

Is it possible to have /Users/Mike/.todo/config always point to todo.cfg, even after Brew has updated the program?

Thank you.

Customize the list display

How can you quickly customize the list display so it shows something before the todo item, such as a [ ] or the like?

grep -w, listcon and listproj in OS X 10.5

2.3 uses gawk for listcon and listproj, but gawk has been replaced with the following grep command:

grep -w -o '@[^ ]\+' "$TODO_FILE" | sort -u

and

grep -w -o '+[^ ]\+' "$TODO_FILE" | sort -u

Using Mac OS X 10.5's grep, neither of these work correctly (at least for me). listcon returns a list of all tasks with a context (the full task name) and listproj does the same for projects.

A fix?: If I simply remove the -w from grep, both work fine. I don't know enough about grep to know if this is a problem with 10.5's grep (or even my particular configuration somehow) or if the -w is not really needed. (-w = --word-regexp, "Select only those lines containing matches that form whole words.")

Change to more conventional prefixes

Wouldn't it make sense to use Twitter's widespread hashtags for #contexts?

Also both Twitter and Facebook uses the @ symbol to denote a person or account. I feel that could definitely serve as a more intuitive character for project names.

priority lost after replace

ad@pc200:~$ t add todo1
TODO: 'todo1' added on line 12.
ad@pc200:~$ t pri 12 a
12: (A) todo1
TODO: 12 prioritized (A).
ad@pc200:~$ t ls 12
12 (A) todo1 
ad@pc200:~$ t replace 12 "todo1 changed"
replaced with
12: todo1 changed
ad@pc200:~$ t ls 12
12 todo1 changed

In the last line you see it lost its priority after replacement. A user would not expect this, so it is an issue?

Widget for Android?

Is there a screen widget for todo.txt for Android, that would allow you to see your task list (or part of it) w/o having to click the icon?

QuickStart Guide gives incorrect info.

" mv todo.cfg ~/."
The file that downloads is called todo.cfg but ...
when I ran todo.sh, it looked for /home/username/.todo/config
I had to create the .todo directory and rename todo.cfg to config

Provide a way to reorder tasks

Is there a way from the command line to reorder tasks in the todo file?

Like every (A) tasks would be moved to top of file, same for every other priorities.

ImportError: No module named gflags

I installed the google tasks extension by following the instructions provided in its readme. The google-python-api, as well as the oauth package is successfully installed. It still shows this error, when I try to run todo.sh google ...

Zsh auto-completion

The documentation does not provide any help on activating auto-completion using a Zsh shell. Is there any way to enable it?

I can't get todo to work in cron job

uname -a : Linux Phoenix 3.2.0-63-generic-pae #95-Ubuntu SMP Thu May 15 23:26:11 UTC 2014 i686 i686 i386 GNU/Linux

I keep getting:
Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] Try 'todo.sh -h' for more information.

Whenever I try to use:
* * * * * /home/dave/bin/todo.sh -p | mail -s "Todo" [email protected]

If I don't use the -p the email is sent but it shows up as an attachment because of the ansi colors. Is there a way to turn off the colors in the config file itself? If there isn't why doesn't cronjob work?

The mail portion of the command works fine. I tested it with a "ls" command and with echo. There is something special about todo.sh in the cron environment.

Color doesn't get displayed

Hi,

I am having issue with the highlighting. The color doesn't get displayed. I only have TODO_DIR modified in the config file. I'm using 2.9 on OS X with iTerm2. I don't think iTerm2 color profile has anything to do with this as I have the same problem in Terminal. It's not my zsh settings (using oh-my-zsh) as well as switching to bash doesn't help. I tried uncommenting the color map setting still doesn't help.

I searched for the problem on the web or in this issue archive and couldn't find the similar problem. I have no idea what else to check. Appreciate your advise. Thanks!

output to file or mail has artifacts I don't recognize

When I run:
t ls "+park"
the output to screen looks fine but if I > file.txt OR if I pipe to mail the output is a little odd what are the artifacts at the begining and end of the file/email and how can I prevent that?

Example output:
^[[0;32m02 (B) update projects +park @scot @david^[[0m

^[[1;34m09 (C) collect SSL info and make easily reportable +park @scot^[[0m

TODO: 2 of 13 tasks shown

When using with a webDav mount I experience issues closing tasks.

I'm still trying to track down what the cause of the error is but I have a feeling it has something to do with locking.

Steps to reproduce:

1.Mount webDav from owncloud that has my todoCli folder.
2.todo ls (no problems I can see my tasks)
3.todo do pops an error:
sed: cannot rename /home/gr0undzer0/todoCLI/todo.txt: Input/output error
sed: cannot rename /home/gr0undzer0/todoCLI/todo.txt: Input/output error

I can create new files within this folder without issue. It's probably fair to say that todoCLI may not be causing this at all but I figure I'd see if anyone else had tried this and had any problems?

Thanks.

Inline mode not supported by NetBSD's sed

On NetBSD (and probably other BSDs) sed is not supporting the inline mode todo.txt is using (sed -i).
A quick workaround is to replace "sed" with "gsed" in todo.sh. Please either let the user define which sed version to use, e.g. in .todo/config or don't use sed's inline mode.

Index numbers should stay the same after operations

I suggest that the index numbers should stay the same after operations. At the present they change e.g. after the "do" command.

This could be achieved by replacing "done" items with a single line only containing an "x" instead of removing the line completely from todo.txt

This way you could list and do subsequent operations like "do", "do", "add", "change priority", and so on, and be sure the displayed index numbers still apply. This could reduce the number of mistakes in day to day operation I believe.

[edit]
This would also solve #3 (no safeguard to do twice), because the second "do" would operate on the same entry
[/edit]

A minor drawback would be that some sort of "compress" command would be necessary to get rid of all the lines with the "x" on them when desired.

do: no safeguard to do twice

If by accident you repeat @todo.sh do@ twice on the same task, this should be ignored but instead we have:

$ t add test
TODO: 'test' added on line 114.
$ t do 114
114: x 2009-03-21 test
TODO: 114 marked as done.
$ t do 114
114: **x 2009-03-21 x 2009-03-21** test
TODO: 114 marked as done.

$TODO_SH should contain full file path

I've noticed that $TODO_SH only contains the file name of the
script. Wouldn't it make sense for it to contain the full path (not
everyone has set up their PATH to include the todotxt directory)?

source

a plugin that reminds of things archived as done?

I have been thinking it would be great if I could be reminded of the things I had done for each day. For example, by receiving a daily digest email or a growl-like notification on a desktop.

I am curious if there's already a plugin that does a similar thing? If not, I would like to work on it so that it can integrate with services like idonethis.com?

Any pointers would be deeply appreciated.

Replacing 'add' 'rm' and other built-in commands

I've followed up the example and it was easy.This is my first time using GIT. Sorry I didn't knew where to edit the text.
Difficulties? well, I only had to manage the TODO_ACTIONS_DIR variable, which I set to "$TODO_DIR/todo.actions.d" in my todo.cfg. This was something quite obvious.

The thing is that I had to explicitly add the TODO_SH variable in my todo.cfg otherwise the custom add command wouldn't be able to call the built-in add command. I mean I was getting something like:
"$ t command add test
....todo.sh: add command not found"

Hope it helps to any other with same issue.

do: todos purged, backup allright, wrong sed expression

There's a bug in sed expression on line 251 (in version 2.4 or commit a4227df -- that's what I checked) of todo.sh (function "archive").

I do:

todo.sh do 6

Output:

6: x 2009-08-05 2009-07-21 Rachunek za gaz +mieszkanie
TODO: 6 marked as done.
x 2009-08-05 2009-07-21 Rachunek za gaz +mieszkanie
sed: -e expression \#1, char 34: Invalid range end
TODO: /home/lavrin/docs/todo/todo.txt archived.

Todo item no. 6 is marked and properly copied to done.txt, but the original todo.txt is purged. However, todo.txt.bak is fine.

Unfortunately, I'm not able to post a patch, as about sed I know nothing except there's such tool ;)

Start task with @context

According to the specifications of todo.txt format all context must be preceded with a space, but if you start a task with a context, does this rule apply to this? Or is @work call This Dude about+theAwesomeProject a valid task?

Should list be the default action?

I'm new to todo.txt so sorry if I'm missing something, but would it be more useful if the default action was ls rather than showing the usage summary. Usage can always be checked with -h. Just a newbie thought.

Completed tasks without a date

The specs say that a completed task must have a completion date. This constraint looks unnecessary. There are good use cases for completed tasks without a date - for example, I use checklists a lot, and checklists doesn't need a completion date. Personally, I rarely even use completion dates in my regular todo lists - when a task is done, it's done, and I don't care about the details.

I'd like to edit my Todo.txt with a text editor quickly - adding an 'x' in front of a task should be enough to mark it as completed, and the resulting line should be valid. Writing dates is always a chore.

The spec would become: in a completed task, if you have a date after the x, that's the completion date. If you have two dates, then the first date is the completion date, and the second date is the creation date. This would read slightly more complicated than "you must have a completion date after the x, followed by an optional creation date" - but it would make the format more tolerant and the file easier to manage. It's also fully backwards-compatible.

-p option not working as expected

Hi there!

First of all, thanks for todo-txt. Amazing tool!

I'm having an issue with -p option of the command line tool. It is not working as expected.

Steps:

  • List tasks (using -p)
  • Create sample task (using -p)
  • Mark created task as done (using -p)
  • "Done" message is colored

See screenshot:

captura de pantalla 2013-12-20 a la s 08 54 36

Release v2.9 isn't tagged.

There's no v2.9 tag in your GitHub repository. Either you forgot to tag this, or just didn't git push --tags. This makes it difficult to investigate in which version a feature was introduced.

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.