How go-task/task works
Task is a cross-platform task runner: a user invokes the CLI, which configures an executor, loads task definitions, and runs requested tasks. Its runtime also supports remote and included Taskfiles, dependency/fingerprint handling, watch mode, task listing and summaries, and shell completion. The tree and sampled excerpts show key boundaries; several execution and watch connections are not shown in the excerpts, so those links are marked unverified rather than asserted.
Main entry points: task.go Task runner · task/task.go Task CLI · reader.go Taskfile reader · engine.go Shell completion
Components 20
CLI and configuration
- Task CLI
cmd/task/task.go - Flags and options
internal/flags/flags.go - Task configuration
taskrc/taskrc.go - Config reader
taskrc/reader.go - Config model
taskrc/ast/taskrc.go
Task definitions
- Taskfile reader
taskfile/reader.go - Taskfile model
taskfile/ast/tasks.go - Taskfile sources
taskfile/node_http.go - Git source node
taskfile/node_git.go
Execution runtime
- Executor setup
setup.go - Task runner
task.go - Task compiler
compiler.go - Fingerprint checks
internal/fingerprint/checker_mock.go - Watch mode
watch.go - Filesystem helpers
internal/fsext/fs.go
User-facing features
- Shell completion
internal/complete/engine.go - Task summaries
internal/summary/summary.go - Output handling
internal/output/output.go
Other components
- CLI user
- Shell commands
Connections 24
- CLI user → Task CLI: invokes
cmd/task/task.go - Task CLI → Flags and options: validates options
cmd/task/task.go - Task CLI → Executor setup: sets up
cmd/task/task.go - Flags and options → Executor setup: configures
internal/flags/flags.go - Executor setup → Taskfile reader: loads definitions
- Taskfile reader → Taskfile model: builds model
taskfile/reader.go - Taskfile reader → Taskfile sources: resolves sources
- Taskfile reader → Git source node: uses Git source
- Task CLI → Task runner: runs calls
cmd/task/task.go - Task runner → Taskfile model: reads tasks
task.go - Task runner → Task compiler: compiles tasks
- Task runner → Fingerprint checks: checks freshness
- Task runner → Watch mode: supports watching
- Task runner → Shell commands: executes commands
task.go - Task CLI → Shell completion: dispatches completion
cmd/task/task.go - Shell completion → Task compiler: uses compiler
internal/complete/engine.go - Shell completion → Taskfile model: suggests task names
internal/complete/engine.go - Task runner → Task summaries: prints summaries
task.go - Task runner → Output handling: routes output
task.go - Task CLI → Config reader: loads configuration
- Task configuration → Config reader: reads configuration
taskrc/taskrc.go - Config reader → Config model: returns config model
- Task configuration → Filesystem helpers: searches config files
taskrc/taskrc.go - Task runner → Filesystem helpers: resolves directories