---
title: na with a global file
date: 2022-10-25 14:52
slug: na-with-a-global-file
categories:
- Code
tags:
- na
- tagging
- taskpaper
- productivity
---

One more round of updates for [na](https://brettterpstra.com/projects/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](https://brettterpstra.com/projects/na).

<!--more-->

### 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!

## na

Project: [na](https://brettterpstra.com/projects/na.md)

- [Web Excursions for October 19th, 2026](https://brettterpstra.com/2026/10/19/web-excursions-for-october-19th-2026.md): 2026-10-19
- [New, faster NA](https://brettterpstra.com/2026/07/04/new-faster-na.md): 2026-07-04
- [TaskPaper search syntax for NA](https://brettterpstra.com/2025/12/03/taskpaper-search-syntax-for-na.md): 2025-12-03
- [One more na update](https://brettterpstra.com/2025/10/29/one-more-na-update.md): 2025-10-29
- [Optimizing na and doing](https://brettterpstra.com/2025/10/23/optimizing-na-and-doing.md): 2025-10-23
- [Brett's Favorites 2023](https://brettterpstra.com/2023/12/08/bretts-favorites-2023.md): 2023-12-08
- [More na updates](https://brettterpstra.com/2023/09/09/more-na-updates.md): 2023-09-09
- [A bit more na work](https://brettterpstra.com/2023/08/30/a-bit-more-na-work.md): 2023-08-30
- [Some na updates and new commands](https://brettterpstra.com/2023/08/22/some-na-updates-and-new-commands.md): 2023-08-22
- [Brett's Favorites 2022 - Personal Projects](https://brettterpstra.com/2022/11/30/bretts-favorites-2022-personal-projects.md): 2022-11-30
- [na with a global file](https://brettterpstra.com/2022/10/25/na-with-a-global-file.md): 2022-10-25
- [na can now edit your actions](https://brettterpstra.com/2022/10/22/na-can-now-edit-your-actions.md): 2022-10-22
- [na with saved search](https://brettterpstra.com/2022/10/07/na-with-saved-search.md): 2022-10-07
- [na as a TaskPaper query tool](https://brettterpstra.com/2022/10/06/na-as-a-taskpaper-query-tool.md): 2022-10-06
- [Revamping na (Next Action CLI)](https://brettterpstra.com/2022/09/28/revamping-na-next-action-cli.md): 2022-09-28
- [Branching out from Bash: Fishing expedition](https://brettterpstra.com/2019/10/11/branching-out-from-bash-fishing-expedition.md): 2019-10-11
- [Task management for coders](https://brettterpstra.com/2017/12/01/task-management-for-coders.md): 2017-12-01

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
