Task Provider System
Overview
Section titled “Overview”The task provider system is a pluggable architecture for displaying project tasks from any source. Providers are executable scripts that output standardized JSON.
Architecture
Section titled “Architecture”.navi.yaml (per-project) ~/.navi/config.yaml (global) │ │ ▼ ▼Config Parser (internal/task/config.go) │ ▼Provider Discovery (internal/task/discover.go) │ ▼Provider Execution (internal/task/provider.go) │ ├── Execute script with args from config ├── Parse stdout as JSON └── Validate against ProviderResult schema │ ▼Result Cache (internal/task/cache.go) │ ├── Cache by project + provider └── TTL from config (default 30s) │ ▼TUI Task Panel (internal/tui/tasks.go, taskview.go)Key Types
Section titled “Key Types”// Task represents a single task itemtype Task struct { ID string Title string Status string Assignee string Labels []string Priority int URL string Created time.Time Updated time.Time}
// TaskGroup represents a collection of related taskstype TaskGroup struct { ID string Title string Status string URL string Tasks []Task}
// ProviderResult is the output from a task providertype ProviderResult struct { Groups []TaskGroup Tasks []Task}Provider Contract
Section titled “Provider Contract”A provider script must:
- Be executable
- Accept arguments from the config’s
argsfield - Output valid JSON to stdout matching the
ProviderResultschema - Exit with code 0 on success
Built-in Providers
Section titled “Built-in Providers”markdown-tasks (providers/markdown-tasks.sh)
Section titled “markdown-tasks (providers/markdown-tasks.sh)”Scans a directory of markdown files for task definitions. Groups tasks by parent directory, parses task status from markdown content.
github-issues (providers/github-issues.sh)
Section titled “github-issues (providers/github-issues.sh)”Uses the gh CLI to fetch issues from a GitHub repository. Groups by milestone or project.
Caching
Section titled “Caching”Provider results are cached to avoid frequent script execution:
- Cache key: project path + provider name
- Default TTL: 30 seconds (configurable via
intervalin.navi.yaml) - Cache is invalidated on manual refresh (
rkey in task panel)