In Darwin we can have scripts behave like apps.
For example, I have a dedicated "terminal app" that opens nvim in my ~/notes folder. The app closes as soon as I quit nvim.
This is the entirety of the app:
Nvim.app
└── Contents
└── MacOS
└── Nvim
Where the Nvim leaf is this script:
#!/bin/sh
/opt/homebrew/bin/wezterm start --cwd ~/notes --workspace notes -- /opt/homebrew/bin/nvim
The only requirement is that the script file name matches the app name: <app-name>.app/Contents/MacOS/<app-name>.
Source: