pter [-h] [-v] [-u] [-n task] [-s search] [-c configuration] filename [filename ...]
pter is a tool to manage your tasks when they are stored in the todo.txt file format. pter is targeted at users applying the Getting Things Done method, but can be used by anyone that uses todo.txt files.
pter offers these features:
- Fully compatible to the todo.txt standard
- Support for due:, t: (threshold date), h: (hide task)
- Extensive search/filter capabilities (see Searching)
- Save and recall search queries for quick access (see Named Searches)
- Sort tasks through search queries (see Sorting)
- Convenient entering of dates (see Relative Dates)
- Task sequencing (see Task Sequences)
- Automatic identifiers (see Unique Task Identifiers)
- Track time spent per task (see Time Tracking)
- Support for Recurring Tasks
- Detailed notes per task (see Task Notes)
- Highly configurable behaviour, shortcuts, and colors (see Configuration Files)
qpter is the Qt version of pter (ie. pter with a graphical user interface) and supports mostly the same features but sometimes looks for other sections in the configuration. For more details, see the dedicated documentation for qpter or the qpter man page.
- -c configuration
- Path to the configuration file you wish to use. The default is $XDG_CONFIG_HOME/pter/pter.conf (usually ~/.config/pter/pter.conf).
- -h
- Show the help.
- -v
- Show the version of pter/qpter.
- -u
- Check whether a new version of pter is available on pypi (requires an internet connection).
- -n task
Add task to the todo.txt file. The advantage of using this over just echo "task" >> todo.txt is that relative dates are properly expanded (see Relative Dates). If you provide - instead of a task, the task will be read from stdin. Multiple tasks can be added, one per line.
If you don't provide a todo.txt file on the commandline, the first file from the files option in your configuration file will be used.
- -s search
- Load this named search upon startup. If a named search by that name does not exist, use this as a search term from the start.
- -l
- Log level. Can be one of DEBUG, INFO, WARNING, ERROR, or FATAL. Defaults to ERROR.
- --log-file
- In what file to log the messages. This is also the file where you can find information about crashes, if you encounter any.
- filename
- Path to your todo.txt file. The first file that you provide is the one where new tasks will be created in. You may choose to not provide any files here. In that case the files configured in the [General] section (in files) will be loaded.
Aside from the data files in the todo.txt format (see Conforming to), pter's behaviour can be configured through one or more configuration files.
The configuration file's default location is at ~/.config/pter/pter.conf.
For details, please refer to the help right here or the man page pter.config(5).
The user interface consists of three main parts:
- The top row is the currently active search (see Searching)
- The middle part is a list of all tasks
- The bottom row shows a contextual help based on what you're currently working on
There is a full list of all keybindings available when you press ?.
In the commandline you can easily copy tasks to the clipboard (by default with Y). This functionality depends on the programs xsel (X11), xclip (X11), wl-copy (wayland) or tmux (terminal) being installed.
pter will attempt to copy the text of the selected task to all of these programs.
If you are running pter in tmux, the copied task will be available via tmux saveb (default binding in tmux is C-b ]).
Instead of providing full dates for searches or for due: or t: when editing tasks, you may write things like due:+4d, for example, to specify a date in 4 days.
A relative date will be expanded into the actual date when editing a task or when being used in a search.
The suffix d stands for days, w for weeks, m for months, y for years. The leading + is implied when left out and if you don’t specify it, d is assumed.
due and t tags can be as simple as due:1 (short for due:+1d, ie. tomorrow) or as complicated as due:+15y-2m+1w+3d (two months before the date that is in 15 years, 1 week and 3 days).
due and t also support relative weekdays. If you specify due:sun it is understood that you mean the next Sunday. If today is Sunday, this is equivalent to due:1w or due:+7d.
Finally there are today and tomorrow as shortcuts for the current day and the day after that, respectively. These terms exist for readability only, as they are equivalent to 0d (or even just 0) and +1d (or 1d, or even just 1), respectively.
One of the most important parts of pter is the search. You can search for tasks by means of search queries. These queries can become very long at which point you can save and restore them.
Unless configured otherwise by you, the search is case-sensitive.
Here's a detailed explanation of search queries.
The easiest way to search is by phrase in tasks.
For example, you could search for read to find any task containing the word read or bread or reading.
To filter out tasks that do not contain a certain phrase, you can search with not:word or, abbreviated, -word.
By default all tasks are shown, but you can show only tasks that are not completed by searching for done:no.
To only show tasks that you already marked as completed, you can search for done:yes instead.
To search for a specific project or context, just search using the corresponding prefix, ie. + or @.
For example, to search for all tasks for project "FindWaldo", you could search for +FindWaldo.
If you want to find all tasks that you filed to the context "email", search for @email.
Similar to the search for phrases, you can filter out contexts or projects by search for not:@context, not:+project, or use the abbreviation -@context or -+project respectively.
Searching for priority is supported in two different ways: you can either search for all tasks of a certain priority, eg. pri:a to find all tasks of priority (A). Or you can search for tasks that are more important or less important than a certain priority level.
Say you want to see all tasks that are more important than priority (C), you could search for moreimportant:c. The keyword for “less important” is lessimportant.
moreimportant and lessimportant can be abbreviated with mi and li respectively.
Searching for due dates can be done in two ways: either by exact due date or by defining “before” or “after”.
If you just want to know what tasks are due on 2018-08-03, you can search for due:2018-08-03.
But if you want to see all tasks that have a due date set after 2018-08-03, you search for dueafter:2018-08-03.
Similarly you can search with duebefore for tasks with a due date before a certain date.
dueafter and duebefore can be abbreviated with da and db respectively.
If you only want to see tasks that have a due date, you can search for due:yes. due:no also works if you don’t want to see any due dates.
Searching for due dates supports Relative Dates.
The search for task with a certain creation date is similar to the search query for due date: created:2017-11-01.
You can also search for tasks created before a date with createdbefore (can be abbreviated with crb) and for tasks created after a date with createdafter (or short cra).
To search for tasks created in the year 2008 you could search for createdafter:2007-12-31 createdbefore:2009-01-01 or short cra:2007-12-31 crb:2009-01-01.
Searching for creation dates supports Relative Dates.
The search for tasks with a certain completion date is pretty much identical to the search for tasks with a certain creation date (see above), but using the search phrases completed, completedbefore (the short version is cob), or completedafter (short form is coa).
Searching for completion dates supports Relative Dates.
pter understand the the non-standard suggestion to use t: tags to indicate that a task should not be active prior to the defined date.
If you still want to see all tasks, even those with a threshold in the future, you can search for threshold: (or, short, t:). See also configuration option default-threshold.
You can also pretend it’s a certain date in the future (eg. 2042-02-14) and see what tasks become available then by searching for threshold:2042-02-14.
threshold can be abbreviated with t. tickler is also a synonym for threshold.
Searching for threshold supports Relative Dates.
You can search for task IDs with id:. If you search for multiple task IDs, all of these are searched for, not a task that has all given IDs.
You can also exclude tasks by ID from a search with not:id: or -id:.
You can search for tasks that are supposed to follow directly or indirectly other tasks by searching for after:taskid (taskid should be the id of a task). Any task that is supposed to be completed after that task, will be found.
If the configuration option hide-sequential is set to yes (the default), tasks are hidden that have uncompleted preceding tasks.
If you want to see all tasks, disregarding their declared sequence, you can search for after: (without anything after the :).
Tasks that refer to other tasks by any of the existing means (eg. ref: or after:) can be found by searching for ref:.
If you search using multiple references (eg. ref:4,5 or ref:4 ref:5) the task IDs are considered a logical or.
You can search for parts of a filename that a task belongs to with file:. not: (or -) can be used to exclude tasks that belong to a certain file.
For example: file:todo.txt or -file:archive.
Tasks can be sorted by passing sort: to the search. The properties of tasks to sort by are separated by comma. The following properties can be used for sorting:
- due_in
- The number of days until the task is due, if there is a due date given.
- completed
- Whether or not the task has been completed.
- priority
- The priority of the task, if any.
- linenr
- The line of the task in its todo.txt file
- file
- The name of the todo.txt file the task is in.
- project
- The first project (alphabetically sorted) of the task.
- context
- The first context (alphabetically sorted) of the task.
The default sorting order is completed,due_in,priority,linenr and will be assumed if no sort: is provided in the search.
Search queries can become very long and it would be tedious to type them again each time.
To get around it, you can save search queries and give each one a name. The default keyboard shortcut to save a search is "s" and to load a search is "l".
The named queries are stored in your configuration folder in the file ~/.config/pter/searches.txt.
Each line in that file is one saved search query in the form name = search query.
Here are some useful example search queries:
Due this week = done:no duebefore:mon Done today = done:yes completed:0 Open tasks = done:no
When using todo.txt files for project planning it can be very tedious to type due dates, time estimates project and context, tickler values, custom tags, etc for every task. Another scenario is if a certain type of task comes up on a regular basis, e.g. bugfixes.
To get around typing out the task every time, you can edit a file stored in your configuration folder ~/.config/pter/templates.txt. The syntax is identical to the searches.txt file. Alternatively an existing task can be saved as a template.
Each line in that file is one saved template in the form name = task template.
The default keyboard shortcut to load a template is "L", to set no template, select the None template. To save an existing task the default key is "S". Once a template has been selected any new task created will contain the template text when editing starts.
Here are some useful example search queries:
Paper revision = @paper +revision due:+7d estimate: Bug fix = (A) @programming due:+2d estimate: git: Project X = @work +projectx due:2021-04-11 estimate:
pter can track the time you spend on a task. By default, type "t" to start tracking. This will add a tracking: attribute with the current local date and time to the task.
When you select that task again and type "t", the tracking: tag will be removed and the time spent will be saved in the tag spent: as hours and minutes.
If you start and stop tracking multiple times, the time in spent: will accumulate accordingly. The smallest amount of time tracked is one minute.
The delegate function (on shortcut > (pter) or Ctrl+G (qpter) by default) can be used to mark a task as delegated and trigger the delegation action.
When delegating a task the configured marker is being added to the task (configured by delegation-marker in the configuration file).
The delegation action is configured by setting the delegation-action in the configuration file to mail-to. In that case an attempt is made to open your email program and start a new email. In case you defined a to: (configurable by defining delegation-to) in your task description, that will be used as the recipient for the email.
Tasks can be given an identifier with the id: attribute. pter can support you in creating unique IDs by creating a task with id:#auto or, shorter, id:#.
If you would like to group your tasks IDs, you can provide a prefix to the id:
Clean up the +garage id:clean3
If you now create a task with id:clean# or id:clean#auto, the next task will be given id:clean4.
In case you want all your tasks to be created with a unique ID, have a look at the configuration option auto-id.
You can refer to other tasks using the attribute ref: following the id of the task that you are referring to. This may also be a comma separated list of tasks (much like after:, see Task Sequences).
You may use the show-related function (by default on the key r) to show the tasks that this task is referring to by means of ref: or after:.
You can declare that a task is supposed to be done after another task has been completed by setting the after: attribute to the preceding task.
By default, ie. with an empty search, any task that is declared to be after: some other preceding task will not be shown unless the preceding task has been marked as done.
If you do not like this feature, you can disable it in the hide-sequential in the configuration file.
These three tasks may exist:
Buy potatoes @market id:1 Make fries @kitchen id:2 after:1 Eat fries for dinner after:2
This means that Make fries won’t show in the list of tasks until Buy potatoes has been completed. Similarily Eat fries for dinner will not show up until Make fries has been completed.
You can declare multiple after: attributes, or comma separate multiple prerequisites to indicate that all preceding tasks must be completed before a task may be shown:
Buy oil id:1 Buy potatoes id:2 Buy plates id:3 Make fries id:4 after:1,2 Eat fries after:3 after:4
In this case Make fries will not show up until both Buy oil and Buy potatoes has been completed.
Similarly Eat fries requires both tasks, Make fries and Buy plates, to be completed.
Recurring (or repeating) tasks can be indicated by adding the rec: tag and a Relative Dates specifier, like this:
A weekly task rec:1w Do this again in 3 days rec:3d
By marking such a task as done, a new task will be added with the same description, but a new creation date.
If you’d rather not have pter create new tasks every time, you can set the reuse-recurring option in the configuration file to yes.
Recurring tasks usually only have meaning when a due: date is given, but when there is no due:, a t: will be used as a fallback if there is any.
When completing such a task, pter can either create the follow-up task based on the date of completion or based on the due date of the task. This behaviour called the "recurring mode" which can be either
- strict: the new due date is based on the old due date, or
- normal: the new due date is based on the completion date.
To use strict mode, add a + before the time interval. For example you would write rec:+2w for strict mode and rec:2w for normal mode.
An example. Given this task (starting June, you want to rearrange your flowers in the living room every week):
2021-06-01 Rearrange flowers in the living room due:2021-06-05 rec:1w
In strict mode (rec:+1w), if you complete that task already on 2021-06-02, the next due date will be 2021-06-13 (old due date + 1 week). But in normal mode (rec:1w) the new due date will be 2021-06-09 (date of completion + 1 week).
If your recurring tasks has a due date and a threshold/tickler tag (t:), upon completion the new task will also receive a t: tag with the same relative time to the due date as the original task.
So, if you set up a due date 2021-06-05 and a threshold t:2021-06-04 the new task will also have a threshold in such a way that the task is hidden until one day before the due date.
This extension only works in pter, not in qpter.
You may provide a text file with additional notes about a task using the note: tag.
The location of notes is managed via the configuration file in the General section with the notes option.
Notes are assumed to be .txt text files, but you can overwrite that with the note-suffix configuration option.
For example, if you define a task with note:details, pter will assume you meant a file with the name details.txt.
However, you can just define the full filename with extension in which case pter will not use the note-suffix default. For example Some task note:details.md.
The function edit-note (usually on shortcut N) will either edit the note of this task or create a note.
Have a look at the note-naming option to change the behaviour how new notes are created.
For editing, pter will use the external text editor configured with editor in the configuration file's General section.
With pter you can apply the Getting Things Done method to a single todo.txt file by using context and project tags, avoiding multiple lists.
For example, you could have a @in context for the list of all tasks that are new. Now you can just search for @in (and save it as a named search) to find all new tasks.
To see all tasks that are on your "Next task" list, a good start is to search for "done:no not:@in" (and save this search query, too).
Pter is fully compatible with the standard format, but also supports the following extra key/value tags:
pter is fully controlled by keyboard and has no mouse support.
These default keyboard controls are available in any list:
- "↓", "↑" (cursor keys): select the next or previous item in the list
- "j", "k": select the next or previous item in the list
- "Home": go to the first item
- "End": go the last item
- ":": jump to a list item by number (works even if list numbers are not shown)
- "1".."9": jump to the list item with this number
- "Esc", "^C": cancel the selection (this does nothing in the list of tasks)
In the list of tasks, the following controls are also available:
- "?": Show help
- "m": open this manual in a browser
- "e": edit the currently selected task
- "E": edit the currently selected task in an external text editor
- "n": create a new task
- "/": edit the search query
- "^": clear the search
- "c": search for a context of the currently selected task
- "p": search for a project of the currently selected task
- "r": search for all tasks that this task is referring to with ref: or after:
- "F6": select one project out of all used projects to search for
- "F7": select one context out of all used contexts to search for
- "q": quit the program
- "l": load a named search
- "s": save the current search
- "L": load a named task template
- "S": Save a task as a named template
- "u": open a URL listed in the selected task
- "t": Start/stop time tracking of the selected task
- ">": Delegate the selected task
- "A": Set the priority of this task to (A)
- "B": Set the priority of this task to (B)
- "C": Set the priority of this task to (C)
- "D": Set the priority of this task to (D)
- "+": Increase the priority of this task
- "-": Decrease the priority of this task
- "=": Remove the priority of this task
- "%": Move this task into the archive
- "N": Edit or create this task's note
- "Y": Copy (yank) the selected task's full text to clipboard
In edit fields the following keyboard controls are available:
- "←", "→" (cursor keys): move the cursor one character to the left or right
- "Home": move the cursor to the first charater
- "End": move the cursor to the last character
- "Backspace", "^H": delete the character to the left of the cursor
- "Del": delete the character under the cursor
- "^U": delete from before the cursor to the start of the line
- "Escape", "^C": cancel editing
- "Enter", "Return": accept input and submit changes
- "↓", "Tab", "^N": next item in the completion list
- "↑", "^P": previous item in the completion list
- "Tab": jump to the next key:value field where there is not value
- "Enter": use the selected item of the completion list
- "Esc", "^C": close the completion list
pter works with and uses the todo.txt file format and strictly adheres to the format as described at http://todotxt.org/. Additional special key/value tags are described in the previous section.
Probably plenty. Please report your findings at Codeberg, Github or via email to the authors at https://vonshednob.cc/pter.