CandySshLauncher
TUI directory of SSH endpoints
Launch candy-ssh-launcher, pick a host, hit Enter — the current process is replaced with ssh connecting to it. Reads YAML or JSON; supports identity files, ssh options, ProxyJump.
Install
composer require sugarcraft/candy-ssh-launcher
The package publishes its dev branch until the first candy-ssh-launcher/v* tag is cut, so projects on Composer's default minimum-stability need the root "minimum-stability": "dev", "prefer-stable": true pair. A single-file .phar is built from tools/build-phar.php (see the README); release download URLs appear with the tags.
Quickstart
# ~/.config/wishlist.yml
- name: production
host: prod.example.com
port: 2222
user: deploy
identity_file: ~/.ssh/prod-deploy
- name: staging
host: stage.example.com
user: deploy
- name: jumpbox
host: bastion.example.com
options:
- ServerAliveInterval=30
- ProxyJump=gw.example.com
What's in the box
--config ▸ ./wishlist.{yml,yaml,json} ▸ ~/.config/wishlist.{yml,yaml,json} — first file that exists wins at each tier.options array.vendor/bin/candy-ssh-launcher, plus a self-contained .phar built by tools/build-phar.php.ext-pcntl, Unix only, UTF-8 terminal. Honors NO_COLOR/CLICOLOR=0 and TERM=dumb.--list plus direct named dispatch (candy-ssh-launcher home).Security
Your config file is trusted input — exactly like ~/.ssh/config itself. Whatever a config declares, the launcher passes to ssh: options: entries become real -o settings verbatim, and OpenSSH options such as ProxyCommand / LocalCommand execute arbitrary commands at connect time. Keep config files (and ~/.ssh/config) owned by you with 0600/0644 permissions and do not accept endpoint files from strangers; see the fleet-wide trust boundary.
Source & demos
- Source on GitHub
- Full README
- Sample config
- Originally inspired by wishlist (Go); SugarCraft is developed as a native PHP project.
API
| Class | Method | Description |
|---|---|---|
| Endpoint | new(name, host) | Create SSH endpoint (port, user, identityFiles, description, proxyJump, options optional) |
| Endpoint | withName(name) · withHost(host) · withPort(port) · withUser(user) | Fluent setters — each returns a new endpoint |
| Endpoint | withIdentityFiles(paths[]) | Set identity files, in order, each passed to ssh as its own -i |
| Endpoint | withDescription(text) · withProxyJump(host) · withOptions(options[]) | Fluent setters — each returns a new endpoint |
| Endpoint | parsePort(host, raw) | Validate a port value (1–65535); junk is refused naming the endpoint |
| Config | load(path) | Load endpoints from YAML/JSON (format auto-detected) |
| Config | parse(raw, hintPath) | Parse config text directly (extension hint, else JSON when the payload opens with [ or {) |
| Config | importFromSshConfig(path) | Import endpoints from ~/.ssh/config |
| Picker | pick(endpoints) | Interactive selection (null on cancel or empty endpoint list) |
| Launcher | __construct(executor) | Optional callable executor seam for embedding and tests |
| Launcher | dispatch(endpoint, binary) | pcntl_exec handoff — never returns on success; the default executor throws a RuntimeException naming the binary when exec fails |
Demos.
VHS-recorded GIF of the endpoint picker, regenerated automatically on every push that touches the source.