Skip to main content

Module open

Module open 

Source
Expand description

gw open command - Open the PR for the current branch in the browser

Resolves the PR for the current branch via gh and opens its URL in the browser. The command used to open the URL is configurable so that environment-specific behavior (e.g. selecting a particular Chrome profile) lives in the user’s dotfiles, not in this CLI.

§Browser command resolution

The URL is opened by invoking a single program with the URL as its only argument (<program> <url>). The program is resolved in this order:

  1. $GW_OPEN_URL_CMD - gw-specific override
  2. $OPEN_URL_CMD - generic override (shared with other tooling)
  3. OS default - open on macOS, xdg-open elsewhere

Set GW_OPEN_URL_CMD/OPEN_URL_CMD to a script that takes the URL as $1.

Functions§

run
Execute the open command