Expand description
Git branch-based task ID detection.
Resolves task IDs from three sources in priority order: explicit CLI arg, the
CLICKUP_TASK_ID env var, then the current git branch name. Destructive
commands (task delete, task link, etc.) opt out of branch resolution.
Structs§
- Resolved
Task - A task ID resolved from some source.
Enums§
Functions§
- current_
branch - Return the current git branch name, or
Noneif not inside a repo, on detached HEAD, or ifgitis unavailable. Never errors — git absence is treated the same as “not in a repo”. - extract_
task_ id - Extract a task ID from a branch name, or
Noneif no pattern matches. CU- matches take precedence over custom IDs; first match wins within each. - parse_
task_ id - Normalize an explicit CLI arg. Strips
CU-transparently; detectsPREFIX-NUMBERas custom. Never fails — any string becomes aResolvedTaskwith sourceExplicit. - require_
task - Like
resolve_task, but errors with a helpful hint when nothing resolves. - resolve_
task - Resolve a task ID from the priority chain: explicit → env → branch. Returns
Noneif nothing is found — callers decide whether that’s an error.