11---
2- title : " Announcing Built-in Core Utilities for Windows"
2+ title : ' Announcing Built-in Core Utilities for Windows'
33description : The journey of enhancing Windows support in Task.
44author : andreynering
5- date : 2025-08-26
5+ date : 2025-09-15
66outline : deep
77---
88
@@ -11,42 +11,39 @@ outline: deep
1111<AuthorCard :author =" $frontmatter.author " />
1212
1313When I started Task back in 2017, one of my biggest goals was to build a task
14- runner that would work well on all major platforms, including Windows.
15- At the time, I was using Windows as my main platform, and it caught my attention
16- how much of a pain it was to get a working version of Make on Windows, for
17- example.
14+ runner that would work well on all major platforms, including Windows. At the
15+ time, I was using Windows as my main platform, and it caught my attention how
16+ much of a pain it was to get a working version of Make on Windows, for example.
1817
1918## The very beginning
2019
2120The very first versions, which looked very prototyp-ish, already supported
2221Windows, but it was falling back to Command Prompt (` cmd.exe ` ) to run commands
23- if ` bash ` wasn't available in the system. That didn't mean you couldn't run
24- Bash commands on Windows necessarily, because if you used Task inside Git Bash,
25- it would expose ` bash.exe ` into your ` $PATH ` , which made possible for Task to
26- use it. Outside of it, you would be out of luck, though, because running on
27- Command Prompt meant that the commands wouldn't be really compatible.
22+ if ` bash ` wasn't available in the system. That didn't mean you couldn't run Bash
23+ commands on Windows necessarily, because if you used Task inside Git Bash, it
24+ would expose ` bash.exe ` into your ` $PATH ` , which made possible for Task to use
25+ it. Outside of it, you would be out of luck, though, because running on Command
26+ Prompt meant that the commands wouldn't be really compatible.
2827
2928## Adopting a shell interpreter
3029
31- I didn't take too much time to discover that there was
32- [ a shell interpreter for Go that was very solid] [ mvdan ] , and I quickly adopted
33- it to ensure we would be able to run commands with consistency across all
34- platforms. It was fun because once adopted, I had the opportunity to
35- [ make some contributions to make it more stable] [ mvdan-prs ] , which I'm sure the
36- author appreciated.
30+ I didn't take too much time to discover that there was [ a shell interpreter for
31+ Go that was very solid] [ mvdan ] , and I quickly adopted it to ensure we would be
32+ able to run commands with consistency across all platforms. It was fun because
33+ once adopted, I had the opportunity to [ make some contributions to make it more
34+ stable] [ mvdan-prs ] , which I'm sure the author appreciated.
3735
3836## The lack of core utilities
3937
4038There was one important thing missing, though. If you needed to use any core
41- utilities on Windows, like copying files with ` cp ` , moving with ` mv ` , creating
42- a directory with ` mkdir -p ` , that likely would just fail :boom : .
43- There were workarounds, of course. You could run ` task ` inside Git Bash which
44- exposed core utils in ` $PATH ` for you, or you could install these core utils
45- manually (there are a good number of alternative implementations available
46- for download).
47-
48- That was still far from ideal, though. One of my biggest goals with Task is that it
49- should "just work", even on Windows. Requiring additional setup to make
39+ utilities on Windows, like copying files with ` cp ` , moving with ` mv ` , creating a
40+ directory with ` mkdir -p ` , that likely would just fail :boom : . There were
41+ workarounds, of course. You could run ` task ` inside Git Bash which exposed core
42+ utils in ` $PATH ` for you, or you could install these core utils manually (there
43+ are a good number of alternative implementations available for download).
44+
45+ That was still far from ideal, though. One of my biggest goals with Task is that
46+ it should "just work", even on Windows. Requiring additional setup to make
5047things work is exactly what I wanted to avoid.
5148
5249## They finally arrive!
@@ -55,21 +52,21 @@ And here we are, in 2025, 8 years after the initial release. We might be late,
5552but I'm happy nonetheless. From now on, the following core utilities will be
5653available on Windows. This is the start. We want to add more with time.
5754
58- * ` base64 `
59- * ` cat `
60- * ` chmod `
61- * ` cp `
62- * ` find `
63- * ` gzip `
64- * ` ls `
65- * ` mkdir `
66- * ` mktemp `
67- * ` mv `
68- * ` rm `
69- * ` shasum `
70- * ` tar `
71- * ` touch `
72- * ` xargs `
55+ - ` base64 `
56+ - ` cat `
57+ - ` chmod `
58+ - ` cp `
59+ - ` find `
60+ - ` gzip `
61+ - ` ls `
62+ - ` mkdir `
63+ - ` mktemp `
64+ - ` mv `
65+ - ` rm `
66+ - ` shasum `
67+ - ` tar `
68+ - ` touch `
69+ - ` xargs `
7370
7471## How we made this possible
7572
@@ -78,24 +75,23 @@ projects.
7875
7976### u-root/u-root
8077
81- We are using the core utilities implementations in Go from the
82- [ u-root ] [ u-root ] project. It wasn't as simple as it sounds because they have
83- originally implemented every core util as a standalone ` main ` package, which
84- means we couldn't just import and use them as libraries. We had some discussion
85- and we agreed on a common [ interface] [ uroot-interface ] and
86- [ base implementation] [ uroot-base ] . Then, I refactored one-by-one of the core
87- utils in the list above. This is the reason we don't have all of them: there are
88- too many! But the good news is that we can refactor more with time and include
89- them in Task.
78+ We are using the core utilities implementations in Go from the [ u-root ] [ u-root ]
79+ project. It wasn't as simple as it sounds because they have originally
80+ implemented every core util as a standalone ` main ` package, which means we
81+ couldn't just import and use them as libraries. We had some discussion and we
82+ agreed on a common [ interface] [ uroot-interface ] and [ base
83+ implementation] [ uroot-base ] . Then, I refactored one-by-one of the core utils in
84+ the list above. This is the reason we don't have all of them: there are too
85+ many! But the good news is that we can refactor more with time and include them
86+ in Task.
9087
9188### mvdan/sh
9289
93- The other collaboration was with the maintainer of the shell interpreter.
94- He agreed on having [ an official middleware] [ middleware ] to expose these core
95- utilities.
96- This means that other projects that use the shell interpreter can also benefit
97- from this work, and as more utilities are included, those projects will benefit
98- as well.
90+ The other collaboration was with the maintainer of the shell interpreter. He
91+ agreed on having [ an official middleware] [ middleware ] to expose these core
92+ utilities. This means that other projects that use the shell interpreter can
93+ also benefit from this work, and as more utilities are included, those projects
94+ will benefit as well.
9995
10096## Can I choose whether to use them or not?
10197
@@ -112,25 +108,28 @@ env TASK_CORE_UTILS=1 task ...
112108env TASK_CORE_UTILS=0 task ...
113109```
114110
115- We'll consider making this enabled by default on all platforms in the future.
116- In the meantime, we're still using the system core utils on non-Windows
117- platforms to avoid regressions as the Go implementations may not be 100%
118- compatible with the system ones.
111+ We'll consider making this enabled by default on all platforms in the future. In
112+ the meantime, we're still using the system core utils on non-Windows platforms
113+ to avoid regressions as the Go implementations may not be 100% compatible with
114+ the system ones.
119115
120116## Feedback
121117
122118If you have any feedback about this feature, join our [ Discord server] [ discord ]
123119or [ open an issue] [ gh-issue ] on GitHub.
124120
125- Also, if Task is useful for you or your company, consider
126- [ sponsoring the project] [ sponsor ] !
121+ Also, if Task is useful for you or your company, consider [ sponsoring the
122+ project] [ sponsor ] !
127123
128124[ mvdan ] : https://github.com/mvdan/sh
129- [ mvdan-prs ] : https://github.com/mvdan/sh/pulls?q=is%3Apr+author%3Aandreynering+is%3Aclosed+sort%3Acreated-asc
125+ [ mvdan-prs] :
126+ https://github.com/mvdan/sh/pulls?q=is%3Apr+author%3Aandreynering+is%3Aclosed+sort%3Acreated-asc
130127[ u-root ] : https://github.com/u-root/u-root
131- [ uroot-interface ] : https://github.com/u-root/u-root/blob/main/pkg/core/command.go
128+ [ uroot-interface] :
129+ https://github.com/u-root/u-root/blob/main/pkg/core/command.go
132130[ uroot-base ] : https://github.com/u-root/u-root/blob/main/pkg/core/base.go
133- [ middleware ] : https://github.com/mvdan/sh/blob/master/moreinterp/coreutils/coreutils.go
131+ [ middleware] :
132+ https://github.com/mvdan/sh/blob/master/moreinterp/coreutils/coreutils.go
134133[ task-core-utils ] : /docs/reference/environment#task-core-utils
135134[ discord ] : https://discord.com/invite/6TY36E39UK
136135[ gh-issue ] : https://github.com/go-task/task/issues
0 commit comments