Skip to content

feat(search): add tsk search command for fuzzy CLI search#12

Merged
Sanjays2402 merged 2 commits into
mainfrom
feat/cli-search
May 17, 2026
Merged

feat(search): add tsk search command for fuzzy CLI search#12
Sanjays2402 merged 2 commits into
mainfrom
feat/cli-search

Conversation

@Sanjays2402

Copy link
Copy Markdown
Owner

Adds tsk search <query> for fuzzy CLI search across tasks.

Originally PR #7, recreated after retargeting from feat/ls-table to main (base branch was deleted when #6 merged).

The TUI has had instant fuzzy search since v0.1. The CLI has been blind:
once a project has >20 tasks, finding one means scrolling `ls` output
manually. This adds the same search affordance to scripts and one-shots.

Implementation:
  - Reuses internal/util/fuzzy (sahilm/fuzzy), same scoring as the TUI
  - Default index: title + #tags + notes
  - --title-only restricts to titles
  - Filter: undone by default, --done | --all
  - --limit N caps results
  - --format plain/table/json (table reuses #6 renderer)
  - --json shortcut preserved, mutually exclusive with --format
  - Empty result: "no matches for <q>" in text, "[]" in JSON

Examples:
  tsk search milk
  tsk search "fix login" --limit 5
  tsk search dev --all
  tsk search docs --json | jq

Tests: 10 cases — title match, tag match, --title-only, done filter,
--all, --limit, --json non-empty, --json empty array, empty query
rejection, table format. All green with -race.
@Sanjays2402 Sanjays2402 merged commit 3b34e16 into main May 17, 2026
4 checks passed
@Sanjays2402 Sanjays2402 deleted the feat/cli-search branch May 17, 2026 04:31
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