One more round of updates for na. I got a couple of questions about whether na could work with one centralized file. The answer was, at the time, “not really,” but I’ve made some changes to facilitate that.

Get the latest version using gem upgrade, or do a fresh install by following the instructions on the project page.

Global Todo File

The core idea behind na is that you have a TaskPaper file for every project in that project’s root directory. In order to combine multiple projects in one file, you would either need to make use of tags, or create a TaskPaper project for each one in the global file. You can now do this, either manually or have na use the current working directory as a tag or project.

To use a global file, run na with the global flag --file PATH. You can make this permanent by running na --file PATH initconfig (or --initconfig --force if you’ve already created a config file). Note that when using initconfig, previous preferences will be overwritten with only what exists on the command line at the time it’s run, so if you want to specify other options like default extension or Next Action tag, either include those in the command or edit the ~/.na.rc file manually.

When the --file flag is used, you can additionally include the --cwd_as TYPE flag (where TYPE is tag or project) to determine how the current working directory is applied to new/updated actions. If you use --cwd_as project, the action will be added to a project with the same name as the current directory. If you use --cwd_as tag, the current directory name will be applied as a tag. The default value is “none,” applying neither unless one is specified. Use initconfig or manually add/modify the cwd_as: TYPE key in ~/.na.rc to make the preference permanent.

Prepend vs Append

By default, na adds all new/moved actions to the top of the target project (or Inbox). There’s now an --at POSITION flag that allows you to put new/moved actions at the end of the target project as the last item in the list (or the first item before a subproject). --at can be used with na add and na update. To make this a global change, use --add_at as a global flag and save it to the config, or add add_at: end to ~/.na.rc.

Just a couple of usability tweaks!