taskopen [options] [filter1 filter2 filterN] [\\label]
Any task in taskwarrior can have zero-or-more annotations. Taskopen can filter, list and open these annotations, and can determine several things about them, based on clues found in the format. An annotation can be a line of text, it can be a link to a file, a link to a program, or a link to a website. If the annotation starts with [label: ]Notes, then taskopen will open (creating if necessary) a text note that is specific to the task, and is named UUID.txt (where UUID is replaced with the actual task uuid). Taskopen can be custom-configured by editing the .taskopenrc file, see taskopenrc(5).
Show a help text.
Print version information.
Print more verbose version and environment information.
- -c <filepath>
Use alternate taskopenrc file as specified by filepath.
Query all active tasks; clears the EXCLUDE filter.
Query all tasks. This includes completed and deleted tasks as well. Depending on the size of your database this may be very slow.
Only show/open notes, i.e. annotations matching NOTES_REGEX.
Show all but notes; inverse of -n.
Only show/open real files, i.e. annotations matching FILE_REGEX.
Show all but real files; inverse of -f.
Only show/open text annotations, i.e. annotations matching TEXT_REGEX.
Show all but text annotations; inverse of -t.
Show only files that don't exist; should be used with -f or -n.
- -m 'regex'
Only include annotations that match regex.
- --type 'regex'
Only open files whose type (as returned by the file command) matches regex.
Batch mode, processes every matching annotation.
Raw mode, opens the annotation text with your EDITOR.
Delete the annotation instead of opening it.
Force to open the file with EDITOR.
- -x [cmd]
Execute file, optionally prepend cmd to the command line. See User Commands for further DETAILS
List-only mode, does not open any file. Can be combined with -L.
List-only mode, does not open any file. Shows command line that would be executed. Can be combined with -l.
- -s 'key1+,key2-'
Sort annotations by the given key which can be any taskwarrior attribute (preceded by 'task_') or 'annot', 'label', 'entry', 'size', 'type', 'time', 'mtime' or 'atime'. A '+' or '-' may be appended to the field indentifier in order to specify a sort order.
- -i [cmd]
Execute cmd for each file and shows its output interleaved with the other output. A default can be set in the taskopenrc file. See User Commands for further details.
- -p 'cmd'
Pipe the output of taskopen to 'cmd'. This is supposed to behave just like "taskopen | cmd".
Any argument that is not recognized as an option or label will be passed to taskwarrior as an additional filter, i.e. any combination of taskwarrior filters can be used with taskopen. The default filter can be specified in the taskopenrc file, see taskopenrc(5).
Each annotation can have a "label", which is a leading word with a colon and a space
<label>: <annotation text>
The label can be used to filter and/or sort the listings, and (in a future version) it can be used as to specify how the annotation should be handled. The label may match the NOTES_REGEX in which case the annotation is considered to be a link to the corresponding Notes file.
A user command can be specified on the command line by -i, -x or in the taskopenrc file. By default, the decoded annotation (usually a file path) will be passed as an argument to the user-specified command. This behaviour can be overridden by using one or more of the following environment variables explicitly:
Contains the decoded annotation (usually a file path or a URI).
Contains the UUID of the corresponding task.
Contains the ID of the corresponding task; may be empty.
Contains the LABEL text of the annotation; may be empty.
Contains the undecoded annotation text.
Contains the last sub-pattern of the matched REGEX, see examples in taskopenrc(5).
Such as TASK_PROJECT, which contains the value of the taskwarrior attribute "project" as soon as you let taskopen know about this attribute by adding it to the TASK_ATTRIBUTES variable in your taskopenrc.
This way, for instance, you can choose to pass the UUID instead of the file path to you command like this:
$ taskopen -i 'echo $UUID'
Create a new taskwarrior task:
$ task add Example
Add an annotation which links to a file:
$ task 1 annotate -- ~/checklist.txt
(Note that the "--" instructs taskwarrior to take the following arguments as the description part without doing any parser magic. This is particularly useful to circumvent bug #819.)
Open the linked file by using the task's ID:
$ taskopen 1
or by a filter expression:
$ taskopen Example
Inspired by Alan Bowens 'tasknote' you can add a default notes file to a task. These files will be automatically created by the task's UUID and don't require to annotate the task with a specific file path. The folder in which these files will be stored, the triggering text (default: "Notes") as well as the command to be executed can be customised by editing the taskopenrc file.
As soon as you annotate a task with 'Notes':
$ task 1 annotate Notes
you can open and edit this file by:
$ taskopen 1 -n
which will use your default EDITOR to open a file like ~/tasknotes/5727f1c7-2efe-fb6b-2bac-6ce073ba95ee.txt
You can also add weblinks to a task and even mix all kinds of annotations:
$ task 1 annotate web: www.taskwarrior.org
$ task 1 annot I want to consider this
$ task 1 ann -- man: ~/Documents/manual.pdf
(note: taskopen currently works only with "link-type" annotations, so the second annot above will not be listed) There are various ways to open either the URI or the pdf file. If taskopen finds more than one annotation matching the filter, it will output a list and ask for user interaction:
$ taskopen 1
Please select an annotation:
1) man: ~/Documents/manual.pdf
2) web: www.taskwarrior.org
Enter the number(s) of the annotation to open it, or any other character to abort. Multiple selections can be opened in sequence, by entering a comma-separated list and/or range (as in 1,3,4 or 2-4)
You can use filters to directly address the desired annotation(s)...
$ taskopen 1 \\web
by regular expression:
$ taskopen 1 -m Doc
or by file type:
$ taskopen 1 --type PDF
Filter options and taskwarrior attributes can be used in any combination.
Clean up annotations
The -x option can be used to execute arbitrary commands. The decoded annotation, which will be a file path in most cases, will be passed as a command line argument. This enables the user to do fancy things like removing unused files from the filesystem:
This command will show you a list of annotations of any deleted task. You can then select one or even multiple items of the list in order to remove the corresponding file from the filesystem.
You may also decide to precheck the command that is going to be executed by taskopen by adding the -L argument.
If you are sure that you want to execute the command on every file you may consider activating the batch mode by adding the -b option. Taskopen will then skip the user interaction and automatically select all entries from the list.
Output/interleave additional information
Interleaving of arbitrary information can be achieved by using the -i 'cmd' argument. This is particularly useful when you are using rather general filters. The provided cmd will be executed for every annotation that is going to be listed and the output of this command will be interleaved with the list items. Taskopen comes with a number of helper scripts that may be useful for this, e.g. for peeking into all your Notes files:
Files & Folders
User configuration file - see also taskopenrc(5). This can be overriden by the -c argument.
User-specific extension scripts. Will be contained in taskopen's PATH variable by default.
- 2010 - 2012
The first release of taskopen was a quite simple bash script.
- early 2013
Re-implementation of taskopen in perl.
Credits & Copyrights
Copyright (C) 2010 - 2020, J. Schlatow
Taskopen is distributed under the GNU General Public License. See http://www.opensource.org/licenses/gpl-2.0.php for more information.
For more information regarding taskopen, see the following:
- The official site at
- The official code repository at
- Bugs in taskopen may be reported to the issue-tracker at