---
title: na with saved search
date: 2022-10-07 16:18
slug: na-with-saved-search
categories:
- Code
tags:
- search
- tagging
- history
- na
---

![na-saved-search-rb.jpg](https://brettterpstra.com/uploads/2022/10/na-saved-search-rb.jpg)

This might be the last big [na](https://brettterpstra.com/projects/na) update for a little while, but it's got some great stuff in it. I'm really aiming to make this a great companion to TaskPaper, and I think it's coming along nicely.

### Natural Date Comparisons

First, you can now do natural language date comparisons for tag searches. For example, if you have an `@due(DATE)` tag in your todo file, you can run `na tagged "due<now"` to find everything that's currently due. Or `na tagged "start<=in 2 days"` to find upcoming tasks. If a tag contains a date, it will be automatically detected and the comparison will be interpreted as a natural language date. You can, of course, use any valid date format for a specific date. Comparisons using `*=`, `^=`, and `$=` will still do actual text comparisons, so you can perform a query like `na tagged "due^=2022-10"` to see everything with an October, 2022 due date.

### Saved Searches

So, say you have a query like "due<=in 2 days" that you run frequently. Now you can add `--save TITLE` to the command, e.g. `na tagged "due<=in 2 days" --save soon`, to save that search for future use. Once saved, you can just run `na saved soon` to repeat the search. This can be especially handy for searches with multiple criteria, such as `na tagged "due<in 7 days,start>=yesterday"`.

### Other recent changes

Since the last time I wrote about it... like 2 days ago? I've not been sleeping well.

#### CHANGED

- If no + or ! tokens are given in search, default to AND search for tokens

#### NEW

- `na add -d X` to allow adding new actions to todo files in subdirectories
- You can use `--project X` to display only actions within a specific project. Specify subprojects with a path, e.g. `na/bugs`. Partial matches allowed, works with `next`, `find`, and `tagged`
- `find` and `tagged` recognize * and ? as wildcards
- `--regex` flag for find command
- `--in todo/path` flag for `find` and `tagged` commands to specify a todo file from history
- `na todos` will list (and optionally search) known todo files from history

#### IMPROVED

- When specifying arguments to `next`, allow paths separated by / to do more exact matching
- Highlight search terms in results
- Added `--or` flag to `tagged` and `find` to default to OR boolean combination of search terms/tags
- Fuzzier matching of todo file history
- Allow wildcards (* and ?) when matching todo history
- Allow multiple todo queries separated by comma

#### FIXED

- When adding a project, don't use Ruby #capitalize, which downcases the rest of the project name
- Multiple search terms overriding each other

To get all this goodness, update to the latest version (1.1.23+) using `gem upgrade na` or `brew gem upgrade na`.

A big thanks goes to Ralf Hülsmann, who has brought a lot of especially great feature requests to light.

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