Let your agent do it.

Copy the line below and paste it into your AI agent. It'll detect your terminal and set up the integration. Manual instructions are further down.

Set up your terminal's Bareview Markdown integration described at https://bareview.app/llms.txt — pick the section matching your terminal and follow it exactly.
Terminal Integration Open with Side effect
WezTerm Deep Click (SHIFT+click in tmux) None — ~/.wezterm.lua only
iTerm2 Deep CMD+click Restarts iTerm2
Ghostty Partial — system default CMD+click Sets macOS .md handler (Finder too)

WezTerm

Click any .md path in WezTerm to open it in Bareview — plain click is WezTerm's default. Inside tmux, hold SHIFT while clicking so WezTerm sees the event instead of tmux.

Wire it up manually
lua Add to ~/.wezterm.lua, after require("wezterm")
local function bareview_trim(s)
  return (s:gsub("^%s+", ""):gsub("%s+$", ""))
end

local function bareview_percent_decode(s)
  return (s:gsub("%%(%x%x)", function(hex)
    return string.char(tonumber(hex, 16))
  end))
end

local function bareview_cwd_from_wezterm(pane)
  local cwd_uri = pane:get_current_working_dir()
  if not cwd_uri then return nil end
  if cwd_uri.file_path then return cwd_uri.file_path end
  local cwd = tostring(cwd_uri):gsub("^file://[^/]*", "")
  cwd = bareview_percent_decode(cwd)
  return cwd ~= "" and cwd or nil
end

local function bareview_tmux_client_pid(pane)
  local ok, info = pcall(function() return pane:get_foreground_process_info() end)
  if not ok or not info then return nil end
  local name = info.name or ""
  local executable = info.executable or ""
  if name == "tmux" or executable:match("/tmux$") then
    return tostring(info.pid)
  end
  return nil
end

local function bareview_cwd_from_tmux(pane)
  local client_pid = bareview_tmux_client_pid(pane)
  if not client_pid then return nil end
  local candidates = { "/opt/homebrew/bin/tmux", "/usr/local/bin/tmux", "/usr/bin/tmux", "tmux" }
  for _, tmux in ipairs(candidates) do
    local spawn_ok, ok, stdout = pcall(function()
      return wezterm.run_child_process({ tmux, "display-message", "-c", client_pid, "-p", "#{pane_current_path}" })
    end)
    if spawn_ok and ok then
      local cwd = bareview_trim(stdout or "")
      if cwd ~= "" then return cwd end
    end
  end
  return nil
end

local function bareview_pane_cwd(pane)
  return bareview_cwd_from_tmux(pane) or bareview_cwd_from_wezterm(pane)
end

local function bareview_resolve_path(pane, path)
  path = path:gsub("\\ ", " ")
  if path:sub(1, 2) == "~/" then return (os.getenv("HOME") or "") .. path:sub(2) end
  if path:sub(1, 1) == "/" then return path end
  local cwd = bareview_pane_cwd(pane) or "."
  return cwd .. "/" .. path
end

config.hyperlink_rules = config.hyperlink_rules or wezterm.default_hyperlink_rules()

table.insert(config.hyperlink_rules, {
  regex = [[(?:~/|/|\./|\.\./)?[A-Za-z0-9_.-](?:[A-Za-z0-9_./~-]|\\ )*\.(?:md|markdown)]],
  format = "bareview-md://open/$0",
})

wezterm.on("open-uri", function(window, pane, uri)
  local path = uri:match("^bareview%-md://open/(.+)$")
  if not path then return true end
  local resolved = bareview_resolve_path(pane, path)
  wezterm.background_child_process({ "/usr/bin/open", "-a", "Bareview", resolved })
  return false
end)

iTerm2

CMD+click any .md path in iTerm2 to open it in Bareview. Scripts a Smart Selection rule into your current profile — no system defaults touched. Restarts iTerm2 to apply.

Wire it up manually
bash Quits iTerm2, adds the rule to your active profile, relaunches
osascript -e 'tell application "iTerm2" to quit' 2>/dev/null \
  || osascript -e 'tell application "iTerm" to quit' 2>/dev/null || true
while pgrep -qx iTerm2; do sleep 0.5; done

python3 - <<'PY'
import plistlib, os, sys
path = os.path.expanduser("~/Library/Preferences/com.googlecode.iterm2.plist")
with open(path, "rb") as f:
    d = plistlib.load(f)
guid = d.get("Default Bookmark Guid")
profiles = d.get("New Bookmarks", [])
prof = next((p for p in profiles if p.get("Guid") == guid), profiles[0] if profiles else None)
if prof is None:
    print("No iTerm2 profile found — aborting.", file=sys.stderr); sys.exit(1)
rules = prof.setdefault("Smart Selection Rules", [])
RGX = r"(?:~/|/|\./|\.\./)?[A-Za-z0-9_./~-]+\.(?:md|markdown)"
if any(r.get("regex") == RGX for r in rules):
    print("Rule already present on profile '%s' — no change." % prof.get("Name"))
else:
    rules.append({
        "notes": "Bareview Markdown",
        "precision": "very_high",
        "regex": RGX,
        "actions": [{"title": "Open in Bareview", "action": 2,
                     "parameter": 'open -a Bareview "\\0"'}],
    })
    with open(path, "wb") as f:
        plistlib.dump(d, f, fmt=plistlib.FMT_BINARY)
    print("Rule added to profile '%s'." % prof.get("Name"))
PY

killall cfprefsd 2>/dev/null || true
open -a iTerm

Ghostty

Cmd+click any .md path in Ghostty to open it in Bareview. Use ./name.md or an absolute path — stable Ghostty doesn't yet linkify bare filenames (upstream #11635), and there's no per-terminal hook for custom matchers (#11913), so this sets the system default — Finder is affected too.

Wire it up manually
bash Sets Bareview as the system default for Markdown files (.md, .markdown)
command -v duti >/dev/null || brew install duti
duti -s app.bareview.Bareview .md       all
duti -s app.bareview.Bareview .markdown all