Enabling a Task


Tasks can be enabled depending on the variables programmatically. This enables to create of tasks that are dependent on the context.

Task enabling is determined upon the initial run of the Listr when you actually create the class for a given subtask, so be careful with using it while using internal context variables.

After that when the execution time comes for the given task, it will get re-evaluated.


Please refer to examples section for more detailed and further examples.
new Listr<Ctx>(
      title: 'This task will execute.',
      task: (ctx): void => {
        ctx.skip = true

      title: 'This task will never execute.',
      enabled: (ctx): boolean => !ctx.skip,
      task: (): void => {}
  { concurrent: false }


Default Renderer

  • Not enabled tasks will not be renderer in the default renderer.
Edit this page on GitHub Updated at Tue, Feb 1, 2022