Hitch wraps login commands that expect an OAuth callback on localhost and makes that callback reachable when the command is running on a remote machine over SSH.
Quick install from the hosted script:
curl -fsSL https://get.hitch.sh | bashInstall a specific release:
HITCH_VERSION=v0.1.0 curl -fsSL https://get.hitch.sh | bashBuild and install from source with Cargo:
cargo install hitch --lockedThe hosted installer currently supports Linux x86_64 and Linux aarch64.
It is designed for flows like:
hitch -- aws sso login
hitch -- gh auth login
hitch --port 38983When the wrapped command prints a loopback redirect URL such as http://localhost:4567/callback, Hitch:
- keeps the wrapped command interactive by running it in a PTY,
- mirrors the wrapped command's output to your terminal,
- detects the first localhost callback URL with a port,
- asks you to confirm the detected tunnel details and lets you edit
port,user, andoriginif needed, - starts an SSH reverse tunnel for that port until the wrapped command exits.
hitch [--origin <host>] [--user <ssh-user>] -- <command> [args...]
hitch [--origin <host>] [--user <ssh-user>] --port <port>Examples:
hitch -- aws sso login
hitch --origin 203.0.113.10 --user alice -- gh auth login
hitch --origin 203.0.113.10 --port 38983- Hitch only reacts to loopback redirect URLs:
localhost,127.0.0.1, and::1. - It only starts one tunnel per invocation. The first valid loopback URL wins.
- In wrapped-command mode, Hitch asks you to confirm the detected tunnel details before opening the tunnel.
--port <port>opens a reverse tunnel immediately and keeps it alive until interrupted.- If a redirect URL is not loopback, Hitch reports that the original login command configuration should be checked.
- If no origin can be determined, Hitch continues running the wrapped command and reports why tunneling could not be established.
- If the tunnel SSH session prompts for a password, Hitch pauses forwarding terminal input to the wrapped command until tunnel authentication completes.
- Hitch returns the wrapped command's exit status.
Origin resolution order:
--origin- the client IP from
SSH_CONNECTION - no origin available, which disables tunneling for that run