Generate production-ready bash script templates with modern patterns, error handling, and configurable features
Generates production-ready bash script templates with modern patterns, error handling, and configurable features.
/plugin marketplace add JosiahSiegel/claude-plugin-marketplace/plugin install bash-master@claude-plugin-marketplace<type> [options] (types: cli, daemon, library, installer, ci)MANDATORY: Always Use Backslashes on Windows for File Paths
When using Edit or Write tools on Windows, you MUST use backslashes (\) in file paths, NOT forward slashes (/).
Generate production-ready bash script templates with modern 2025 patterns, comprehensive error handling, and configurable features based on script type and requirements.
cli)Full-featured command-line tool with:
daemon)Background service script with:
library)Reusable function library with:
installer)Software installation script with:
ci)CI/CD pipeline script with:
Specify additional options for customization:
| Option | Description |
|---|---|
--minimal | Basic template without advanced features |
--full | All features enabled |
--config | Include configuration file handling |
--logging | Include structured logging |
--parallel | Include parallel processing support |
--interactive | Include user prompts and menus |
--docker | Include Docker integration |
--aws | Include AWS CLI patterns |
--k8s | Include Kubernetes patterns |
Basic CLI tool:
/bash-template cli
Full-featured daemon:
/bash-template daemon --full --logging
Minimal installer:
/bash-template installer --minimal
CI script with Docker:
/bash-template ci --docker --parallel
Library with tests:
/bash-template library my-utils
All templates include:
#!/usr/bin/env bash
#
# script-name - Brief description
# Version: 1.0.0
# Author: <author>
# License: MIT
#
# Usage: script-name [OPTIONS] <arguments>
#
# Description:
# Longer description of what the script does.
#
# Strict mode
set -euo pipefail
# Script metadata
readonly VERSION="1.0.0"
readonly SCRIPT_NAME="${BASH_SOURCE[0]##*/}"
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Configuration defaults
declare -A CONFIG=(
[verbose]=false
[dry_run]=false
[config_file]=""
)
# Cleanup handler
cleanup() {
local exit_code=$?
# Cleanup logic here
exit "$exit_code"
}
trap cleanup EXIT INT TERM
# Main function
main() {
parse_args "$@"
validate_environment
execute
}
main "$@"
Templates can include these feature modules:
parse_args() {
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help) show_help; exit 0 ;;
-v|--version) echo "$VERSION"; exit 0 ;;
-V|--verbose) CONFIG[verbose]=true ;;
--) shift; break ;;
-*) die "Unknown option: $1" ;;
*) ARGS+=("$1") ;;
esac
shift
done
}
declare -A LOG_LEVELS=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3)
LOG_LEVEL="${LOG_LEVEL:-INFO}"
log() {
local level="$1"; shift
local msg="$*"
local ts; ts=$(date '+%Y-%m-%d %H:%M:%S')
if [[ ${LOG_LEVELS[$level]} -ge ${LOG_LEVELS[$LOG_LEVEL]} ]]; then
printf '[%s] [%s] %s\n' "$ts" "$level" "$msg" >&2
fi
}
debug() { log DEBUG "$@"; }
info() { log INFO "$@"; }
warn() { log WARN "$@"; }
error() { log ERROR "$@"; }
setup_colors() {
if [[ -t 2 ]] && [[ -z "${NO_COLOR:-}" ]]; then
RED=$'\033[0;31m'
GREEN=$'\033[0;32m'
YELLOW=$'\033[0;33m'
BLUE=$'\033[0;34m'
RESET=$'\033[0m'
else
RED='' GREEN='' YELLOW='' BLUE='' RESET=''
fi
}
spinner() {
local pid=$1
local delay=0.1
local spinstr='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
while kill -0 "$pid" 2>/dev/null; do
for ((i=0; i<${#spinstr}; i++)); do
printf '\r%s %s' "${spinstr:$i:1}" "$2"
sleep "$delay"
done
done
printf '\r✓ %s\n' "$2"
}
When you request a template, I will:
Generate modern, production-ready bash scripts instantly with best practices built-in.