Variable: projectile-tasks

projectile-tasks is a customizable variable defined in projectile.el.

Value

nil

Documentation

An alist of named tasks that can be run with projectile-run-task.

Each entry has the form (TASK-NAME . COMMAND), where TASK-NAME is a string and COMMAND is either a shell command string or a function called with no arguments (and default-directory set to the project root) that returns such a string.

Command strings support the same %p placeholder as the lifecycle commands; it's replaced with the project name at execution time.

The variable can be set globally, per project type (see the :tasks keyword of projectile-register-project-type), or per project via
.dir-locals.el, which makes the tasks shareable through your VCS.
Entries here override same-named tasks defined by the project type
(see projectile-project-tasks).

Note that only string commands are safe as a directory-local value; tasks with function commands have to be defined globally or via a project type.

This variable was added, or its default value changed, in projectile version 3.1.0.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defcustom projectile-tasks nil
  "An alist of named tasks that can be run with `projectile-run-task'.

Each entry has the form (TASK-NAME . COMMAND), where TASK-NAME is a
string and COMMAND is either a shell command string or a function
called with no arguments (and `default-directory' set to the project
root) that returns such a string.

Command strings support the same `%p' placeholder as the lifecycle
commands; it's replaced with the project name at execution time.

The variable can be set globally, per project type (see the `:tasks'
keyword of `projectile-register-project-type'), or per project via
.dir-locals.el, which makes the tasks shareable through your VCS.
Entries here override same-named tasks defined by the project type
\(see `projectile-project-tasks').

Note that only string commands are safe as a directory-local value;
tasks with function commands have to be defined globally or via a
project type."
  :group 'projectile
  :type '(alist :key-type (string :tag "Task name")
                :value-type (choice (string :tag "Shell command")
                                    (function :tag "Function returning a shell command")))
  :safe #'projectile-tasks-safe-p
  :package-version '(projectile . "3.1.0"))