A small Nushell initializer for bootstrapping a repository from the folder tree in repository-template/.
The script stages the source tree in a temporary directory, then walks repository-template/ with an interactive TUI.
misecurlgit
(
# Setup deps
D=$(mktemp -d)
trap 'mise untrust "${D}/.mise.toml" 2>/dev/null; rm -rf "${D}"; mise prune -y -q' EXIT
curl -fsSL https://raw.githubusercontent.com/aguimbao/repository-template/main/.mise.toml -o "${D}/.mise.toml"
mise trust "${D}/.mise.toml"
mise install -C "${D}"
eval "$(mise env -C "${D}" -s bash)"
# Runs the nushell script
nu -c "$(curl -fsSL https://raw.githubusercontent.com/aguimbao/repository-template/main/init.nu)"
)The fetched script clones this repository into a temporary directory, walks its repository-template/ tree, and removes the temporary directory when the script exits.
Every directory is a node. commands and templates are reserved directories:
repository-template/
└── vcs/
├── commands/
├── templates/
├── git/
│ ├── commands/
│ └── templates/
└── jj/
├── commands/
└── templates/
The TUI walks this tree recursively. Files under templates/ are copied to the destination, preserving their path relative to that directory. Files under commands/ are Nushell command files; their contents are shown before they are run in the destination directory.
A node may contain direct actions, child nodes, or both. The same traversal is used at every level.