summaryrefslogtreecommitdiff
path: root/internal/askcli
AgeCommit message (Collapse)Author
5 daysAdd 'ask edit ID' to edit task description in $EDITOR; bump to 0.41.0Paul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019e9b82-6ba0-77a4-b4a0-5c2cbf9bf39f Co-authored-by: Amp <amp@ampcode.com>
6 daysAdd 'ask edit' subcommand and collapse multi-line task descriptionsPaul Buetow
- ask edit opens $EDITOR and creates a task from the (multi-line) content, reusing the shared internal/editor package - collapse newlines in list output and fish completion so multi-line descriptions render on one line and don't break completion Bump version to 0.40.0 Amp-Thread-ID: https://ampcode.com/threads/T-019e96a1-9c8e-73d6-95b4-b55cb12cc762 Co-authored-by: Amp <amp@ampcode.com>
11 daysask: fix watch output to match regular commands by preserving terminal width ↵Paul Buetow
detection
11 daysask: add completed sub-command to list completed tasksPaul Buetow
12 daysfix(askcli): use real TAB split in fish dependency completionPaul Buetow
12 daysaskcli: prevent stale-lock inode split during contentionPaul Buetow
12 daysaskcli: keep ask add successful when alias assignment failsPaul Buetow
2026-05-26feat(askcli): add projects subcommandPaul Buetow
2026-05-26build: bump minimum Go version to 1.24.0Paul Buetow
Updates go.mod from 1.21.0 to 1.24.0 because tests use testing.T.Chdir, which requires Go 1.24. Also fixes pre-existing fmt.Errorf non-constant format strings in task_selector.go that the printf vet analyzer flags when running go test with the newer minimum version.
2026-05-26feat(askcli): add watch subcommandPaul Buetow
Implements `ask watch [subcommand...]` which re-runs a read-only subcommand every 2 seconds and redraws output when it changes, similar to gnu-watch. Safety features: - Restricted to read-only subcommands (list, all, ready, info, urgency, help, dep list) - Recursive watch is blocked - Captures stderr so error messages are visible in the watched display Also adds readOnly field to commandEntry registry for maintainability.
2026-05-04askcli: serialize task alias cache writes to fix concurrent rename racePaul Buetow
Two concurrent 'ask' invocations could race on the alias cache file: both wrote the JSON to a shared '<path>.tmp' filename and then both called os.Rename, so the loser failed with: replace task alias cache: rename .../task-aliases-v2.json.tmp .../task-aliases-v2.json: no such file or directory The shared tempfile also enabled lost updates because each process loaded the file independently before saving its own version on top. Fix: - Take an exclusive flock on a sentinel file (task-aliases-v2.json.lock) in the cache directory around the full load/modify/save cycle in both ensureTaskAliases and resolveTaskSelectorFromCache, using the existing internal/filelock package. - Switch save() to os.CreateTemp so each writer gets a unique tempfile name; the loser's tempfile is removed cleanly on rename failure. - Refactor resolveTaskSelectorFromCache by extracting finalizeResolvedTaskSelector to keep functions under 50 lines. Adds TestEnsureTaskAliases_ConcurrentCallsDoNotRaceOnTempFile, which reproduces the original error reliably on the unfixed code and now passes with -race. Amp-Thread-ID: https://ampcode.com/threads/T-019df49f-52a5-75b1-98d5-371a163ef100 Co-authored-by: Amp <amp@ampcode.com>
2026-04-22Fix ask default add dispatch for w7Paul Buetow
2026-04-13Release v0.33.0: ask dependency UX and start gatingPaul Buetow
Show only task alias IDs on ask info Depends lines. Block ask start until every dependency is completed. Bump version to 0.33.0. Made-with: Cursor
2026-04-13ask: serialize concurrent CLI with repo lock and stale PID recoveryPaul Buetow
Add advisory lock under .git/hexai-ask.lock around Taskwarrior execution, with metadata (PID and process basename) and Linux /proc comm checks to remove orphan lock files when the recorded holder is gone or not ask. Extract internal/filelock for shared flock helpers; stats uses it too. Made-with: Cursor
2026-04-11Rename task CLI binary from do back to askPaul Buetow
- Move cmd/do to cmd/ask; mage builds and installs ask; Fish completions to ask.fish - Update askcli help text, errors, executor default label, and Fish script (__ask_*) - Task alias cache subdirectory under XDG cache: hexai/ask/ - Rename integration test files and helpers; refresh README and docs - Rename plan-do-uuid-wrapper.md to plan-ask-uuid-wrapper.md Made-with: Cursor
2026-04-10task 30: add proj prefix override for doPaul Buetow
2026-04-10task 20: hide do info UUID unless HEXAI_DEBUG is setPaul Buetow
2026-04-08fish: complete task selectors with short aliases onlyPaul Buetow
Add complete-aliases subcommand that emits tab-separated alias lines without UUID duplicates. Wire embedded Fish script (__do_task_selectors) to call complete-aliases; keep complete-uuids unchanged for scripts and tests. Made-with: Cursor
2026-04-08Rename task CLI from ask to doPaul Buetow
- Move cmd/ask to cmd/do; mage BuildDo builds binary named do - Update askcli help text, errors, Fish completion (complete -c do, __do_*) - Task alias cache path: XDG cache hexai/do/task-aliases-v2.json - Refresh README and docs; go install path cmd/do@latest - Remove accidentally tracked cmd/ask build artifact; ignore cmd/do/do and cmd/do/ask Made-with: Cursor
2026-04-07fix: recover gracefully from corrupted alias cache instead of hard-failingPaul Buetow
When the task alias cache file contains invalid JSON (e.g. from a concurrent write race producing two concatenated JSON objects), the previous code returned a hard error that blocked all `ask` subcommands. Now loadTaskAliasCache discards the corrupt file and starts fresh, assigning new alias IDs on the next run. Validation errors (e.g. next_id reuse) still surface as errors since those indicate a logic bug. Also fix stale v1 reference in integration test aliasCachePath. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07feat: show task summary in fish shell autocompletion for alias IDsPaul Buetow
The complete-uuids command now emits tab-separated "selector\tdescription" lines so fish shell displays the first 60 chars of the task description alongside each alias/UUID in the autocompletion menu. The __ask_add_dependency_modifiers fish function is updated to strip the description field before matching and building depends: completions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07feat: reverse alias IDs for better shell tab-completionPaul Buetow
Alias IDs are now stored in reversed form (e.g. id=37 → "10" instead of "01") so that the first character varies quickly across consecutive IDs, making shell auto-completion more effective. The counter logic is unchanged; only the string representation is reversed via a new reverseString helper in encodeTaskAliasID/decodeTaskAliasID. The cache file is bumped to task-aliases-v2.json so existing mappings are abandoned and all aliases are regenerated with the new format. Also fix TestDispatcher_CompleteUUIDsSubcommand to use an isolated temp dir for the alias cache, preventing flakiness from cross-test pollution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29feat: implicit add for na/no-agent scope prefixPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019d37f6-6549-7119-979a-88bc1225c594 Co-authored-by: Amp <amp@ampcode.com>
2026-03-28perf: replace linear scan with O(1) map lookup in task alias cachePaul Buetow
Add in-memory byUUID and byAlias maps to taskAliasCache so that ensureAlias, lookupUUIDByAlias, and lookupAliasByUUID all run in O(1) instead of scanning the full entries slice. Maps are rebuilt after every mutation (load, prune, append) to avoid stale pointers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28Rename "Pro" column header to "Pri" for Priority in ask command outputPaul Buetow
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27release: v0.27.2v0.27.2Paul Buetow
2026-03-27release: v0.27.1v0.27.1Paul Buetow
2026-03-27Rename ask table headersPaul Buetow
2026-03-27Implement command registry for askcli commandsPaul Buetow
2026-03-27docs: document askcli exportsPaul Buetow
2026-03-27Explicitly ignore askcli write errorsPaul Buetow
2026-03-27Switch task alias cache save to pointerPaul Buetow
2026-03-27Move selector helpers into task selectorPaul Buetow
2026-03-27Extract parseGlobalFlags helperPaul Buetow
2026-03-27refactor: share alias cache lookupPaul Buetow
2026-03-27Split askcli info and add commandsPaul Buetow
2026-03-27Use Go 1.21 max builtin in formatterPaul Buetow
2026-03-27664b9fe4: extract renderTaskList helperPaul Buetow
2026-03-27Remove dead UUID completion items (61568dc2-6915-4444-8027-2ad4eacf2408)Paul Buetow
2026-03-27Fix dispatcher routing test for 38d5bd83-29e7-4a3c-ad44-21dddfbdfe22Paul Buetow
2026-03-27refactor: extract runSingleTaskCommand helper ↵Paul Buetow
(715cc01f-1630-4d11-b6fd-18d64a8c2035)
2026-03-27task 3a4c0f14-16ad-487f-af7c-bd99ee6464e6: use pointer Dispatcher receiversPaul Buetow
2026-03-27askcli: support add depends selectorsPaul Buetow
2026-03-27fix ask description width 84f1af4e-be84-4265-9df2-8f6932059913Paul Buetow
2026-03-27fix ask alias output wording 7f53c2ff-4eb0-4c7e-bf90-f44587364f4aPaul Buetow
2026-03-27fix askcli header width for 0685342b-606c-4c8f-aab5-cd363d926e77Paul Buetow
2026-03-27fix ask add alias output for 1a1731dc-1f11-42bd-be12-4c1af7f7e673Paul Buetow
2026-03-27test: cover ask info dependencies 052ad39a-6967-4628-a65c-db2a163de09bPaul Buetow
2026-03-27Verify fish selector completion coverage for ↵Paul Buetow
6c1f2f60-d55c-4a0c-ba5d-e897c738ecb4
2026-03-27Add alias coverage for task b777fcc2-8f64-4250-b0ac-6038a8aa26b4Paul Buetow