Setup command
The setup command prepares a computer for Melta. The app builds it for you with the right flags, so you rarely type it by hand. This page documents everything it does, so you know what you are running.
Usage
$ curl -fsSL https://getmelta.app/setup.sh | sh -s -- [flags]
It runs in sh on macOS or Linux, including Ubuntu in WSL. You can read the script first at getmelta.app/setup.sh.
Flags
| Flag | Value | Effect |
|---|---|---|
--key | An SSH public key, quoted | Adds the key to ~/.ssh/authorized_keys. It must start with ssh-, ecdsa- or sk-. |
--token | The computer's notification token, mlt_… | Saves the token in the Melta plugin's config so notifications reach your account. |
--tailscale | None | Adds the Tailscale step: install Tailscale if needed and sign the computer in. |
--api | A URL | The API address saved for the plugin. Default https://api.getmelta.app. |
Arguments it does not recognise are ignored. Without --key the key step is skipped; without --token the plugin is installed but not linked to a computer.
What the app generates
- Add Host › Tailscale:
--tailscale --key '…' --token mlt_… - Add Host › Own SSH Host:
--token mlt_… - Edit Host › Copy Command:
--key '…' --token mlt_…, with the key selected in Edit Host when there is one. - Edit Host › Run It for Me:
--token mlt_…, run over the app's SSH connection with no terminal attached.
Environment
MELTA_SITE: where the plugin files and the Windows guide link come from. Defaulthttps://getmelta.app.- The command adds
~/.local/bin,~/.cargo/bin,/opt/homebrew/binand/usr/local/bintoPATHwhile it runs, so it finds tools installed there. - Only the Tailscale step needs administrator rights. Before installing or signing in, it checks that it can use
sudo: running as root,sudothat needs no password, or a terminal to type the password in. If none of these is true, it tells you to run the command in a terminal on the computer.
Steps, in order
On Git Bash, MSYS or Cygwin the command stops right away and points you to the Windows guide. Otherwise it prints your user and computer name, then runs each step and numbers it. Each line is marked ✓ for done, ! for a warning and ✗ for a failure.
This phone's key
Creates ~/.ssh (mode 700) and ~/.ssh/authorized_keys (mode 600) if needed, and appends the key unless the exact line is already there: Already allowed or Added to ~/.ssh/authorized_keys. Without --key: No key in the command; skipped.
SSH (Remote Login)
Checks with nc whether anything listens on port 22 of the computer. Prints On, or on a Mac Off. Turn on System Settings › General › Sharing › Remote Login., or on Linux a hint to install and start openssh-server. Without nc it cannot check and says so. It only checks; it does not change your SSH settings.
Tailscale (only with --tailscale)
Skipped if the computer already has a Tailscale IP. Otherwise it installs Tailscale (the macOS package from pkgs.tailscale.com, or Tailscale's install script on Linux) and signs in: on a Mac by opening the Tailscale app for you to sign in, on Linux with sudo tailscale up, which prints a sign-in link. See Use Tailscale.
Herdr
- Not installed: runs Herdr's installer from
herdr.dev/install.sh. Ifherdris not onPATHafterwards, it asks you to open a new terminal. - Installed directly: runs
herdr update, which installs the new version without touching running sessions. - Installed with Homebrew or Nix: prints the version and leaves updates to that package manager, for example
brew upgrade herdr.
Melta plugin (agent notifications)
Downloads herdr-plugin.toml, notify.sh and setup.sh into ~/.local/share/melta/herdr-plugin, then runs herdr plugin link on that folder with --enabled. With --token, it writes MELTA_TOKEN and MELTA_API to .env in the folder herdr plugin config-dir melta.notify reports, readable only by you. Skipped if Herdr is not installed. If Herdr cannot add the plugin, it asks you to start Herdr once and run the command again.
Enter these in Melta
Prints your User, the Tailscale IP (works from anywhere) if Tailscale is running, and the Local IP (same Wi-Fi only). It ends with Done. Back in Melta, tap Add Host.
Running it again
Every step is safe to repeat. The key is never added twice, a connected Tailscale is left alone, Herdr is updated, the plugin files are replaced with the latest version, and the token is written again. Run it whenever you want to update Herdr or the plugin, after Generate New Token, or when notifications stop.
Exit status
The command exits with an error in two cases only: on a Windows shell such as Git Bash, and when --key is not an SSH public key. In every other case it runs all the steps and exits successfully, even if a step printed a warning or a failure, so read the output.