Standards for building idempotent provisioning scripts for Manjaro Linux with zsh, Gum for user input, and consistent package management patterns.
Standards and best practices for creating provisioning scripts for Manjaro Linux environments. Emphasizes idempotency, clean user interaction via Gum, and consistent package management.
This skill is designed for provisioning scripts targeting **Manjaro Linux** systems:
All user interaction should use the **Gum** package for consistent, beautiful CLI prompts:
**Example:**
```bash
SELECTED=$(gum choose "Option 1" "Option 2" "Option 3")
if gum confirm "Proceed with installation?"; then
# proceed
fi
USERNAME=$(gum input --placeholder "Enter username")
CONFIG=$(gum write --placeholder "Paste config here...")
```
Refer to [Gum documentation](https://github.com/charmbracelet/gum) for full API.
All scripts must be **re-runnable** without causing errors or unintended side effects:
Do **not** add unnecessary comments. Only comment when:
**Bad:**
```bash
yay -S git --noconfirm
```
**Good:**
```bash
yay -S git --noconfirm
```
Use `pacman` for packages from official Manjaro/Arch repos:
```bash
pacman -S <package> --noconfirm --noprogressbar --quiet
```
Use `yay` for packages from the Arch User Repository:
```bash
yay -S <package> --noconfirm --noprogressbar --quiet
```
Always include these flags for non-interactive, clean output:
Add `-s` (silent mode) to all `curl` commands:
```bash
curl -s https://example.com/install.sh | bash
```
Include robust error handling in all scripts:
Use `set -e` at the beginning of every script to exit immediately on any command failure:
```bash
#!/usr/bin/env zsh
set -e
```
For stricter error handling, consider:
```bash
set -euo pipefail
```
Use a **consistent logging function** for status messages:
```bash
status() {
echo "[INFO] $1"
}
status "Installing packages..."
yay -S neovim --noconfirm --noprogressbar --quiet
status "Installation complete"
```
Standardize the `status` function across all scripts for uniform output.
```bash
#!/usr/bin/env zsh
set -e
status() {
echo "[INFO] $1"
}
status "Starting provisioning..."
if ! command -v neovim &> /dev/null; then
status "Installing Neovim..."
yay -S neovim --noconfirm --noprogressbar --quiet
else
status "Neovim already installed, skipping"
fi
if gum confirm "Configure dotfiles?"; then
status "Configuring dotfiles..."
# configuration logic here
fi
status "Provisioning complete"
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/manjaro-linux-provisioning/raw