Skip to content

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.")

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

rows+=("open-url|<url>|Open url.")

setup-completion

rows+=("setup-completion|[shell]|Show shell completion instructions.")

list-aliases

rows+=("list-aliases|[grep]|List all library command aliases.")

check-help-width

rows+=("check-help-width||Show help lines that exceed terminal width.")

update-project

rows+=("update-project|[--agents]|Update the project taskfile from template.")

Files

Managing files and directories.

ensure-directory

rows+=("ensure-directory|<path>|Ensure directory path exists.")
rows+=("create-symlink|<source><target>|Remove existing file/directory and create symlink.")
rows+=("create-symlink-files|<source><target>|Create symlink for files in source pattern.")

copy-to-clipboard

rows+=("copy-to-clipboard||Copy stdin to clipboard.")

Python

Setup Python virtual enviroment.

activate-venv

rows+=("activate-venv||Activate or initialize Python virtual env.")

remove-venv

rows+=("remove-venv||Remove the Python virtual env.")

Jupyter

Setup and run Jupyter notebooks.

start-jupyter-lab

rows+=("start-jupyter-lab|[env]|Start Jupyter Lab server.")

install-jupyter-lab

rows+=("install-jupyter-lab||Install Jupyter Lab and dependencies.")

run-jupyter-notebook

rows+=("run-jupyter-notebook|<path>[env]|Execute notebook with papermill.")

Environment

Manage .env files in the task dotenv dir and the current project.

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

Dotenv files with sops markers are encrypted with sops and age.

create-dotenv

rows+=("create-dotenv|<env><template>[-g]|Create .env file from templates.")

Available templates are defined in templates/:

nextcloud.env.template  odoo.env.template  upgrade.env.template

By default the .env file is created in the current directory. Use the -g / --global flag to store it in TASK_DOTENV_DIR instead.

Use the -s / --secret flag to encrypt the file with sops after creation. This requires .sops.yaml to be configured (see init-dotenv-sops).

list-dotenv

rows+=("list-dotenv||List dotenv files.")

Lists *.env and legacy .env.* files from TASK_DOTENV_DIR and the current directory.

show-dotenv

rows+=("show-dotenv|<env>|Output content of the .env file(s).")

Accepts a single env name or a comma-separated list of env names. Files with sops markers are decrypted with sops before printing.

copy-dotenv

rows+=("copy-dotenv|<env><env>|Copy .env file.")

edit-dotenv

rows+=("edit-dotenv|<env>|Open .env file in default editor.")

Files with sops markers are opened with sops for decrypted editing.

load-dotenv

rows+=("load-dotenv|<env>|Load and export .env file(s).")

Accepts a single env name or a comma-separated list of env names. All variables from each file are exported using set -a / set +a. Files with sops markers are decrypted with sops before sourcing.

init-dotenv-sops

rows+=("init-dotenv-sops||Initialize age key and sops config.")

Generates an age key for the project based on the git URL and creates .sops.yaml. The private key is appended to the sops default location ~/.config/sops/age/keys.txt. A custom key name can be given as the first argument; the default is the project name.

init-agekey-sops

rows+=("init-agekey-sops|[name]|Generate age key without encryption rule.")

Generates an age key for the project based on the git URL, but unlike init-dotenv-sops it does not create .sops.yaml or configure a file encryption rule. The private key is appended to ~/.config/sops/age/keys.txt. A custom key name can be given as the first argument; the default is the project name.

list-agekeys

rows+=("list-agekeys||List age keys from the default key file.")

Lists the public keys, names and creation dates from ~/.config/sops/age/keys.txt.

show-project-setup

rows+=("show-project-setup||Show project setup info.")

Displays the project name, dotenv, KeePass / Pass entries, age key file, age public key, .sops.yaml config and SOPS_AGE_KEY status.

rename-dotenv

rows+=("rename-dotenv|<env><env>|Rename .env file.")

remove-dotenv

rows+=("remove-dotenv|<env>|Remove .env file.")

backup-dotenv-files

rows+=("backup-dotenv-files|<path>|Archive .env files to target.")

restore-dotenv-files

rows+=("restore-dotenv-files|<path>|Extract and copy .env files from backup.")

LLM

Commands that integrate the llm cli.

commit-with-llm

rows+=("commit-with-llm||Commit with llm generated commit message.")

update-with-llm

rows+=("update-with-llm|<glob><prompt>|Feed files matching glob to llm.")

The last parameter can be either a direct prompt string or a path to a text file containing the prompt.

update-changelog-with-llm

rows+=("update-changelog-with-llm|[num_lines]|Update CHANGELOG.md from git diff using llm.")

Prompt

Create and track prompt.md files.

init-prompt-log

rows+=("init-prompt-log||Initialize prompt-log branch and worktree.")

pull-prompt-log

rows+=("pull-prompt-log|[repo-path]|Pull prompt-log from origin.")

create-prompt

rows+=("create-prompt|<title>[repo-path]|Create prompt.md from template.")

prompt-with-pi

rows+=("prompt-with-pi|[-l][-m][path]|Run pi with prompt.md.")

Use the -l / --load flag to run load-prompt before starting pi. When -l is given without -f, prompts with state: completed are filtered out.

Use the -m / --model flag to select a model from an fzf dialog. The available models are read from ~/.pi/agent/models.json and pi is started with the selected model.

commit-prompt

rows+=("commit-prompt|[repo-path]|Commit prompt.md to prompt-log branch.")

list-prompts

rows+=("list-prompts|[repo-path]|List prompts from prompt-log branch.")

reset-prompt

rows+=("reset-prompt|[path]|Reset project and keep ## Task section.")

Copies the ## Task section, runs git checkout . and git clean -df, then re-applies the task section.

load-prompt

rows+=("load-prompt|[-f <expr>][repo-path]|Load prompt from prompt-log into prompt.md.")

Use -f / --filter with a frontmatter expression like state != completed. Supported operators: ==, !=, =~ (regex).

edit-prompt

rows+=("edit-prompt|[commit][repo-path]|Edit prompt in prompt-log worktree.")

show-prompt

rows+=("show-prompt|[commit][repo-path]|Show prompt content from prompt-log.")

delete-prompt

rows+=("delete-prompt|[commit][repo-path]|Delete prompt from prompt-log.")

cancel-prompt

rows+=("cancel-prompt|[repo-path]|Cancel prompt and set state to cancelled.")

Shows an fzf dialog with all non-completed prompts and sets the selected prompt's state to cancelled.

convert-prompts-folder-to-prompt-log

rows+=("convert-prompts-folder-to-prompt-log|[repo-path]|Convert prompts folder to prompt-log branch.")

Logging

Colorful logging in task commands.

log-error

rows+=("log-error||Colored output for errors.")

log-success

rows+=("log-success||Colored output for success.")

log-warning

rows+=("log-warning||Colored output for warnings.")

Git

These commands replace the git submodule command. The commands store and retrieve additional information from the .gitmodules file.

add-git-folder

rows+=("add-git-folder|<url><branch><path>|Add git folder to .gitmodules.")

add-git-merge

rows+=("add-git-merge|<remote><merge><path>|Add git merge ref in .gitmodules.")

add-git-remote

rows+=("add-git-remote|<remote><url><path>|Add git remote to git folder.")

merge-git-remote

rows+=("merge-git-remote||Merge remotes and refs in .gitmodules.")

aggregate-git-folders

rows+=("aggregate-git-folders|<path>|Run gitaggregate for the repos.yaml.")

commit-git-folder

rows+=("commit-git-folder|<path><message>|Commit changes of git folders.")

clean-git-folder

rows+=("clean-git-folder|<path>|Clean git folder.")

checkout-git-folder

rows+=("checkout-git-folder|<branch><path>|Checkout git commit or branch.")

clone-git-folder

rows+=("clone-git-folder|<path>|Clone git folder.")

download-git-folder

rows+=("download-git-folder|<path>|Download git folder.")

find-git-folder

rows+=("find-git-folder|<path>|Find all .git folders in path.")

generate-ssh-key

rows+=("generate-ssh-key||Generate ssh key pair.")

list-git-folder

rows+=("list-git-folder|<path>|List path and url of git folders.")

ls-git-folder

rows+=("ls-git-folder|<path>|List git folders.")

pull-git-folder

rows+=("pull-git-folder|<branch><path>|Pull all git folders.")

pull-all-repos

rows+=("pull-all-repos||Pull all git repos.")

switch-git-folder

rows+=("switch-git-folder|<branch><path>|Switch branch for git folders.")

push-git-folder

rows+=("push-git-folder|<path>|Push all git folders.")

remove-git-folder

rows+=("remove-git-folder|<path>|Remove git folders in path.")

reset-git-folder

rows+=("reset-git-folder|<path>|Abort and reset git folders.")

run-pre-commit

rows+=("run-pre-commit|<path>|Run pre-commit in path.")

stage-git-folder

rows+=("stage-git-folder|<path>|Stage all files in git folders.")

status-git-folder

rows+=("status-git-folder|<path>|Show status of git folders.")

status-all-repos

rows+=("status-all-repos||Show status of all git repos.")

save-git-folder

rows+=("save-git-folder||Save commit refs to .gitmodules.")

update-submodule

rows+=("update-submodule||Update git submodules.")

unshallow-git-folder

rows+=("unshallow-git-folder||Fetch with unshallow and fix config.")

KeePass

Load and store secrets from KeePassXC. Set path to KeePassXC database and entry:

KEEPASS_DATABASE_FILE="/path/to/database.kdbx"
KEEPASS_DATABASE_KEY_FILE="/path/to/keepass.key"

The name of the entry will resolve dynamically depending on the current directory / project. Use show-dotenv to show info about the dotenv setup.

save-pass-to-keepass

rows+=("save-pass-to-keepass|<pass><entry>|Store password to KeePass entry.")

get-pass-from-keepass

rows+=("get-pass-from-keepass|<entry>[password]|Get password from KeePass entry.")

If a database password is provided as the second argument, it is piped to keepassxc-cli.

save-dotenv-to-keepass

rows+=("save-dotenv-to-keepass|[file]|Store content of .env in KeePass entry.")

load-dotenv-from-keepass

rows+=("load-dotenv-from-keepass|[file]|Restore content to .env from KeePass entry.")

store-agekey-to-keepass

rows+=("store-agekey-to-keepass|[name]|Store age key for the project in KeePass.")

Reads the key block matching the public key from .sops.yaml, stores the secret key in the entry's password field and attaches the key block as keys.txt. Defaults to the project name.

load-agekey-from-keepass

rows+=("load-agekey-from-keepass|[name]|Restore age private key from KeePass.")

Restores the age key attachment from the age/<name> KeePass entry and merges it into ~/.config/sops/age/keys.txt. Defaults to the project name.

Kubernetes

Manage kube config files.

save-kubeconfig-to-keepass

rows+=("save-kubeconfig-to-keepass|[ctx]|Save kubeconfig file in KeePass.")

load-kubeconfig-from-keepass

rows+=("load-kubeconfig-from-keepass|[ctx]|Load kubeconfig file from KeePass.")

Docker

Build and push Docker images. Set Docker env vars.

BUILDX_PLATFORM="linux/amd64"
CONTAINER_REGISTRY="mintsystem"
CONTAINER_TAG="taskfile.build:latest"
DOCKERFILE="image/Dockerfile"
DOCKER_CONFIG="$HOME/.docker/$CONTAINER_REGISTRY/"

login-docker

rows+=("login-docker|[user][token]|Run Docker login and create docker config.")

build-image

rows+=("build-image|[output]|Build Docker image with buildx.")

Ansible

Install scripts from the Ansible Build project.

The available roles with scripts are listed here: https://ansible.build/scripts.html

install-ansible-build-scripts

rows+=("install-ansible-build-scripts|<role>|Install scripts of the role.")

11ty

Build static sites with 11ty.

init-11ty-docs

rows+=("init-11ty-docs||Install 11ty with pnpm.")

dev-11ty-docs

rows+=("dev-11ty-docs||Run 11ty development server.")

build-11ty-docs

rows+=("build-11ty-docs||Build the 11ty website.")

serve-11ty-docs

rows+=("serve-11ty-docs||Serve the 11ty output folder.")

Zensical

Build static sites with Zensical.

init-zensical-docs

rows+=("init-zensical-docs||Initialize Zensical documentation build deps.")

dev-zensical-docs

rows+=("dev-zensical-docs||Run Zensical development server.")

build-zensical-docs

rows+=("build-zensical-docs||Build the Zensical docs site.")

serve-zensical-docs

rows+=("serve-zensical-docs||Serve the Zensical documentation build.")

Vitepress

Build static sites with Vitepress.

init-vitepress-docs

rows+=("init-vitepress-docs||Install Vitepress build dependencies.")

dev-vitepress-docs

rows+=("dev-vitepress-docs||Start Vitepress development server.")

build-vitepress-docs

rows+=("build-vitepress-docs||Create Vitepress build.")

serve-vitepress-docs

rows+=("serve-vitepress-docs||Serve Vitepress build.")

Vuepress

Build static sites with Vuepress.

init-vuepress-docs

rows+=("init-vuepress-docs||Install Vuepress build dependencies.")

dev-vuepress-docs

rows+=("dev-vuepress-docs||Start Vuepress development server.")

build-vuepress-docs

rows+=("build-vuepress-docs||Create Vuepress build.")

serve-vuepress-docs

rows+=("serve-vuepress-docs||Serve Vuepress build.")

Hugo

Build static sites with Hugo.

Set Hugo env vars:

HUGO_VERSION="0.153.5" # Default: 0.153.5
BASE_URL="http://localhost:1313" # Default: http://localhost:1313

install-hugo

rows+=("install-hugo||Install Hugo from binary source.")

dev-hugo-site

rows+=("dev-hugo-site|[url]|Start Hugo dev server.")

build-hugo-site

rows+=("build-hugo-site|[url]|Build with Hugo.")

serve-hugo-site

rows+=("serve-hugo-site||Serve output from public folder.")