WSA4SDD (Wise Shell App) is a Claude Code-style interactive deployment and distribution shell designed to manage multi-repository service syncs and Docker Compose configurations directly in your terminal.
Improving upon rigid, wizard-like deployment scripts, WSA4SDD introduces a flexible TUI REPL that lets users configure variables in any order, verify environment setups, run pre-flight checks, and trigger Docker Compose distributions safely using intuitive commands.
It also supports standard CLI arguments parsing and handles non-interactive pipelines (like curl -fsSL ... | bash) for completely automated remote deployments.
A single repository (
wsa4sdd-samples) is switched across three branches in turn —python-cli→node-cli→pb-nf— and for each branch it runs therepo → workspace → auth → bootstrap → status → dist-runflow, then demonstratesdocker ps -ainspection andmake down.
- Displays an intuitive welcome description banner and a horizontal divider line (
───) outlining system state and available commands. - Features a custom-built advanced line editor and REPL prompt (
>):- Input History: Navigate and recall previously executed command histories (synchronized with
/tmp/.wsa4sdd_history) using UP/DOWN arrow keys. - In-Place Editing: Move the cursor interactively using LEFT/RIGHT arrow keys, and modify inputs using Backspace and Delete keys.
- Autocomplete Popover: Pressing the
/key on an empty prompt pops up a dropdown selection menu of all available commands. Navigate using UP/DOWN keys and pressEnterto auto-fill the selected command into the prompt buffer.
- Input History: Navigate and recall previously executed command histories (synchronized with
- Detects non-interactive pipeline environments (
! -t 0) or active CLI arguments, automatically bypassing the TUI to execute in direct CLI mode.
Each stage of the deployment pipeline is managed as a standalone shell command:
/repo [url[#branch] ...],/R …: Register one or more repos. Pass several at once, space- or comma-separated, and use<url>#<branch>to pin a branch (cloned/pulled on that branch). Empty opens the Repository Manager (add, delete, reorder). URLs are validated (https://,git@host:owner/repo,ssh://, local path; optional#branch); if none are registered or all are invalid, it is[NOT SET]./workspace [path],/W [path]: Workspace folder.[NOT SET]until run; when run with no arg, pick one of Current / Parent / Custom path from the TUI menu./auth [status|switch|login|pat],/A …: GitHub auth.[NOT SET]until run; the menu offers 4 actions — gh login status (show current user) / gh auth switch / gh auth login / Register PAT./bootstrap,/B: Runs only when repo, workspace, and auth are all set. ① system environment check module (detect OS + report git/gh/docker/make, no install) ② pre-install module (install missing deps) → sync repos → generate Makefile. If any prerequisite is[NOT SET], it stays[PENDING]and refuses, listing the missing items. If any step (repo sync, ops resolution, Makefile generation, …) fails, it aborts without reaching[DONE]and stays[PENDING]. Deployment assets in the ops repo are prepared as follows — (1) if a Makefile exists, use it; (2) if only docker-compose exists, generate a Makefile from it; (3) if neither exists, detect direct build/run apps (Pythonhello.py/…, Nodepackage.json/entry) — finds every app, none omitted (e.g.apps/python-cli,node-cli,python-backend,node-frontend), generates a Dockerfile + one compose service per app and a Makefile with overallup/downplus per-appup-<name>targets (notifies you, then/dist-runis available); if none found, report that/dist-runis unavailable and exit. (Python apps use the manifest dir —pyproject.toml/requirements.txt/setup.py— as the build context so dependencies install even when the entry is nested likeapp/main.py; FastAPI/uvicorn apps get auvicorn <module>:<app>CMD plus a published port.) With multiple repos registered, every repo is scanned (not just the ops repo); the generated compose/Makefile live in the ops repo and reference sibling-repo apps via../<repo>/...build contexts (service names are repo-prefixed to avoid clashes). It also classifies each service's role (frontend/backend/database/cli) and writes a wired compose — frontends getBACKEND_URL+depends_on+port, backends get a port (+DATABASE_URL+depends_onwhen a database exists), CLIs get no ports. Host ports only increment on collision (a single backend stays 8000)./status,/S: Shows current settings,[NOT SET]items, bootstrap state ([PENDING]/[DONE]), and the active theme./theme,/T [name]: Switch the Claude-CLI-style color theme (6 presets). With no arg, opens a selector + color-swatch preview. On first run it asks once and persists the choice to the cache./dist-run,/D: Does not auto-bootstrap. If bootstrap is[PENDING], it guides you to run/bootstrap, prints the[NOT SET]items besides bootstrap, and exits without executing anything. Only when[DONE]does it launch the Make target selector./help,/H: Displays the help instructions and command manual./exit,/E: Exits the session and completely purges saved caches.! <command>: Executes a local shell command (e.g.! pwd,! ls -la) immediately within the interactive REPL and displays the output.
- Typing
/repoor/Rwithout parameters opens the interactive Repository Manager sub-menu:- Add Repository: Registers new URLs (limit of 8).
- Delete Repository: Opens a quick selector to remove registered items.
- Change Order (Reorder): An interactive selector that uses arrow keys (
UP/DOWNork/j) to swap positions in-place, allowing user-customized distribution sequences. PressEnterto lock the selected item, and selectDone(or pressESC) to save and exit.
- Configured parameters are serialized to
/tmp/.wsa4sdd-${UID}.cacheon every update. - If the terminal disconnects or terminates unexpectedly, the session state is restored upon reboot.
- If the deployment finishes successfully (
/dist-rundone) or if the user exits cleanly (via/exitor pressingCtrl+Ctwice within 2 seconds), the cache file is deleted.
When starting wsa4sdd.sh interactively, the terminal displays the welcome header:
WSA4SDD App (v1.1.0) — Service Deployment and Distribution Shell
Lives in your terminal, manages git repos, and deploys docker-compose.
─────────────────────────────────────────────────────────────────────────────
Commands:
/repo, /R [url[#branch] ...] Register 1+ repos (space/comma sep, optional #branch)
/workspace, /W [path] Current / Parent / Custom ([NOT SET] until run)
/auth, /A [status|switch|login|pat] gh status/switch/login or PAT ([NOT SET] until run)
/bootstrap, /B System check + pre-install + sync (needs all set)
/status, /S Show config + [PENDING]/[DONE] + theme
/theme, /T [name] Switch color theme (6 presets; menu if empty)
/dist-run, /D Run deploy ([PENDING] -> guide + abort, no auto-bootstrap)
/help, /H Show this help message
/exit, /E Exit wsa4sdd shell and clear cache
! <command> Execute a shell command and display the output
─────────────────────────────────────────────────────────────────────────────
>
- CLI direct:
/repo <url1> <url2#branch> …— one or more, space/comma separated. Invalid URLs rejected with a warning. - TUI interactive:
/repowith no args opens the manager.Add Repositoryaccepts multiple URLs on one line (space/comma);Delete,Change Order. - Branch:
<url>#<branch>(e.g.https://github.com/o/r.git#dev,git@host:o/r.git#release/1.0) → clone (-b) / pull (checkout+pull origin <branch>) on that branch. Omit for default/current branch. - Valid formats:
https://…/…,git@host:owner/repo,ssh://…, local path (optional#branch). - State: with zero valid repos,
/statusshows[NOT SET].
[NOT SET]until run — running it is what defines the value.- CLI direct:
/workspace /path/to/dir - TUI interactive: pick one of ① Current dir ② Parent dir ③ Custom path….
[NOT SET]until run — running it offers 4 actions:- gh login status —
gh auth status; shows and records the current GitHub user. - gh auth switch — switch the active account.
- gh auth login — new GitHub login.
- Register PAT — Username (optional) + Personal Access Token, stored in a 0600 temp helper file and auto-removed on exit.
- gh login status —
- CLI direct:
/auth status|switch|login|pat(gh/nonealso accepted for scripting). /statusshows the auth method plus the detected current GitHub username.
- Will not run unless bootstrap is
[DONE]. If[PENDING], it guides you to run/bootstrap, prints the[NOT SET]items (Repos/Workspace/Auth) besides bootstrap, and exits without executing anything (no auto-bootstrap). - When
[DONE], it collects Makefile targets (such asup-*) into a dynamic arrow-key menu. - Runs optional pre-run commands, triggers
make <target>; on success the cache is wiped and the script exits.
State model: settings (repo·workspace·auth) are
[NOT SET]until filled. Bootstrap runs only when all three are set and becomes[DONE]; otherwise[PENDING]. Changing any setting invalidates[DONE]back to[PENDING].
A Claude-CLI-style color theme system. On first run the tool asks for a theme once and persists it to the cache, so subsequent runs don't prompt again.
| Theme | Description |
|---|---|
dark |
Default for dark backgrounds |
light |
For light backgrounds (dark text) |
dark-daltonized |
Colorblind-friendly (avoids green/red confusion — success=blue, error=orange), dark bg |
light-daltonized |
Colorblind-friendly, light bg |
dark-ansi |
16-color ANSI only (no 256/truecolor), dark bg |
light-ansi |
16-color ANSI only, light bg |
- CLI direct:
/theme dark-daltonizedswitches immediately. - TUI interactive:
/themeopens a menu (current theme preselected) and prints a color swatch (✓/!/✗/▶) preview after selection. - The choice is stored in a dedicated persistent cache
/tmp/.wsa4sdd-theme-${UID}.cacheand shown in/status. - Unless you re-set it via
/theme,/T, the previous cached value is reused. The theme cache is NOT deleted when the session cache is cleared (/exit, double Ctrl+C, successful deploy).
You can execute the script directly from the remote repository without downloading it, which is ideal for one-off tasks or CI/CD pipelines. Arguments can be appended to configure the app before running, allowing you to choose between launching the interactive TUI or non-interactive CLI.
# 1) Remote TUI mode (pre-populate inputs, but launch interactive REPL)
curl -fsSL https://raw.githubusercontent.com/WisemanLim/pub-wsa-for-sdd/main/wsa4sdd.sh \
| bash -s -- -I "https://github.com/ClaroPessoas/claro-svc" -w "~/workspace"
# 2) Remote non-interactive CLI mode (trigger automated deployment immediately)
curl -fsSL https://raw.githubusercontent.com/WisemanLim/pub-wsa-for-sdd/main/wsa4sdd.sh \
| bash -s -- -I "https://github.com/ClaroPessoas/claro-svc" --cli
# 3) Remote non-interactive CLI dry-run (perform setup/sync but skip deployment)
curl -fsSL https://raw.githubusercontent.com/WisemanLim/pub-wsa-for-sdd/main/wsa4sdd.sh \
| bash -s -- -I "https://github.com/ClaroPessoas/claro-svc" --no-run
# 4) One-shot default environment (--default-env): workspace=cwd, ops=first repo, auth=pat
curl -fsSL https://raw.githubusercontent.com/WisemanLim/pub-wsa-for-sdd/main/wsa4sdd.sh \
| bash -s -- -I "https://github.com/ClaroPessoas/claro-svc" -a "<PAT_TOKEN>" --default-envA non-interactive mode that composes a default environment in one line for remote/automation use.
-a, --auth <value>: CLI auth. Agh/pat/nonekeyword sets the method; any other string is treated as a PAT token (method=pat). Both-aand--authspellings work.--default-env:-I/--input(repo) is required — error + exit if missing.- workspace = current dir (PWD), ops repo = first repo's name (auto-set).
-a/--authis required, default methodpat, a token value must be supplied to run — error + exit if missing (or if only barepatis given without a token).
⚠️ -a <token>exposes the token in process args (ps/history). Intended for automation/demo; mask CI secrets in production.
To download the script to your local system for persistent usage:
-
Download and make executable:
curl -fsSL -o wsa4sdd.sh https://raw.githubusercontent.com/WisemanLim/pub-wsa-for-sdd/main/wsa4sdd.sh chmod +x wsa4sdd.sh
-
Install to System PATH for global access (Optional):
# Move the script to a folder in your system PATH (e.g. /usr/local/bin) sudo mv wsa4sdd.sh /usr/local/bin/wsa4sdd -
Local Execution & Parameter Passing Examples:
# Standalone execution (starts TUI mode by default) wsa4sdd # Pre-populate variables and launch interactive TUI mode wsa4sdd -I "https://github.com/ClaroPessoas/claro-svc" -w "~/workspace" # Force non-interactive CLI mode for immediate deployment wsa4sdd -I "https://github.com/ClaroPessoas/claro-svc" --cli # Force non-interactive CLI dry-run (skip deployment target execution) wsa4sdd -I "https://github.com/ClaroPessoas/claro-svc" --no-run
| Option | Description | Example |
|---|---|---|
-I, --input |
Space-separated list of repository URLs. | -I "url1 url2" |
-w, --workspace |
Destination folder to clone repos. | -w ~/dev/workspace |
-o, --ops |
The name of the primary operations repository hosting the Makefile/docker-compose files. | -o my-ops-repo |
--no-run |
Syncs repositories and runs build bootstrapping (like Makefile generation) but skips target deployment. | --no-run |
-h, --help |
Shows the CLI arguments usage guide. | -h |
- 100% Native macOS Support: The default macOS shell is
/bin/bash(v3.2.x). To ensure seamless execution without requiring bash upgrades or external packages,wsa4sdd.shwas built from the ground up to avoid Bash 4.x+ specific patterns, such aslocal -n(namerefs) and associative arrays (declare -A). - Automatic Environment Verification: During interactive launch or
/bootstrap, the script automatically checks if core dependencies (git,docker,docker compose,make) are installed on the host system, notifying the user about any missing requirements.
