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'

Project

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"
rows+=("clone-taskfile||Clone the taskfile.build repo.")
rows+=("init-project||Setup a taskfile project.")
rows+=("init-dotenv-dir||Setup task dotenv dir.")
rows+=("template-dotenv||Generate .env from .env.template.")
rows+=("open-with-os|<path>|Open file or url with default application.")
rows+=("open-url|<url>|Open url.")
rows+=("setup-completion|[shell]|Show shell completion instructions.")
rows+=("list-aliases|[grep]|List all library command aliases.")
rows+=("check-help-width||Show help lines that exceed terminal width.")
rows+=("update-project|[AGENTS.md][.gitignore]|Update the project taskfile.")
rows+=("template-project-task|[path]|Assemble task file from template.")
rows+=("template-project-agents|[path]|Assemble AGENTS.md from template.")
rows+=("template-project-gitignore|[path]|Assemble .gitignore from template.")
rows+=("template-project-license|[path]|Assemble LICENSE from template.")
rows+=("get-project-name||Print resolved project name.")

clone-taskfile

init-project

init-dotenv-dir

template-dotenv

open-with-os

open-url

setup-completion

list-aliases

check-help-width

update-project

template-project-task

template-project-agents

template-project-gitignore

template-project-license

get-project-name

Resolves the project name. Priority: $PROJECT_NAME, git remote origin URL basename, current directory name.

Files

Managing files and directories.

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

ensure-directory

create-symlink

create-symlink-files

copy-to-clipboard

Markdown

Read and write YAML frontmatter values in Markdown files.

rows+=("get-frontmatter-field|<file> <field>|Read a single frontmatter field value.")
rows+=("set-frontmatter-field|<file> <versions>|Write versions list to frontmatter.")
rows+=("filter-files-frontmatter|<path><expr>|Filter files by frontmatter expression.")

get-frontmatter-field

Reads a single scalar frontmatter field value from a Markdown file. The value is extracted from the YAML block between --- delimiters. Surrounding quotes are stripped.

set-frontmatter-field

Replaces the versions: block inside a Markdown file's frontmatter with a new list of version strings. The command takes a file path followed by one or more version values.

filter-files-frontmatter

Prints the paths of all Markdown files in <path> whose frontmatter matches <expr>. The expression uses the Docker CLI style key=value, key!=value and key=~regex. The space separated form key == value is also accepted. See docs/patterns.md for details.

Python

Setup Python virtual enviroment.

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

activate-venv

remove-venv

Jupyter

Setup and run Jupyter notebooks.

rows+=("start-jupyter-lab|[env]|Start Jupyter Lab server.")
rows+=("install-jupyter-lab||Install Jupyter Lab and dependencies.")
rows+=("run-jupyter-notebook|<path>[env]|Execute notebook with papermill.")

start-jupyter-lab

install-jupyter-lab

run-jupyter-notebook

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.

rows+=("create-dotenv|<env><template>[-g]|Create .env file from templates.")
rows+=("list-dotenv|[-g]|List dotenv files.")
rows+=("show-dotenv|<env>|Output content of the .env file(s).")
rows+=("copy-dotenv|<env><env>|Copy .env file.")
rows+=("edit-dotenv|<env>|Open .env file in default editor.")
rows+=("load-dotenv|<env>|Load and export .env file(s).")
rows+=("init-dotenv-sops||Initialize age key and sops config.")
rows+=("show-project-setup||Show project setup info.")
rows+=("rename-dotenv|<env><env>|Rename .env file.")
rows+=("remove-dotenv|<env>|Remove .env file.")
rows+=("backup-dotenv-files|<path>|Archive .env files to target.")
rows+=("restore-dotenv-files|<path>|Extract and copy .env files from backup.")

create-dotenv

Available templates are defined in templates/:

nextcloud.env  odoo.env  upgrade.env

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

Lists *.env and legacy .env.* files from the current directory. Use the -g / --global flag to list the files in TASK_DOTENV_DIR instead.

show-dotenv

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

edit-dotenv

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

load-dotenv

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

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.

show-project-setup

Displays the project name, dotenv, KeePass / Pass entries, age key file, age keys that are referenced in .sops.yaml, .sops.yaml config and key status.

rename-dotenv

remove-dotenv

backup-dotenv-files

restore-dotenv-files

LLM

Commands that integrate the llm cli.

rows+=("commit-with-llm|[-m]|Commit with llm generated commit message.")
rows+=("select-llm-model||Select configured llm model from fzf list.")
rows+=("update-with-llm|<glob><prompt>|Feed files matching glob to llm.")
rows+=("update-changelog-with-llm|[num_lines]|Update CHANGELOG.md from git diff using llm.")

commit-with-llm

Use the -m / --model flag to select a model from an fzf dialog. The available models are listed by llm models list.

select-llm-model

Prints the selected model ID to stdout, so it can be used inline:

llm -m "$(task select-llm-model)" "my prompt"

The list is restricted to the models configured in extra-openai-models.yaml. If that file is missing or lists no models, all models from llm models list are shown.

update-with-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

Prompt

Create and track prompt.md files.

rows+=("init-prompt-log||Initialize prompt-log branch and worktree.")
rows+=("pull-prompt-log|[path]|Pull prompt-log from origin.")
rows+=("push-prompt-log|[path]|Push prompt-log to origin.")
rows+=("create-prompt|<title>[path]|Create prompt.md from template.")
rows+=("prompt-with-pi|[-l][-m][-n][path]|Run pi with prompt.md.")
rows+=("select-pi-model||Select pi model from fzf list.")
rows+=("commit-prompt|[path]|Commit prompt.md to prompt-log branch.")
rows+=("list-prompts|[-f <expr>][path]|List prompts from prompt-log branch.")
rows+=("reset-prompt|[path]|Reset project and keep ## Task section.")
rows+=("load-prompt|[-f <expr>][path]|Load prompt from prompt-log into prompt.md.")
rows+=("edit-prompt|[commit][path]|Edit prompt in prompt-log worktree.")
rows+=("show-prompt|[commit][path]|Show prompt content from prompt-log.")
rows+=("delete-prompt|[commit][path]|Delete prompt from prompt-log.")
rows+=("cancel-prompt|[path]|Cancel prompt and set state to cancelled.")
rows+=("convert-prompts-folder-to-prompt-log|[path]|Convert prompts folder to prompt-log.")

init-prompt-log

pull-prompt-log

push-prompt-log

commit-prompt and push-prompt-log probe the host of the origin remote before pushing. If the host is unreachable, the commit is kept locally and the push is skipped. Run task push-prompt-log to push the pending commits once the host is reachable again.

create-prompt

prompt-with-pi

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.

If the prompt frontmatter has a session_id, pi asks Return to session <session_id>? [Y/n]. Answering Y or pressing enter resumes the session with --session <session_id> and passes no prompt, because the session already holds it. Answering n starts a new session with the prompt.

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.

Use the -n / --no-gondolin flag to run pi on the host instead of the Gondolin micro-VM. The flag starts pi with --no-extensions and re-adds the packages from the packages setting, so the Gondolin extension is skipped. Built-in extensions such as builtin:codemode are disabled as well.

select-pi-model

Prints the selected model ID to stdout, so it can be used inline:

pi --model "$(task select-pi-model)" "my prompt"

commit-prompt

list-prompts

Use -f / --filter with a frontmatter expression to only show matching prompts, e.g. task list-prompts -f state=draft. See filter-files-frontmatter.

reset-prompt

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

load-prompt

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

edit-prompt

show-prompt

delete-prompt

cancel-prompt

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

convert-prompts-folder-to-prompt-log

Logging

Colorful logging in task commands.

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

log-error

log-success

log-warning

Git

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

rows+=("add-git-folder|<url><branch><path>|Add git folder to .gitmodules.")
rows+=("add-git-merge|<remote><merge><path>|Add git merge ref in .gitmodules.")
rows+=("add-git-remote|<remote><url><path>|Add git remote to git folder.")
rows+=("merge-git-remote||Merge remotes and refs in .gitmodules.")
rows+=("aggregate-git-folders|<path>|Run gitaggregate for the repos.yaml.")
rows+=("commit-git-folder|<path><message>|Commit changes of git folders.")
rows+=("clean-git-folder|<path>|Clean git folder.")
rows+=("checkout-git-folder|<branch><path>|Checkout git commit or branch.")
rows+=("clone-git-folder|<path>|Clone git folder.")
rows+=("download-git-folder|<path>|Download git folder.")
rows+=("find-git-folder|<path>|Find all .git folders in path.")
rows+=("generate-ssh-key||Generate ssh key pair.")
rows+=("list-git-folder|<path>|List path and url of git folders.")
rows+=("ls-git-folder|<path>|List git folders.")
rows+=("pull-git-folder|<branch><path>|Pull all git folders.")
rows+=("pull-all-repos||Pull all git repos.")
rows+=("switch-git-folder|<branch><path>|Switch branch for git folders.")
rows+=("push-git-folder|<path>|Push all git folders.")
rows+=("remove-git-folder|<path>|Remove git folders in path.")
rows+=("reset-git-folder|<path>|Abort and reset git folders.")
rows+=("run-pre-commit|<path>|Run pre-commit in path.")
rows+=("stage-git-folder|<path>|Stage all files in git folders.")
rows+=("status-git-folder|<path>|Show status of git folders.")
rows+=("status-all-repos||Show status of all git repos.")
rows+=("save-git-folder||Save commit refs to .gitmodules.")
rows+=("update-submodule||Update git submodules.")
rows+=("unshallow-git-folder||Fetch with unshallow and fix config.")

add-git-folder

add-git-merge

add-git-remote

merge-git-remote

aggregate-git-folders

commit-git-folder

clean-git-folder

checkout-git-folder

clone-git-folder

download-git-folder

find-git-folder

generate-ssh-key

list-git-folder

ls-git-folder

pull-git-folder

pull-all-repos

switch-git-folder

push-git-folder

remove-git-folder

reset-git-folder

run-pre-commit

stage-git-folder

status-git-folder

status-all-repos

save-git-folder

update-submodule

unshallow-git-folder

KeePass

Load and store secrets from KeePassXC.

The commands will prompt you to select a KeePassXC database using fzf. You can optionally select a key file as well.

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

rows+=("select-keepass-database||Select KeePassXC database and key file with fzf.")
rows+=("save-pass-to-keepass|<pass><entry>|Store password to KeePass entry.")
rows+=("get-pass-from-keepass|<entry>[password]|Get password from KeePass entry.")
rows+=("save-dotenv-to-keepass|[file]|Store content of .env in KeePass entry.")
rows+=("load-dotenv-from-keepass|[file]|Restore content of .env from KeePass entry.")
rows+=("store-agekey-to-keepass|[name]|Store age key for the project in KeePass.")
rows+=("load-agekey-from-keepass|[name]|Restore age private key from KeePass.")

select-keepass-database

Interactively select a KeePassXC database and optional key file using fzf. The command searches $HOME (max 5 levels deep) for .kdbx and .key files, excluding hidden folders and paths containing tmp. Outputs environment variable exports that can be evaluated.

Set FORCE_INTERACTIVE=1 to force fzf selection even in non-interactive contexts.

save-pass-to-keepass

get-pass-from-keepass

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

save-dotenv-to-keepass

load-dotenv-from-keepass

store-agekey-to-keepass

Reads the key block from ~/.config/sops/age/keys.txt, stores the secret key in the entry's password field and attaches the key block as keys.txt to the age/<project> KeePass entry. A sub path can be passed as the first argument to store a sub key, e.g. task store-agekey-to-keepass app stores the age/<project>/app entry.

load-agekey-from-keepass

Restores the age key attachment from the age/<project> KeePass entry and merges it into ~/.config/sops/age/keys.txt. A sub path can be passed as the first argument to restore a sub key, e.g. task load-agekey-from-keepass app.

Kubernetes

Manage kube config files and namespaces.

rows+=("get-kubeconfig||Show active kubeconfig.")
rows+=("list-kubeconfigs|<path>|List kubeconfig files.")
rows+=("switch-kubeconfig|<path>|Switch kubeconfig file.")
rows+=("generate-kubeconfig|<sa><path>|Generate kubeconfig for service account.")
rows+=("save-kubeconfig-to-keepass|[ctx]|Save kubeconfig file in KeePass.")
rows+=("load-kubeconfig-from-keepass|[ctx]|Load kubeconfig file from KeePass.")
rows+=("select-kubectl-namespace||Select namespace with fzf and set context.")

get-kubeconfig

Shows the active kubeconfig file by resolving the $HOME/.kube/config symlink, or none if no kubeconfig is set.

list-kubeconfigs

Lists all kubeconfig files matching */kube/config*.yaml below the given path, excluding decrypted copies.

switch-kubeconfig

Switches the active kubeconfig by symlinking $HOME/.kube/config to the target file. Encrypted files are decrypted first, then the namespace can be selected interactively.

generate-kubeconfig

save-kubeconfig-to-keepass

load-kubeconfig-from-keepass

select-kubectl-namespace

Lists all namespaces with kubectl get namespaces, presents an fzf selection dialog and sets the current context namespace with kubectl config set-context --current --namespace.

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/"
rows+=("login-docker|[user][token]|Run Docker login and create docker config.")
rows+=("build-image|[output]|Build Docker image with buildx.")

login-docker

build-image

11ty

Build static sites with 11ty.

rows+=("init-11ty-docs||Install 11ty with pnpm.")
rows+=("dev-11ty-docs||Run 11ty development server.")
rows+=("build-11ty-docs||Build the 11ty website.")
rows+=("serve-11ty-docs||Serve the 11ty output folder.")

init-11ty-docs

dev-11ty-docs

build-11ty-docs

serve-11ty-docs

Zensical

Build static sites with Zensical.

rows+=("init-zensical-docs||Initialize Zensical documentation build deps.")
rows+=("dev-zensical-docs||Run Zensical development server.")
rows+=("build-zensical-docs||Build the Zensical docs site.")
rows+=("serve-zensical-docs||Serve the Zensical documentation build.")

init-zensical-docs

dev-zensical-docs

build-zensical-docs

serve-zensical-docs

Vitepress

Build static sites with Vitepress.

rows+=("init-vitepress-docs||Install Vitepress build dependencies.")
rows+=("dev-vitepress-docs||Start Vitepress development server.")
rows+=("build-vitepress-docs||Create Vitepress build.")
rows+=("serve-vitepress-docs||Serve Vitepress build.")

init-vitepress-docs

dev-vitepress-docs

build-vitepress-docs

serve-vitepress-docs

Vuepress

Build static sites with Vuepress.

rows+=("init-vuepress-docs||Install Vuepress build dependencies.")
rows+=("dev-vuepress-docs||Start Vuepress development server.")
rows+=("build-vuepress-docs||Create Vuepress build.")
rows+=("serve-vuepress-docs||Serve Vuepress build.")

init-vuepress-docs

dev-vuepress-docs

build-vuepress-docs

serve-vuepress-docs

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
rows+=("install-hugo||Install Hugo from binary source.")
rows+=("dev-hugo-site|[url]|Start Hugo dev server.")
rows+=("build-hugo-site|[url]|Build with Hugo.")
rows+=("serve-hugo-site||Serve output from public folder.")

install-hugo

dev-hugo-site

build-hugo-site

serve-hugo-site

SOPS

Encrypt and decrypt files with sops and age.

rows+=("init-agekey-sops|[name]|Generate age key without encryption rule.")
rows+=("add-agekey|<path>|Generate age key and add rule for path.")
rows+=("list-agekeys|[-g]|List age keys from the default key file.")
rows+=("delete-agekey|<name>|Delete age key from the default key file.")
rows+=("encrypt-with-sops|<path>|Encrypt file with sops in place.")
rows+=("decrypt-with-sops|<path>|Decrypt file with sops in place.")
rows+=("cat-with-sops|<path>|Decrypt and show file content.")

init-agekey-sops

Generates an age key for the project based on the git URL and creates .sops.yaml with a default catch-all rule using the generated public key. 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.

add-agekey

Generates an age key named <project>/<path> and appends an encryption rule for the given path to .sops.yaml. Use it to encrypt files in sub folders with their own key, e.g. task add-agekey app. Multiple keys and rules can coexist; sops picks the rule that matches the file path.

list-agekeys

Lists the public keys, names and creation dates from ~/.config/sops/age/keys.txt. By default only keys for the current project are shown. Use the -g / --global flag to list all keys.

delete-agekey

Deletes the age key block matching <name> from ~/.config/sops/age/keys.txt.

encrypt-with-sops

decrypt-with-sops

cat-with-sops