Skip to content

feat(bulk): tsk bulk for filter-driven multi-task edits#10

Merged
Sanjays2402 merged 2 commits into
mainfrom
feat/bulk
May 17, 2026
Merged

feat(bulk): tsk bulk for filter-driven multi-task edits#10
Sanjays2402 merged 2 commits into
mainfrom
feat/bulk

Conversation

@Sanjays2402

Copy link
Copy Markdown
Owner

What

tsk bulk — apply a mutation across many tasks at once, selected via filter flags. Dry-run by default; --apply commits.

The current workflow for retagging or repriorititizing more than a couple of tasks is "open in $EDITOR and find/replace" — fine for one task, awful for 20.

Selectors (AND between types, OR within repeats)

Flag Behavior
--tag <name> tasks with this tag (repeatable; tag-match is case-insensitive)
--priority <p> tasks with this priority (low|medium|high|urgent)
--status <s> open or done
--id <n> explicit id (repeatable)

At least one selector required.

Mutations

Flag Behavior
--set-priority <p> overwrite priority
--add-tag <name> add tag (repeatable; idempotent — no duplicates)
--remove-tag <name> remove tag (repeatable)
--set-due <date> set due date (parsed like tsk add --due)
--clear-due clear due date

At least one mutation required. --set-due and --clear-due are mutually exclusive.

Behavior

  • Default: dry-run. Prints which tasks would change and the mutation summary, then a hint to re-run with --apply.
  • --apply: commits the edits and prints updated N task(s): <summary>.
  • No matches: prints no tasks matched and exits 0.

Examples

$ tsk bulk --tag old --add-tag legacy --remove-tag old --apply
updated 2 task(s): +tags[legacy], -tags[old]

$ tsk bulk --priority low --status open --set-priority medium
DRY RUN — 5 task(s) would be changed (priority=medium):
  #2    refactor parser
  #4    investigate flaky test
  #9    deps: bump go-cmp
  #11   docs: rewrite quickstart
  #14   triage backlog

re-run with --apply to commit.

Tests

11 new tests in internal/commands/bulk_test.go:

  • requires selector
  • requires mutation
  • dry-run is default; no write
  • tag add + remove + filter together
  • priority filter + set-priority
  • multi---id selection
  • --clear-due
  • --set-due and --clear-due mutually exclusive
  • no-match prints message, exits 0
  • tag match is case-insensitive
  • --add-tag is idempotent (no duplicate)

Adds `tsk bulk` to apply edits across many tasks at once. Selects
tasks via filter flags (--tag, --priority, --status, --id) and
applies mutations (--set-priority, --add-tag, --remove-tag,
--set-due, --clear-due).

Runs in dry-run mode by default; --apply commits the change.

Selectors AND-combine across types but OR-combine within --tag and
--id (the natural reading of repeated flags). Tag matching is
case-insensitive. --add-tag is idempotent (won't duplicate existing
tags).

Examples
  tsk bulk --tag old --add-tag legacy --remove-tag old --apply
  tsk bulk --priority low --status open --set-priority medium --apply
  tsk bulk --id 3 --id 7 --set-due tomorrow --apply
@Sanjays2402 Sanjays2402 merged commit 4318d00 into main May 17, 2026
4 checks passed
@Sanjays2402 Sanjays2402 deleted the feat/bulk branch May 17, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant