---
title: na as a TaskPaper query tool
date: 2022-10-06 05:53
slug: na-as-a-taskpaper-query-tool
categories:
- Code
tags:
- tagging
- search
- taskpaper
- na
- productivity
---

I've made some changes to [na](https://brettterpstra.com/projects/na) that make it a very handy tool for general querying of a TaskPaper file. Now you can quickly find actions based on project, tag, or text content right from the command line.

`na` has subcommands for searching text (`na find`) and for matching tags (`na tagged`). As your todo file grows, these are handy for narrowing down what you need to work on at any given time. I believe I've improved their usefulness in the last couple releases. Just run `gem install na` to install or upgrade.

- First, the `find` and `tagged` commands no longer require the next action tag (@na) to be present to match. You can still query just next actions by adding `+@na` to the `find` command or `+na` to the `tagged` command. But by default all matching actions will be shown with `find` and `tagged`, not just next actions.

- You can now use `!` to require that a tag or search term _not_ exist on matched actions, e.g. `na tagged "priority=3, !maybe"`.

- You can now use wildcards (\* or ?) in text and tag searches. You can also use the `--regex` flag with the `find` command to interpret the search as a regular expression. Invert any search results with `-v/--invert` to display all actions _not_ matching the search.

- You can perform value comparisons with more operators on tag values now, too. When using the `tagged` command, specify your tag searches as tokens containing `<`, `>`, and `=` to perform a numeric comparison (e.g. `na tagged "priority>=3, +maybe"`). You can do string searches with `*=` (contains), `^=` (starts with), and `$=` (ends with), e.g. `na tagged "+na, +note*=video"`. These can be combined with wildcard matching, e.g. `na tagged "note*=m*down"`.

- You can also query specific projects with `--project PROJECT`. The project can be a simple string or a path separated with `/` or `:` to match subprojects, e.g. `na next --project marked/bugs`. The project matching accepts partial matches, so that example could be `na next --project mark/bug`. If there's only one `Bugs:` project in the current directory (or subdirectories if using `--depth`), you don't need to specify a path, `na next --project bugs` will find it. The `--project` flag (which can be shortened as `--proj`) works with `next`, `find`, and `tagged`. This can be especially handy if the directory contains multiple TaskPaper files as a quick means of targeting just one project.

One other thing recently added is the ability to add actions to a specific project rather than just "Inbox:". Just use `na add --to PROJECT` to add to the named project (case insensitive). If the project isn't found in the selected target file, it will be created at the top.

Hopefully all of this broadens the usefulness of `na`. Let me know if you have any feature requests!

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