Files
git.taskfile.build/docs/library.md
T

16 KiB

Library

In your Taskfile source commands from the taskfile.build library by adding:

if [[ -d "$HOME/taskfile.build/bin" ]]; then
    for file in "$HOME/taskfile.build/bin/"*; do
        if [[ -f "$file" ]]; then
            source "$file"
        fi
    done
fi

With these instructions you have access to all commands documented on this page.

Aliases

Every command in the library also set an alias derived from the first letters of each word. For example, commit-with-llm can also be invoked as cwl.

Aliases are appended to each script and pass through arguments:

cwl() {
    commit-with-llm "$@"
}

If two commands would map to the same alias, the alias is extended with additional letters from the first conflicting word until it is unique. Aliases that would shadow standard shell commands (e.g. cd, ls, cp) are also extended to avoid collisions.

Run task list-aliases to list all aliases.

av='activate-venv'
agf='add-git-folder'
agm='add-git-merge'
agr='add-git-remote'
aggf='aggregate-git-folders'

Task

Most commands can be configured by setting enviroment vars.

OPEN_BROWSER=False # Default: True
TASK_DOTENV_DIR="$HOME/Odoo-Build/config" # Default: "$HOME/.config/taskfile.build"

clone-taskfile

rows+=("clone-taskfile||Clone the taskfile.build repo.")

init-project

rows+=("init-project||Setup a taskfile project in the current directory.")

init-dotenv-dir

rows+=("init-dotenv-dir||Setup task dotenv dir.")

template-dotenv

rows+=("template-dotenv||Generate .env from .env.template.")

open-with-os

rows+=("open-with-os|<path>|Open file or url with default application.")

open-url