Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ae2aef7
Allow running help on/for other Taskfiles
Aug 8, 2025
f6f48ad
Document subTaskfiles
Aug 8, 2025
00ce5f0
Clarify naming of the two types
Aug 8, 2025
1717560
Remove "Remote Taskfile" type
Aug 8, 2025
9e5b72f
General typo-fixes
Feb 20, 2026
38494ce
Misc SubTaskfile text tweaks
Feb 20, 2026
198bb42
Tighten up SubTaskfile description
Feb 27, 2026
c140264
Clarify which comments in example are intended for what
Mar 20, 2026
38895dd
Show SubTaskfile calling task in SubTaskfile help output
Mar 20, 2026
bc07934
Make SubTaskfile task:_help output optional
Mar 20, 2026
5611655
Add SubTaskfile generator & seperate docs pages (#26)
rick-nu Mar 20, 2026
e60a5ff
Cleanup README content that has been split off to seperate docs pages
Mar 20, 2026
060903c
Update sub-taskfile docs page with changes from this branch
Mar 20, 2026
9f6d05a
Use more generically compatible hashbang
Mar 20, 2026
4b095f0
Cleanup shellcheck
Mar 20, 2026
42bd680
Add SubTaskfile sections to the generator
Mar 20, 2026
f057dae
Move SubTaskfile files to the addon folder
rick-nu Mar 21, 2026
9fa6d1e
All naming to SubTaskfile instead of Sub Taskfile
rick-nu Mar 21, 2026
dc60833
Improve code highlighting
rick-nu Mar 21, 2026
53e0fb2
Add subtask not found helper
rick-nu Mar 27, 2026
99f8eed
Remove optional command from subTaskfile
rick-nu Mar 27, 2026
218b049
Base functions are now included by default, never dynamically
rick-nu Mar 27, 2026
4f35b12
Fix final styling for the generator
rick-nu Mar 27, 2026
7d86437
Improve SubTaskfile documentation
rick-nu Mar 27, 2026
0bd0d8b
Another prettier fix
rick-nu Mar 27, 2026
f3995d7
Fix copy paste issue
rick-nu Mar 27, 2026
0f2b29a
Add interface window titles
rick-nu Mar 27, 2026
d0862f8
Provide a single but clear SubTaskfile example function
rick-nu Mar 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 9 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Taskfile ([taskfile.sh](https://taskfile.sh))

A `./Taskfile` is a task runner in plain and easy [Bash](https://nl.wikipedia.org/wiki/Bash). It adds a list of
available tasks to your project.
A `./Taskfile` is a task runner in plain and easy [Bash](<https://en.wikipedia.org/wiki/Bash_(Unix_shell)>). It adds a
list of available tasks to your project.

Generate your own Taskfile at [taskfile.sh](https://taskfile.sh).

Expand All @@ -14,81 +14,21 @@ Generate your own Taskfile at [taskfile.sh](https://taskfile.sh).
- Very easy to use
- Automate your most common tasks (updating, starting, building, etc...)
- Easy to understand and maintain
- Automatically generated list of available task
- Automatically generated list of available tasks

# How does it work?
## Documentation

Taskfiles are simple bash scripts, but an easy-to-read function format. There are some things that we need to explain
for our Taskfile setup. It all starts with a `Taskfile`. Download your `Taskfile` from
[taskfile.sh](https://taskfile.sh) and save it. Make sure the Taskfile is executable: `chmod +x ./Taskfile`. You can now
run `./Taskfile` in your terminal.

## Tasks

A task is defined by creating a function that starts with `task:`. This defines a task that can be triggered by running
the `./Taskfile`. Right next to the task, you should add a task definition with two hashes. This will let the
`task:help` function know that you're writing the task function definition. So an example task will look like the
following:

```shell
function task:example { ## Show some example text
title "Example"
echo "This is an example task."
}
```

In a task you can call other functions, and run all tooling you desire. Now running `./Taskfile example` will execute
the new task.

## Sections

To group multiple tasks, sections can be created in your Taskfile. A section is created by creating a comment line with
a double hashtag like so:

```shell
## Project section
```

Lines with only a single `#` will not appear as section in `task:help` and can be seen as plain comments.

## Help command

Running `./Taskfile help`, the `task:help` function is triggered. This task will list all available sections and tasks
using the double `##` comments you've learned about above. Now it's clear how you can run any other task!

# Auto-completion

Autocompletion works when you use `zsh` and `oh-my-zsh`. Create the following file in your oh-my-zsh directory
`~/.oh-my-zsh/completions/_task.zsh`:

```shell
#compdef task

_task() {
local -a commands
local tasks=$(task comp_targets)

while IFS= read -r line; do
if [[ -n "$line" ]]; then
commands+=("$line")
fi
done <<< "$tasks"

_describe -t commands 'task commands' commands
}

_task "$@"
```

Now after running `task shorthand`, your `task` commands will get autocompleted.
- [How does it work](/docs/how-does-it-work.md)
- [Auto completion](/docs/auto-completion.md)
- [SubTaskfiles](/docs/sub-taskfiles.md)

# Credits

This Taskfile setup is based on [Adrian Cooney's Taskfile](https://github.com/adriancooney/Taskfile) and is widely
adopted by [Enrise](https://enrise.com) in our modified flavour.
adopted by [Enrise](https://enrise.com) in our modified flavor.

# Contributors

A big thanks to all the contributors of Taskfile!

![contirubtor avatars](https://contrib.rocks/image?repo=enrise/taskfile)
![contributor avatars](https://contrib.rocks/image?repo=enrise/taskfile)
2 changes: 1 addition & 1 deletion dev/linting/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ export default [
},
},
{
ignores: ['.next/', 'out/'],
ignores: ['.next/', 'out/', 'next-env.d.ts'],
},
];
25 changes: 25 additions & 0 deletions docs/auto-completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Auto-completion

Autocompletion works when you use `zsh` and `oh-my-zsh`. Create the following file in your oh-my-zsh directory
`~/.oh-my-zsh/completions/_task.zsh`:

```shell
#compdef task

_task() {
local -a commands
local tasks=$(task comp_targets)

while IFS= read -r line; do
if [[ -n "$line" ]]; then
commands+=("$line")
fi
done <<< "$tasks"

_describe -t commands 'task commands' commands
}

_task "$@"
```

Now after running `task shorthand`, your `task` commands will get autocompleted.
39 changes: 39 additions & 0 deletions docs/how-does-it-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# How does it work?

Taskfiles are simple bash scripts, but an easy-to-read function format. There are some things that we need to explain
for our Taskfile setup. It all starts with a `Taskfile`. Download your `Taskfile` from
[taskfile.sh](https://taskfile.sh) and save it. Make sure the Taskfile is executable: `chmod +x ./Taskfile`. You can now
run `./Taskfile` in your terminal.

## Tasks

A task is defined by creating a function that starts with `task:`. This defines a task that can be triggered by running
the `./Taskfile`. Right next to the task, you should add a task definition with two hashes. This will let the
`task:help` function know that you're writing the task function definition. So an example task will look like the
following:

```shell
function task:example { ## Show some example text
title "Example"
echo "This is an example task."
}
```

In a task you can call other functions, and run all tooling you desire. Now running `./Taskfile example` will execute
the new task.

## Sections

To group multiple tasks, sections can be created in your Taskfile. A section is created by creating a comment line with
a double hashtag like so:

```shell
## Project section
```

Lines with only a single `#` will not appear as section in `task:help` and can be seen as plain comments.

## Help command

Running `./Taskfile help`, the `task:help` function is triggered. This task will list all available sections and tasks
using the double `##` comments you've learned about above. Now it's clear how you can run any other task!
55 changes: 55 additions & 0 deletions docs/sub-taskfiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# SubTaskfiles

SubTaskfiles allow you to divide your tasks across multiple files while still calling them from a single entrypoint (a
familiar, regular Taskfile).

Use them to split off groups of tasks that can be logically grouped together, like for specific use-cases or because
they are rarely used. For example: git-hooks, frontend- / backend-specific tasks, tasks for (infrequently occurring)
procedures, CI-only tasks, etc.

Tasks in SubTaskfiles are never called directly, but "via" a task in the root Taskfile, like this:
`Usage: ./Taskfile foo <task> <args>`

## Live example

In the Taskfile generator, you can check the "Include SubTaskfile example" checkbox, to see a full implementation
example.

## How does it work

When you generate a new Taskfile via the Taskfile generator, you have a `subtaskfile` proxy function available to you.
That allows you to create a new task to open your `SubTaskfile` from your `Taskfile`:

```shell
function task:name-of-your-subtask { ## Run a sub-task
subtaskfile "name-of-your-subtask" "./folder-name" "$@"
}
```

Then, create a file named `SubTaskfile` in a relevant location (in the example above we have `folder-name/SubTaskfile`).
Only the tasks that are relevant for this specific part of you application, go in here.

**No need to redefine anything that's already in your primary Taskfile.**

```shell
#!/usr/bin/env bash

function task:example { ## This is an example sub task
title "Run example sub task"
echo -e "./SubTaskfile location: ${YELLOW}$SUBTASKFILE_PATH${RESET}"
echo -e "${GREEN}Success!${RESET}"
}
```

Optionally, you can include an explicit helper function for your SubTaskfile output too.

```shell
function task:subtask-help { ## Show all available sub-tasks
task:help
}
```

## Note

If you use the same task name in your SubTaskfile as what was already defined in the primary Taskfile, the task will be
overwritten.
14 changes: 14 additions & 0 deletions src/app/docs/auto-completion/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Metadata } from 'next';
import Content from '@/components/Content';

import markdown from '@/../docs/auto-completion.md';

export const generateMetadata = (): Metadata => ({
title: 'Auto completion • taskfile.sh',
description:
'Quickly kick start your project by moving all your development commands to one easy to understand and maintain place.',
});

export default function Page() {
return <Content content={markdown} />;
}
14 changes: 14 additions & 0 deletions src/app/docs/how-does-it-work/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Metadata } from 'next';
import Content from '@/components/Content';

import markdown from '@/../docs/how-does-it-work.md';

export const generateMetadata = (): Metadata => ({
title: 'How does it work? • taskfile.sh',
description:
'Quickly kick start your project by moving all your development commands to one easy to understand and maintain place.',
});

export default function Page() {
return <Content content={markdown} />;
}
2 changes: 1 addition & 1 deletion src/app/about/page.tsx → src/app/docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Content from '@/components/Content';
import readme from '@/../README.md';

export const generateMetadata = (): Metadata => ({
title: 'Information • taskfile.sh',
title: 'Documentation • taskfile.sh',
description:
'Quickly kick start your project by moving all your development commands to one easy to understand and maintain place.',
});
Expand Down
14 changes: 14 additions & 0 deletions src/app/docs/sub-taskfiles/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Metadata } from 'next';
import Content from '@/components/Content';

import markdown from '@/../docs/sub-taskfiles.md';

export const generateMetadata = (): Metadata => ({
title: 'SubTaskfiles • taskfile.sh',
description:
'Quickly kick start your project by moving all your development commands to one easy to understand and maintain place.',
});

export default function Page() {
return <Content content={markdown} />;
}
12 changes: 6 additions & 6 deletions src/app/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
}

body {
background: #ff00cc; /* fallback for old browsers */
background: -webkit-linear-gradient(to left, #ff00cc, #333399); /* Chrome 10-25, Safari 5.1-6 */
background: $color-yellow-50; /* fallback for old browsers */
background: linear-gradient(
to left,
#ff00cc,
#333399
220deg,
$color-yellow-50,
$color-purple-50,
$color-black
); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
font-family: var(--font-text), sans-serif;
}
Expand All @@ -25,7 +25,7 @@ pre {
}

a {
color: $color-blue-50;
color: $color-purple-50;
text-decoration: none;
}

Expand Down
Loading
Loading