This guide helps you create your first CLI application with radp-bash-framework.
- Bash 4.3+
- GNU getopt (auto-installed if missing)
- yq (auto-installed if missing)
brew tap xooooooooox/radp
brew install radp-bash-frameworkcurl -fsSL https://raw.githubusercontent.com/xooooooooox/radp-bash-framework/main/install.sh | bashSee Installation Guide for more options.
radp-bf new myapp
cd myapp
./bin/myapp --helpThis creates:
myapp/
├── bin/myapp # Entry point
├── src/main/shell/
│ ├── commands/ # Command implementations
│ │ ├── hello.sh # myapp hello
│ │ └── version.sh # myapp version
│ └── config/
│ ├── config.yaml # Configuration
│ └── _ide.sh # IDE support
├── .radp-cli/ # Scaffold metadata
└── install.sh # Installer script
Create src/main/shell/commands/greet.sh:
# @cmd
# @desc Greet someone
# @arg name! Required argument
# @flag -l, --loud Shout the greeting
cmd_greet() {
local name="$1"
local msg="Hello, $name!"
if [[ "${opt_loud:-}" == "true" ]]; then
echo "${msg^^}"
else
echo "$msg"
fi
}$ ./bin/myapp greet World
Hello, World!
$ ./bin/myapp greet --loud World
HELLO, WORLD!Create directories for command groups:
commands/
├── db/
│ ├── migrate.sh # myapp db migrate
│ └── seed.sh # myapp db seed
└── hello.sh # myapp hello
Edit config/config.yaml:
radp:
extend:
myapp:
api_url: https://api.example.comAccess in code:
echo "$gr_radp_extend_myapp_api_url"- CLI Development Guide - Complete guide to building CLI applications
- Command Annotations - Full annotation reference
- Configuration System - YAML configuration and environment variables
- API Reference - Toolkit functions