Amakuru.net

Git Remote Open: a Finder Quick Action that gets you to the file on the web

A small macOS Quick Action that opens any file or directory in its GitLab or GitHub web interface, on the right branch, with the right URL format.

The number of times I’d right-clicked a file in Finder and wished there were a “Show on GitLab” option was embarrassing. The shell command exists — gh browse, glab repo view --web — but it lives in the terminal, and “open Finder, find the file, switch to terminal, cd to that folder, run command” is friction enough that I usually didn’t bother. git-remote-open is the macOS Quick Action that closes that loop.

Where the gesture already happens

A new CLI was the wrong place for this — gh browse exists. The right place was Finder’s contextual menu, where the right-click was already happening. A Quick Action plugs into that menu directly.

Branch-aware URL

The URL opens to the current branch, not main and not the repo’s default. On feature/foo, the file shown is the one being edited rather than whatever’s on the default branch. The failure mode of “always open main” is silent — the wrong version loads, looks plausible, and gets trusted.

Bash + Automator, 100 lines

A small bash script wrapped in an Automator workflow. Both SSH (git@host:path) and HTTPS remotes are parsed; both gitlab.com and self-hosted GitLab; both github.com and GitHub Enterprise; files use /blob/, directories use /tree/.

Bash fits the shape of the work — text manipulation on remote URLs and a single open call at the end. A more elaborate stack would have meant longer install instructions for a thirty-line problem.

Was it worth it?

An afternoon to write, saves a few seconds many times a day, and the action lives inside a workflow I already do reflexively, so the saving compounds without my having to remember the tool exists.

dmorel69/git-remote-open — Bash, Automator