feat(bulk): tsk bulk for filter-driven multi-task edits#10
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tsk bulk— apply a mutation across many tasks at once, selected via filter flags. Dry-run by default;--applycommits.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)
--tag <name>--priority <p>low|medium|high|urgent)--status <s>openordone--id <n>At least one selector required.
Mutations
--set-priority <p>--add-tag <name>--remove-tag <name>--set-due <date>tsk add --due)--clear-dueAt least one mutation required.
--set-dueand--clear-dueare mutually exclusive.Behavior
--apply.--apply: commits the edits and printsupdated N task(s): <summary>.no tasks matchedand exits 0.Examples
Tests
11 new tests in
internal/commands/bulk_test.go:--idselection--clear-due--set-dueand--clear-duemutually exclusive--add-tagis idempotent (no duplicate)