--- title: Command Line Interface Reference description: Complete reference for Task CLI commands, flags, and exit codes permalink: /reference/cli/ outline: deep --- # Command Line Interface Reference Task has multiple ways of being configured. These methods are parsed, in sequence, in the following order with the highest priority last: - [Configuration files](./config.md) - [Environment variables](./environment.md) - _Command-line flags_ In this document, we will look at the last of the three options, command-line flags. All CLI commands override their configuration file and environment variable equivalents. ## Format Task commands have the following syntax: ```bash task [options] [tasks...] [-- CLI_ARGS...] ``` ::: tip If `--` is given, all remaining arguments will be assigned to a special `CLI_ARGS` variable. ::: ## Commands ### `task [tasks...]` Run one or more tasks defined in your Taskfile. ```bash task build task test lint task deploy --force ``` ### `task --list` List all available tasks with their descriptions. ```bash task --list task -l ``` ### `task --list-all` List all tasks, including those without descriptions. ```bash task --list-all task -a ``` ### `task --init` Create a new Taskfile.yml in the current directory. ```bash task --init task -i ``` ::: tip Combine `--list` or `--list-all` with `--silent` (`-ls` or `-as` for shortants) to list only the task names in each line. Useful for scripting with `grep` or similar. ::: ## Options ### General #### `-h, --help` Show help information. ```bash task --help ``` #### `--version` Show Task version. ```bash task --version ``` #### `-v, --verbose` Enable verbose mode for detailed output. - **Config equivalent**: [`verbose`](./config.md#verbose) - **Environment variable**: [`TASK_VERBOSE`](./environment.md#task-verbose) ```bash task build --verbose ``` #### `-s, --silent` Disable command echoing. - **Config equivalent**: [`silent`](./config.md#silent) - **Environment variable**: [`TASK_SILENT`](./environment.md#task-silent) ```bash task deploy --silent ``` #### `--disable-fuzzy` Disable fuzzy matching for task names. When enabled, Task will not suggest similar task names when you mistype a task name. - **Config equivalent**: [`disable-fuzzy`](./config.md#disable-fuzzy) - **Environment variable**: [`TASK_DISABLE_FUZZY`](./environment.md#task-disable-fuzzy) ```bash task buidl --disable-fuzzy # Output: Task "buidl" does not exist # (without "Did you mean 'build'?" suggestion) ``` ### Execution Control #### `-F, --failfast` Stop executing dependencies as soon as one of them fails. - **Config equivalent**: [`failfast`](./config.md#failfast) - **Environment variable**: [`TASK_FAILFAST`](./environment.md#task-failfast) ```bash task build --failfast ``` #### `-f, --force` Force execution even when the task is up-to-date. ```bash task build --force ``` #### `-n, --dry` Compile and print tasks without executing them. - **Environment variable**: [`TASK_DRY`](./environment.md#task-dry) ```bash task deploy --dry ``` #### `-p, --parallel` Execute multiple tasks in parallel. ```bash task test lint --parallel ``` #### `-C, --concurrency ` Limit the number of concurrent tasks. Zero means unlimited. - **Config equivalent**: [`concurrency`](./config.md#concurrency) - **Environment variable**: [`TASK_CONCURRENCY`](./environment.md#task-concurrency) ```bash task test --concurrency 4 ``` #### `-x, --exit-code` Pass through the exit code of failed commands. ```bash task test --exit-code ``` ### File and Directory #### `-d, --dir ` Set the directory where Task will run and look for Taskfiles. ```bash task build --dir ./backend ``` #### `-t, --taskfile ` Specify a custom Taskfile path. ```bash task build --taskfile ./custom/Taskfile.yml ``` #### `-g, --global` Run the global Taskfile from `$HOME/Taskfile.{yml,yaml}`. ```bash task backup --global ``` ### Output Control #### `-o, --output ` Set output style. Available modes: `interleaved`, `group`, `prefixed`. ```bash task test --output group ``` #### `--output-group-begin