diff --git a/bin/clone-taskfile b/bin/clone-taskfile new file mode 100755 index 0000000..10d722a --- /dev/null +++ b/bin/clone-taskfile @@ -0,0 +1,11 @@ +#!/bin/bash + +clone-taskfile(){ + if [[ ! -d "$HOME/taskfile.build" ]]; then + echo -e '\033[38;5;214mGit\033[0m: Clone taskfile repo' + git clone https://git.taskfile.build "$HOME/taskfile.build" + else + echo -e '\033[38;5;214mGit\033[0m: Pull taskfile repo' + git -C "$HOME/taskfile.build" pull + fi +} \ No newline at end of file diff --git a/install b/install index a794eec..82681d3 100755 --- a/install +++ b/install @@ -6,12 +6,15 @@ repository=https://taskfile.build scripts=( activate-venv add-git-folder + add-git-merge + add-git-remote aggregate-git-folders backup-env-files build-image checkout-git-folder clean-git-folder clone-git-folder + clone-taskfile commit-git-folder commit-with-llm copy-dotenv @@ -24,6 +27,7 @@ scripts=( edit-dotenv ensure-directory find-git-folder + generate-ssh-key get-pass-from-keepass init-dotenv-dir init-project @@ -40,6 +44,7 @@ scripts=( log-success log-warning ls-git-folder + merge-git-remote open-url-with-delay open-with-os pull-all-repos @@ -51,8 +56,10 @@ scripts=( rename-dotenv reset-git-folder restore-dotenv-files + run-pre-commit save-dotenv-to-keepass save-dotenv-to-pass + save-git-folder save-kubeconfig-to-keepass save-kubeconfig-to-pass save-pass-to-keepass diff --git a/library.md b/library.md index 12820ee..dc7ae7f 100644 --- a/library.md +++ b/library.md @@ -47,6 +47,7 @@ OPEN_BROWSER=False # Default: True TASK_DOTENV_DIR="$HOME/Odoo-Build/config" # Default: "$HOME/.config/taskfile.build" ``` + ### clone-taskfile ```bash @@ -94,11 +95,13 @@ rows+=("show-dotenv-setup||Show info about the dotenv setup.") ```bash rows+=("setup-completion|[shell]|Show shell completion instructions.") ``` + ## Files Managing files and directories. + ### ensure-directory ```bash @@ -116,11 +119,12 @@ rows+=("create-symlink|[target][source]|Remove existing file/directory and creat ```bash rows+=("create-symlink-files|[target][source]|Create symlink for files in source pattern.") ``` - + ## Python Setup Python virtual enviroment. + ### activate-venv ```bash @@ -132,6 +136,7 @@ rows+=("activate-venv||Activate or initialize Python virtual env.") ```bash rows+=("remove-venv||Remove the Python virtual env.") ``` + ## Environment @@ -141,6 +146,7 @@ Manage `.env` files in the task config folder. TASK_DOTENV_DIR="$HOME/Odoo-Build/config" # Default: "$HOME/.config/taskfile.build" ``` + ### create-dotenv ```bash @@ -200,11 +206,12 @@ rows+=("backup-dotenv-files|[path]|Archive and copy .env files to target locatio ```bash rows+=("restore-dotenv-files|[path]|Extract and copy .env files from backup file.") ``` - + ## LLM Commands that integrate the `llm` cli. + ### commit-with-llm ```bash @@ -236,11 +243,12 @@ rows+=("create-prompt||Create a new prompt file from template.") ```bash rows+=("list-prompts||List all prompt files.") ``` - + ## Logging Colorful logging in task commands. + ### log-error ```bash @@ -258,11 +266,13 @@ rows+=("log-success||Colored output for success.") ```bash 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 ```bash @@ -417,12 +427,13 @@ rows+=("save-git-folder||Save commit refs to .gitmodules.") ```bash rows+=("update-submodule||Update git submodules.") ``` - + ## Pass Load and store secrets from pass. 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-dotenv-to-pass ```bash @@ -434,7 +445,7 @@ rows+=("save-dotenv-to-pass|[file]|Store content of .env in pass entry.") ```bash rows+=("load-dotenv-from-pass|[file]|Restore content to .env from pass entry.") ``` - + ## KeePass Load and store secrets from KeePassXC. @@ -446,7 +457,7 @@ 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 ```bash @@ -470,9 +481,12 @@ rows+=("save-dotenv-to-keepass|[file]|Store content of .env in KeePass entry.") ```bash rows+=("load-dotenv-from-keepass|[file]|Restore content to .env from KeePass entry.") ``` - + ## Kubernetes +Manage kube config files. + + ### save-kubeconfig-to-pass ```bash @@ -496,6 +510,7 @@ rows+=("load-kubeconfig-from-pass|[ctx]|Load kubeconfig file from pass.") ```bash rows+=("load-kubeconfig-from-keepass|[ctx]|Load kubeconfig file from KeePass.") ``` + ## Docker @@ -510,6 +525,7 @@ DOCKERFILE="image/Dockerfile" DOCKER_CONFIG="$HOME/.docker/$CONTAINER_REGISTRY/" ``` + ### login-docker ```bash @@ -521,15 +537,17 @@ rows+=("login-docker|[user][token]|Run Docker login and create docker config.") ```bash rows+=("build-image|[output]|Build Docker image with buildx.") ``` - + ## Ansible Install scripts from the Ansible Build project. -### install-ansible-build-scripts - The available roles with scripts are listed here: + +### install-ansible-build-scripts + ```bash rows+=("install-ansible-build-scripts|[role]|Install scripts of the specified Ansbile role.") ``` + \ No newline at end of file diff --git a/prompts/15_update-library-doc.md b/prompts/15_update-library-doc.md new file mode 100644 index 0000000..8874653 --- /dev/null +++ b/prompts/15_update-library-doc.md @@ -0,0 +1,74 @@ +--- +title: "Update library doc" +--- + +# Run 15 + +Note: @Agent refers to the AI agent (you) who is working on this task. + +@Agent when working on this task, make sure to: + +- Read context and task section first +- Prepare a list of todos +- Update the todo list while working on the task + +## Context + +Read the `AGENTS.md` and `README.md` to get an understanding of the project. + +## Task + +Add a new command `update-library-doc` to the task file. + +The new command reads the `task.template` file and generates the entries in `library.md`. + +Here is an example. The relevant section in the `task.template` file is: + +``` + rows+=("===Task===| | ") + rows+=("clone-taskfile||Clone the taskfile.build repo.") + ... + rows+=("===Files===| | ") + rows+=("ensure-directory|[path]|Ensure directory path exists.") + ... +``` + +There are section markers with `===` and the same markers can be found in the `library.md` file: + +``` +## Task + +Configure the task enviroment. + +```bash +OPEN_BROWSER=False # Default: True +TASK_DOTENV_DIR="$HOME/Odoo-Build/config" # Default: "$HOME/.config/taskfile.build" +``` + + +### clone-taskfile + +```bash +rows+=("clone-taskfile||Clone the taskfile.build repo.") +``` + +... + + +## Files + +Managing files and directories. + + +### ensure-directory + +```bash +rows+=("ensure-directory|[path]|Ensure directory path exists.") +``` +... + +``` + +Generate the the markdown content from the rows. + +Use awk to find the markers and read/write the content. diff --git a/task b/task index 9f95f7c..55fad14 100755 --- a/task +++ b/task @@ -17,7 +17,7 @@ help-table() { rows+=("run-tests||Test with shellcheck.") rows+=("serve-11ty||Serve the 11ty output folder.") rows+=("setup-completion|[shell]|Show shell completion instructions.") - rows+=("update-template||Update task.template from library.md.") + rows+=("update-install-script||Upate install script.") rows+=("version||Show version of required tools.") for row in "${rows[@]}"; do @@ -290,7 +290,7 @@ EOF fi } -update-template() { +update-install-script() { echo "Updating install script with bin commands." local scripts_list