<code>CLI_ARGS</code> variable</p></div></div><table><thead><tr><th>Short</th><th>Flag</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>-c</code></td><td><code>--color</code></td><td><code>bool</code></td><td><code>true</code></td><td>Colored output. Enabled by default. Set flag to <code>false</code> or use <code>NO_COLOR=1</code> to disable.</td></tr><tr><td><code>-C</code></td><td><code>--concurrency</code></td><td><code>int</code></td><td><code>0</code></td><td>Limit number tasks to run concurrently. Zero means unlimited.</td></tr><tr><td><code>-d</code></td><td><code>--dir</code></td><td><code>string</code></td><td>Working directory</td><td>Sets directory of execution.</td></tr><tr><td><code>-n</code></td><td><code>--dry</code></td><td><code>bool</code></td><td><code>false</code></td><td>Compiles and prints tasks in the order that they would be run, without executing them.</td></tr><tr><td><code>-x</code></td><td><code>--exit-code</code></td><td><code>bool</code></td><td><code>false</code></td><td>Pass-through the exit code of the task command.</td></tr><tr><td><code>-f</code></td><td><code>--force</code></td><td><code>bool</code></td><td><code>false</code></td><td>Forces execution even when the task is up-to-date.</td></tr><tr><td><code>-g</code></td><td><code>--global</code></td><td><code>bool</code></td><td><code>false</code></td><td>Runs global Taskfile, from <code>$HOME/Taskfile.{yml,yaml}</code>.</td></tr><tr><td><code>-h</code></td><td><code>--help</code></td><td><code>bool</code></td><td><code>false</code></td><td>Shows Task usage.</td></tr><tr><td><code>-i</code></td><td><code>--init</code></td><td><code>bool</code></td><td><code>false</code></td><td>Creates a new Taskfile.yml in the current folder.</td></tr><tr><td><code>-I</code></td><td><code>--interval</code></td><td><code>string</code></td><td><code>5s</code></td><td>Sets a different watch interval when using <code>--watch</code>, the default being 5 seconds. This string should be a valid <ahref="https://pkg.go.dev/time#ParseDuration"target="_blank"rel="noopener noreferrer">Go Duration</a>.</td></tr><tr><td><code>-l</code></td><td><code>--list</code></td><td><code>bool</code></td><td><code>false</code></td><td>Lists tasks with description of current Taskfile.</td></tr><tr><td><code>-a</code></td><td><code>--list-all</code></td><td><code>bool</code></td><td><code>false</code></td><td>Lists tasks with or without a description.</td></tr><tr><td></td><td><code>--sort</code></td><td><code>string</code></td><td><code>default</code></td><td>Changes the order of the tasks when listed.<br><code>default</code> - Alphanumeric with root tasks first<br><code>alphanumeric</code> - Alphanumeric<br><code>none</code> - No sorting (As they appear in the Taskfile)</td></tr><tr><td></td><td><code>--json</code></td><td><code>bool</code></td><td><code>false</code></td><td>See <ahref="#json-output">JSON Output</a></td></tr><tr><td><code>-o</code></td><td><code>--output</code></td><td><code>string</code></td><td>Default set in the Taskfile or <code>intervealed</code></td><td>Sets output style: <!---->[<code>interleaved</code>/<code>group</code>/<code>prefixed</code>]<!---->.</td></tr><tr><td></td><td><code>--output-group-begin</code></td><td><code>string</code></td><td></td><td>Message template to print before a task's grouped output.</td></tr><tr><td></td><td><code>--output-group-end</code></td><td><code>string</code></td><td></td><td>Message template to print after a task's grouped output.</td></tr><tr><td></td><td><code>--output-group-error-only</code></td><td><code>bool</code></td><td><code>false</code></td><td>Swallow command output on zero exit code.</td></tr><tr><td><code>-p</code></td><td><code>--parallel</code></td><td><code>bool</code></td><td><code>false</code></td><td>Executes tasks provided on command line in parallel.</td></tr><tr><td><code>-s</code></td><td><code>--silent</code></td><td><code>bool</code></td><td><code>false</code></td><td>Disables echoing.</td></tr><tr><td><code>-y</code></td><td><code>--yes
three groups with the following ranges:</p><ul><li>General errors (0-99)</li><li>Taskfile errors (100-199)</li><li>Task errors (200-299)</li></ul><p>A full list of the exit codes and their descriptions can be found below:</p><table><thead><tr><th>Code</th><th>Description</th></tr></thead><tbody><tr><td>0</td><td>Success</td></tr><tr><td>1</td><td>An unknown error occurred</td></tr><tr><td>100</td><td>No Taskfile was found</td></tr><tr><td>101</td><td>A Taskfile already exists when trying to initialize one</td></tr><tr><td>102</td><td>The Taskfile is invalid or cannot be parsed</td></tr><tr><td>200</td><td>The specified task could not be found</td></tr><tr><td>201</td><td>An error occurred while executing a command inside of a task</td></tr><tr><td>202</td><td>The user tried to invoke a task that is internal</td></tr><tr><td>203</td><td>There a multiple tasks with the same name or alias</td></tr><tr><td>204</td><td>A task was called too many times</td></tr><tr><td>205</td><td>A task was cancelled by the user</td></tr></tbody></table><p>These codes can also be found in the repository in
<ahref="https://github.com/go-task/task/blob/main/errors/errors.go"target="_blank"rel="noopener noreferrer"><code>errors/errors.go</code></a>.</p><divclass="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><divclass="admonitionHeading_tbUL"><spanclass="admonitionIcon_kALy"><svgviewBox="0 0 14 16"><pathfill-rule="evenodd"d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><divclass="admonitionContent_S0QG"><p>When Task is run with the <code>-x</code>/<code>--exit-code</code> flag, the exit code of any failed
commands will be passed through to the user instead.</p></div></div><h2class="anchor anchorWithStickyNavbar_LWe7"id="json-output">JSON Output<ahref="#json-output"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h2><p>When using the <code>--json</code> flag in combination with either the <code>--list</code> or
<code>cmds</code> and everything else will be set to their default values:</p><divclass="language-yaml codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-yaml codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#393A34"><spanclass="token key atrule"style="color:#22863A">tasks</span><spanclass="token punctuation"style="color:#393A34">:</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token key atrule"style="color:#22863A">foo</span><spanclass="token punctuation"style="color:#393A34">:</span><spanclass="token plain"> echo "foo"</span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"style="display:inline-block"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token key atrule"style="color:#22863A">foobar</span><spanclass="token punctuation"style="color:#393A34">:</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token punctuation"style="color:#393A34">-</span><spanclass="token plain"> echo "foo"</span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token punctuation"style="color:#393A34">-</span><spanclass="token plain"> echo "bar"</span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"style="display:inline-block"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token key atrule"style="color:#22863A">baz</span><spanclass="token punctuation"style="color:#393A34">:</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token key atrule"style="color:#22863A">cmd</span><spanclass="token punctuation"style="color:#393A34">:</span><spanclass="token plain"> echo "baz"</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div><h4class="anchor anchorWithStickyNavbar_LWe7"id="command">Command<ahref="#command"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h4><table><thead><tr><th>Attribute</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>cmd</code></td><td><code>string</code></td><td></td><td>The shell command to be executed.</td></tr><tr><td><code>silent</code></td><td><code>bool</code></td><td><code>false</code></td><td>Skips some output for this command. Note that STDOUT and STDERR of the commands will still be redirected.</td></tr><tr><td><code>task</code></td><td><code>string</code></td><td></td><td>Set this to trigger execution of another task instead of running a command. This cannot be set together with <code>cmd</code>.</td></tr><tr><td><code>vars</code></td><td><ahref="#variable"><code>map[string]Variable</code></a></td><td></td><td>Optional additional variables to be passed to the referenced task. Only relevant when setting <code>task</code> instead of <code>cmd</code>.</td></tr><tr><td><code>ignore_error</code></td><td><code>bool</code></td><td><code>false</code></td><td>Continue execution if errors happen while executing the command.</td><