Hatch — open any terminal from your browser

Hatch

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

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.appterminal://default/path
  • iTerm2terminal://iterm/path
  • Warpterminal://warp/path
  • Ghosttyterminal://ghostty/path
  • Alacrittyterminal://alacritty/path
  • Kittyterminal://kitty/path
  • WezTermterminal://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

  • Jump into projects — bookmark terminal://default/Users/you/projects/myapp and open a terminal there with one click
  • Launch AI coding tools — open a terminal in any project folder and start Claude Code, Copilot, or Aider instantly
  • Pair with Snackbar — organize project links in Chrome’s sidebar and launch terminals alongside your editor

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.

  • ~200KB compiled AppleScript
  • Zero network access — everything is local
  • Supports 7 terminal apps
  • URL-decodes paths (handles spaces and special characters)
  • Validates directory exists before opening
  • Open source (MIT license)

Get Hatch

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

git clone https://github.com/nerves76/hatch.git
cd hatch
./build.sh

View on GitHub · Built for Snackbar

Scroll to Top