na 1.2.85 → 1.2.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/src/_README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  _If you're one of the rare people like me who find this useful, feel free to
10
10
  [buy me some coffee][donate]._
11
11
 
12
- The current version of `na` is <!--VER-->1.2.84<!--END VER-->.
12
+ The current version of `na` is <!--VER-->1.2.86<!--END VER-->.
13
13
 
14
14
  `na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
15
15
 
@@ -235,6 +235,49 @@ See the help output for a list of all available actions.
235
235
  @cli(bundle exec bin/na help update)
236
236
  ```
237
237
 
238
+ #### Time tracking
239
+
240
+ `na` supports tracking elapsed time between a start and finish for actions using `@started(YYYY-MM-DD HH:MM)` and `@done(YYYY-MM-DD HH:MM)` tags. Durations are not stored; they are calculated on the fly from these tags.
241
+
242
+ - Add/Finish/Update flags:
243
+ - `--started TIME` set a start time when creating or finishing an item
244
+ - `--end TIME` (alias `--finished`) set a done time
245
+ - `--duration DURATION` backfill start time from the provided end time
246
+ - All flags accept natural language (via Chronic) and shorthand: `30m ago`, `-2h`, `2h30m`, `2:30 ago`, `yesterday 5pm`
247
+
248
+ Examples:
249
+
250
+ ```bash
251
+ na add --started "30 minutes ago" "Investigate bug"
252
+ na complete --finished now --duration 2h30m "Investigate bug"
253
+ na update --started "yesterday 3pm" --end "yesterday 5:15pm" "Investigate bug"
254
+ ```
255
+
256
+ - Display flags (next/tagged):
257
+ - `--times` show per‑action durations and a grand total (implies `--done`)
258
+ - `--human` format durations as human‑readable text instead of `DD:HH:MM:SS`
259
+ - `--only_timed` show only actions that have both `@started` and `@done` (implies `--times --done`)
260
+ - `--only_times` output only the totals section (no action lines; implies `--times --done`)
261
+ - `--json_times` output a JSON object with timed items, per‑tag totals, and overall total (implies `--times --done`)
262
+
263
+ Example outputs:
264
+
265
+ ```bash
266
+ # Per‑action durations appended and totals table
267
+ na next --times --human
268
+
269
+ # Only totals table (Markdown), no action lines
270
+ na tagged "tag*=bug" --only_times
271
+
272
+ # JSON for scripting
273
+ na next --json_times > times.json
274
+ ```
275
+
276
+ Notes:
277
+
278
+ - Any newly added or edited action text is scanned for natural‑language values in `@started(...)`/`@done(...)` and normalized to `YYYY‑MM‑DD HH:MM`.
279
+ - The color of durations in output is configurable via the theme key `duration` (defaults to `{y}`).
280
+
238
281
  ##### changelog
239
282
 
240
283
  View recent changes with `na changelog` or `na changes`.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.85
4
+ version: 1.2.87
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -245,6 +245,8 @@ extra_rdoc_files:
245
245
  - README.md
246
246
  - na.rdoc
247
247
  files:
248
+ - ".cursor/commands/changelog.md"
249
+ - ".cursor/commands/priority35m36m335m32m.md"
248
250
  - ".rubocop.yml"
249
251
  - ".rubocop_todo.yml"
250
252
  - ".travis.yml"
@@ -302,6 +304,7 @@ files:
302
304
  - lib/na/string.rb
303
305
  - lib/na/theme.rb
304
306
  - lib/na/todo.rb
307
+ - lib/na/types.rb
305
308
  - lib/na/version.rb
306
309
  - na.gemspec
307
310
  - na.rdoc