feat: add project initialization script and template files with dynamic help table
- Added `init-project` script to setup new taskfile projects with templates - Created `.gitignore.template` and `AGENTS.md.template` for standardized project setup - Implemented dynamic help table generation in `help-table` function - Updated `library.md` and `task.template` to include new `init-project` command - Added `init-project` to taskfile help documentation - Improved AGENTS.md with comprehensive coding conventions and agent guidance
This commit is contained in:
10 files changed
+333
-212
No files matched your search
+54
-114
@@ -1,11 +1,8 @@
|
||||
---
|
||||
layout: layouts/base.njk
|
||||
---
|
||||
|
||||
# Library
|
||||
|
||||
The repository of this website provides a library of reusable functions.
|
||||
|
||||
Clone the repository into your home folder and ensure it is updated regularly.
|
||||
|
||||
```bash
|
||||
@@ -33,14 +30,12 @@ fi
|
||||
```
|
||||
|
||||
These commands create folder in the directory of the task file and the home directory. Here is an overview of these folders:
|
||||
|
||||
- `$PWD/tmp`: Temporary directory for the task commands.
|
||||
- `$PWD/.prompt`: LLM prompts stored as markdown files.
|
||||
- `$HOME/.config/taskfile.build`: Default path for storing dotenv files.
|
||||
- `$HOME/.docker/$CONTAINER_REGISTRY`: Default path for storing container registry credentials.
|
||||
|
||||
## Task
|
||||
|
||||
Configure the task enviroment.
|
||||
|
||||
```bash
|
||||
@@ -49,81 +44,72 @@ TASK_DOTENV_DIR="$HOME/Odoo-Build/config" # Default: "$HOME/.config/taskfile.bui
|
||||
```
|
||||
|
||||
### clone-taskfile
|
||||
|
||||
```bash
|
||||
printf "$column" 'clone-taskfile' '' 'Clone the taskfile.build repo.'
|
||||
rows+=("clone-taskfile||Clone the taskfile.build repo.")
|
||||
```
|
||||
|
||||
### init-project
|
||||
```bash
|
||||
rows+=("init-project||Setup a taskfile project in the current directory.")
|
||||
```
|
||||
|
||||
### init-config-dir
|
||||
|
||||
```bash
|
||||
printf "$column" 'init-dotenv-dir' '' 'Setup task dotenv dir.'
|
||||
rows+=("init-dotenv-dir||Setup task dotenv dir.")
|
||||
```
|
||||
|
||||
### template-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'template-dotenv' '' 'Generate .env from .env.template.'
|
||||
rows+=("template-dotenv||Generate .env from .env.template.")
|
||||
```
|
||||
|
||||
### open-with-os
|
||||
|
||||
```bash
|
||||
printf "$column" 'open-with-os' '' 'Open file or url with default application.'
|
||||
rows+=("open-with-os||Open file or url with default application.")
|
||||
```
|
||||
|
||||
### open-url-with-delay
|
||||
|
||||
```bash
|
||||
printf "$column" 'open-url-with-delay' '[url][delay]' 'Open url after n seconds.'
|
||||
rows+=("open-url-with-delay|[url][delay]|Open url after n seconds.")
|
||||
```
|
||||
|
||||
### show-dotenv-setup
|
||||
|
||||
```bash
|
||||
printf "$column" 'show-dotenv-setup' '' 'Show info about the dotenv setup.'
|
||||
rows+=("show-dotenv-setup||Show info about the dotenv setup.")
|
||||
```
|
||||
|
||||
## Files
|
||||
|
||||
Managing files and directories.
|
||||
|
||||
### ensure-directory
|
||||
|
||||
```bash
|
||||
printf "$column" 'ensure-directory' '[path]' 'Ensure directory path exists.'
|
||||
rows+=("ensure-directory|[path]|Ensure directory path exists.")
|
||||
```
|
||||
|
||||
### create-symlink
|
||||
|
||||
```bash
|
||||
printf "$column" 'create-symlink' '[target][source]' 'Remove existing file/directory and create symlink.'
|
||||
rows+=("create-symlink|[target][source]|Remove existing file/directory and create symlink.")
|
||||
```
|
||||
|
||||
### create-symlink-files
|
||||
|
||||
```bash
|
||||
printf "$column" 'create-symlink-files' '[target][source]' 'Create symlink for files in source pattern.'
|
||||
rows+=("create-symlink-files|[target][source]|Create symlink for files in source pattern.")
|
||||
```
|
||||
|
||||
## Python
|
||||
|
||||
Setup Python virtual enviroment.
|
||||
|
||||
### activate-venv
|
||||
|
||||
```bash
|
||||
printf "$column" 'activate-venv' '' 'Activate or initialize Python virtual env.'
|
||||
rows+=("activate-venv||Activate or initialize Python virtual env.")
|
||||
```
|
||||
|
||||
### remove-venv
|
||||
|
||||
```bash
|
||||
printf "$column" 'remove-venv' '' 'Remove the Python virtual env.'
|
||||
rows+=("remove-venv||Remove the Python virtual env.")
|
||||
```
|
||||
|
||||
## Environment
|
||||
|
||||
Manage `.env` files in the task config folder.
|
||||
|
||||
```bash
|
||||
@@ -131,177 +117,145 @@ TASK_DOTENV_DIR="$HOME/Odoo-Build/config" # Default: "$HOME/.config/taskfile.bui
|
||||
```
|
||||
|
||||
### create-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'create-dotenv' '[env][type]' 'Create .env file of type nextcloud, odoo, upgrade.'
|
||||
rows+=("create-dotenv|[env][type]|Create .env file of type nextcloud, odoo, upgrade.")
|
||||
```
|
||||
|
||||
### list-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'list-dotenv' '' 'List .env files.'
|
||||
rows+=("list-dotenv||List .env files.")
|
||||
```
|
||||
|
||||
### show-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'show-dotenv' '[env]' 'Output content of the .env file.'
|
||||
rows+=("show-dotenv|[env]|Output content of the .env file.")
|
||||
```
|
||||
|
||||
### copy-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'copy-dotenv' '[env][env]' 'dotenv .env file.'
|
||||
rows+=("copy-dotenv|[env][env]|dotenv .env file.")
|
||||
```
|
||||
|
||||
### edit-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'edit-dotenv' '[env]' 'Open .env file in default editor.'
|
||||
rows+=("edit-dotenv|[env]|Open .env file in default editor.")
|
||||
```
|
||||
|
||||
### load-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'load-dotenv' '[env]' 'Load and export .env file.'
|
||||
rows+=("load-dotenv|[env]|Load and export .env file.")
|
||||
```
|
||||
|
||||
### rename-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'rename-dotenv' '[env][env]' 'Rename .env file.'
|
||||
rows+=("rename-dotenv|[env][env]|Rename .env file.")
|
||||
```
|
||||
|
||||
### remove-dotenv
|
||||
|
||||
```bash
|
||||
printf "$column" 'remove-dotenv' '[env]' 'Remove .env file.'
|
||||
rows+=("remove-dotenv|[env]|Remove .env file.")
|
||||
```
|
||||
|
||||
### backup-dotenv-files
|
||||
|
||||
```bash
|
||||
printf "$column" 'backup-dotenv-files' '[path]' 'Archive and copy .env files to target location.'
|
||||
rows+=("backup-dotenv-files|[path]|Archive and copy .env files to target location.")
|
||||
```
|
||||
|
||||
### restore-dotenv-files
|
||||
|
||||
```bash
|
||||
printf "$column" 'restore-dotenv-files' '[path]' 'Extract and copy .env files from backup file.'
|
||||
rows+=("restore-dotenv-files|[path]|Extract and copy .env files from backup file.")
|
||||
```
|
||||
|
||||
## LLM
|
||||
|
||||
Commands that integrate the `llm` cli.
|
||||
|
||||
### commit-with-llm
|
||||
|
||||
```bash
|
||||
printf "$column" 'commit-with-llm' '' 'Commit with llm generated commit message.'
|
||||
rows+=("commit-with-llm||Commit with llm generated commit message.")
|
||||
```
|
||||
|
||||
### update-with-llm
|
||||
|
||||
```bash
|
||||
printf "$column" 'update-with-llm' '[glob][prompt]' 'Feed files matching glob to LLM and apply changes.'
|
||||
rows+=("update-with-llm|[glob][prompt]|Feed files matching glob to LLM and apply changes.")
|
||||
```
|
||||
|
||||
## Logging
|
||||
|
||||
Colorful logging in task commands.
|
||||
|
||||
### log-error
|
||||
|
||||
```bash
|
||||
printf "$column" 'log-error' '' 'Colored output for errors.'
|
||||
rows+=("log-error||Colored output for errors.")
|
||||
```
|
||||
|
||||
### log-success
|
||||
|
||||
```bash
|
||||
printf "$column" 'log-success' '' 'Colored output for success.'
|
||||
rows+=("log-success||Colored output for success.")
|
||||
```
|
||||
|
||||
### log-warning
|
||||
|
||||
```bash
|
||||
printf "$column" 'log-warning' '' 'Colored output for warnings.'
|
||||
rows+=("log-warning||Colored output for warnings.")
|
||||
```
|
||||
|
||||
## Git
|
||||
|
||||
Manage git folders and submodules.
|
||||
|
||||
### commit-git-folder
|
||||
|
||||
```bash
|
||||
printf "$column" 'commit-git-folder' '[message][path]' 'Commit all changes in git folders in path.'
|
||||
rows+=("commit-git-folder|[message][path]|Commit all changes in git folders in path.")
|
||||
```
|
||||
|
||||
### commit-git-folder
|
||||
|
||||
### clean-git-folder
|
||||
```bash
|
||||
printf "$column" 'clean-git-folder' '' 'Clean git folder.'
|
||||
rows+=("clean-git-folder||Clean git folder.")
|
||||
```
|
||||
|
||||
### ls-git-folder
|
||||
|
||||
```bash
|
||||
printf "$column" 'ls-git-folder' '[path]' 'Space separated list of git folders in path.'
|
||||
rows+=("ls-git-folder|[path]|Space separated list of git folders in path.")
|
||||
```
|
||||
|
||||
### push-git-folder
|
||||
|
||||
```bash
|
||||
printf "$column" 'push-git-folder' '' 'Push all git folders in path.'
|
||||
rows+=("push-git-folder||Push all git folders in path.")
|
||||
```
|
||||
|
||||
### reset-git-folder
|
||||
|
||||
```bash
|
||||
printf "$column" 'reset-git-folder' '' 'Abort, rebase and reset git folder.'
|
||||
rows+=("reset-git-folder||Abort, rebase and reset git folder.")
|
||||
```
|
||||
|
||||
### stage-git-folder
|
||||
|
||||
```bash
|
||||
printf "$column" 'stage-git-folder' '[path]' 'Stage all files in git folders in path.'
|
||||
rows+=("stage-git-folder|[path]|Stage all files in git folders in path.")
|
||||
```
|
||||
|
||||
### status-git-folder
|
||||
|
||||
```bash
|
||||
printf "$column" 'status-git-folder' '[path]' 'Show status of git folders in path.'
|
||||
rows+=("status-git-folder|[path]|Show status of git folders in path.")
|
||||
```
|
||||
|
||||
### update-submodule
|
||||
|
||||
```bash
|
||||
printf "$column" 'update-submodule' '' 'Update git submodules.'
|
||||
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
|
||||
printf "$column" 'save-dotenv-to-pass' '[file]' 'Store content of .env in pass entry.'
|
||||
rows+=("save-dotenv-to-pass|[file]|Store content of .env in pass entry.")
|
||||
```
|
||||
|
||||
### load-dotenv-from-pass
|
||||
|
||||
```bash
|
||||
printf "$column" 'load-dotenv-from-pass' '[file]' 'Restore content to .env from pass entry.'
|
||||
rows+=("load-dotenv-from-pass|[file]|Restore content to .env from pass entry.")
|
||||
```
|
||||
|
||||
## KeePass
|
||||
|
||||
Load and store secrets from KeePassXC.
|
||||
|
||||
Set path to KeePassXC database and entry:
|
||||
|
||||
```bash
|
||||
@@ -312,59 +266,49 @@ 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
|
||||
printf "$column" 'save-pass-to-keepass' '[pass][entry]' 'Store password to KeePass entry.'
|
||||
rows+=("save-pass-to-keepass|[pass][entry]|Store password to KeePass entry.")
|
||||
```
|
||||
|
||||
### get-pass-from-keepass
|
||||
|
||||
```bash
|
||||
printf "$column" 'get-pass-from-keepass' '[entry]' 'Get password from KeePass entry.'
|
||||
rows+=("get-pass-from-keepass|[entry]|Get password from KeePass entry.")
|
||||
```
|
||||
|
||||
### save-dotenv-to-keepass
|
||||
|
||||
```bash
|
||||
printf "$column" 'save-dotenv-to-keepass' '[file]' 'Store content of .env in KeePass entry.'
|
||||
rows+=("save-dotenv-to-keepass|[file]|Store content of .env in KeePass entry.")
|
||||
```
|
||||
|
||||
### load-dotenv-from-keepass
|
||||
|
||||
```bash
|
||||
printf "$column" 'load-dotenv-from-keepass' '[file]' 'Restore content to .env from KeePass entry.'
|
||||
rows+=("load-dotenv-from-keepass|[file]|Restore content to .env from KeePass entry.")
|
||||
```
|
||||
|
||||
## Kubernetes
|
||||
|
||||
### save-kubeconfig-to-pass
|
||||
|
||||
```bash
|
||||
printf "$column" 'save-kubeconfig-to-pass' '[ctx]' 'Save kubeconfig file in pass.'
|
||||
rows+=("save-kubeconfig-to-pass|[ctx]|Save kubeconfig file in pass.")
|
||||
```
|
||||
|
||||
### save-kubeconfig-to-keepass
|
||||
|
||||
```bash
|
||||
printf "$column" 'save-kubeconfig-to-keepass' '[ctx]' 'Save kubeconfig file in KeePass.'
|
||||
rows+=("save-kubeconfig-to-keepass|[ctx]|Save kubeconfig file in KeePass.")
|
||||
```
|
||||
|
||||
### load-kubeconfig-from-pass
|
||||
|
||||
```bash
|
||||
printf "$column" 'load-kubeconfig-from-pass' '[ctx]' 'Load kubeconfig file from pass.'
|
||||
rows+=("load-kubeconfig-from-pass|[ctx]|Load kubeconfig file from pass.")
|
||||
```
|
||||
|
||||
### load-kubeconfig-from-keepass
|
||||
|
||||
```bash
|
||||
printf "$column" 'load-kubeconfig-from-keepass' '[ctx]' 'Load kubeconfig file from KeePass.'
|
||||
rows+=("load-kubeconfig-from-keepass|[ctx]|Load kubeconfig file from KeePass.")
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
Build and push Docker images.
|
||||
|
||||
Set Docker env vars.
|
||||
|
||||
```bash
|
||||
@@ -376,25 +320,21 @@ DOCKER_CONFIG="$HOME/.docker/$CONTAINER_REGISTRY/"
|
||||
```
|
||||
|
||||
### login-docker
|
||||
|
||||
```bash
|
||||
printf "$column" 'login-docker' '[user][token]' 'Run Docker login and create docker config.'
|
||||
rows+=("login-docker|[user][token]|Run Docker login and create docker config.")
|
||||
```
|
||||
|
||||
### build-image
|
||||
|
||||
```bash
|
||||
printf "$column" 'build-image' '[output]' 'Build Docker image with buildx.'
|
||||
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: <https://ansible.build/scripts.html>
|
||||
|
||||
```bash
|
||||
printf "$column" 'install-ansible-build-scripts' '[role]' 'Install scripts of the specified Ansbile role.'
|
||||
```
|
||||
rows+=("install-ansible-build-scripts|[role]|Install scripts of the specified Ansbile role.")
|
||||
```
|
||||
Reference in new issue
Block a user