Diviner

macOS App · AppleScript

Hatch

A tiny macOS app that opens any terminal from your browser with one click.

Hatch deep-linking from browser

The problem

While building Snackbar, I wanted a feature where you could click a project in the sidebar and have it open in your terminal — ready to run commands, start a dev server, or fire up an AI coding tool like Claude Code. The problem: browsers can’t open local apps for security reasons. There’s no built-in way to go from a Chrome extension to a terminal window at a specific directory.

But browsers can hand off custom URL schemes to the OS. That’s how mailto: links open your email client and slack:// links open Slack. I just needed something on the other end to catch a terminal:// URL and open the right app.

What Hatch does

Hatch registers as the macOS handler for terminal:// URLs. When you click a link like terminal://iterm/Users/you/projects/myapp, Hatch opens iTerm2 at that directory. The first part of the path selects which terminal app to use:

Terminal URL Pattern
Terminal.app terminal://default/path
iTerm2 terminal://iterm/path
Warp terminal://warp/path
Ghostty terminal://ghostty/path
Alacritty terminal://alacritty/path
Kitty terminal://kitty/path
WezTerm terminal://wezterm/path

It works with any app or workflow that can produce a URL — Chrome bookmarks, Snackbar’s App Links feature, Alfred workflows, or even a simple HTML page.

Use cases

How it works with Snackbar

Snackbar is a Chrome sidebar extension I built for organizing projects into workspaces. One of its features is App Links — the ability to open a project in your code editor or terminal directly from the sidebar. Hatch is the companion app that makes the terminal side work.

Here’s how they fit together: in Snackbar, you enable App Links in settings and check which terminals you use. You set a base projects path (e.g. /Users/you/projects/). Then for any workspace, you just type the folder name and Snackbar builds the full terminal:// URL. Click the terminal icon next to a workspace and Hatch opens your terminal right there — ready for npm start, claude, or whatever you need.

Snackbar handles the UI and workspace organization. Hatch handles the OS-level URL routing. Neither requires the other — Hatch works with plain Chrome bookmarks, and Snackbar’s editor links (VS Code, Cursor) work without Hatch — but together they turn your sidebar into a proper project launcher.

How it’s built

Hatch is a compiled AppleScript app — about 200KB. When it receives a terminal:// URL from macOS Launch Services, it parses the app name and directory path, then calls open -a <AppName> <path> to launch the terminal. No background processes, no daemons, no network access. It launches, opens the terminal, and quits.

Get Hatch

Hatch is free and open source. Download it from GitHub Releases or build from source.