← Projects
CLI

Fox Hop CLI

Focus a specific Firefox tab straight from your terminal — the command-line surface of Fox Hop.

New releasev2.2.04 days ago
Started
Last change
Licence
MIT

Features

  • Global hotkey focus — jump to a specific Firefox tab from a global hotkey, Raycast command, or the terminal without touching the mouse
  • Config-driven — declare the tabs you care about in ~/.config/foxhop/tabs.json; nothing is hardcoded and the file is editable by hand, by the CLI, or from Raycast
  • Smart matching — match tabs by hostname, prefix, exact URL, or full search; choose the recent, first, or pinned tab when several match
  • Opens if missing — focuses the existing tab when it is already open, or opens it at the configured URL when it is not
  • Containers — a target can live in a Firefox container, and foxhop open <url> --container <name> opens any URL in one
  • Two Raycast surfaces — a manage-and-focus extension for searching, adding, and editing targets, plus generated per-tab hotkey scripts via foxhop sync

Install

npm install -g @kud/foxhop-cli
foxhop install        # register the native messaging host with Firefox

Then install the Firefox extension:

  • Permanent — install from addons.mozilla.org — the signed, auto-updating listing.
  • Temporary (development) — open about:debugging#/runtime/this-firefox, click Load Temporary Add-on, and select webextension/manifest.json from this repo.

foxhop paste and foxhop read need access to page content, which the extension does not ask for at install. To use them, open Fox Hop's settings (toolbar button → Settings) and click Grant under Page access. Focusing tabs works without it.

Usage

Targets live in ~/.config/foxhop/tabs.json. Add one with foxhop add or by editing the file directly.

$ foxhop focus chatgpt          # focus a saved target (foregrounds Firefox)
$ foxhop list                   # list saved targets   (--json for machine output)
$ foxhop tabs                   # list currently open Firefox tabs   (--json)
$ foxhop open https://example.com --container Personal   # open a URL in a Firefox container
$ foxhop add https://mail.google.com --title Gmail   # id: gmail (slug of the title)
$ foxhop edit gmail --url https://mail.google.com/mail/u/1   # change fields, never the id
$ foxhop remove gmail
$ git diff | foxhop paste chatgpt   # fill a text box on its tab (stdin, or the clipboard)
$ foxhop read notes --from "article" --last   # print text from its tab, without focusing it
$ foxhop sync                   # generate per-tab Raycast hotkey scripts

Set FOXHOP_BROWSER to override the default Firefox Nightly (e.g. FOXHOP_BROWSER=Firefox).

Target ids are the kebab-case slug of the title (Notion Calendar becomes notion-calendar), fixed when the target is created and never renamed. A taken id gets a -2, -3 suffix instead of overwriting another target. Older configs migrate once on load (bsky titled Bluesky becomes bluesky); old names are not kept as aliases, so update saved foxhop focus <name> calls after upgrading. foxhop edit <id> changes any field but the id. Any change from the CLI, the popup or Raycast regenerates the Raycast scripts, and the popup shows each id with its script name. It also remembers favicons, so targets keep their icon when no tab is open.

Also in the Fox Hop family