Skip to main content
You can forward CLI arguments to a command in Taskfile using the -- syntax. Arguments passed after -- are available in the task via the {{.CLI_ARGS}} variable.
Taskfile.yaml
version: '3'
tasks:
  example:
    cmds:
      - npm {{.CLI_ARGS}}
task example -- install
This runs npm install — the install argument is forwarded via {{.CLI_ARGS}}.
Use {{.CLI_ARGS}} anywhere in your cmds to inject the forwarded arguments.

Build docs developers (and LLMs) love