Native Shell
Native Shell:AI 生成的 UI,在你的應用中原生呈現,涵蓋每個平台。iOS、Android、macOS、Windows 與 Linux 上的應用、GPUI 應用與網頁在執行時載入已簽名、沙箱隔離的 TSX 模組並繪製 th
AI 翻譯
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Review and merge GitHub pull requests from the terminal: sections across repos and accounts, a smart merge panel, vim keys. Built on gh, fzf and tmux.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Sangam (संगम) is Sanskrit for a confluence: the place where two rivers meet and flow on as one. Which is what a merge is.
sangam is a terminal UI for the part of the day spent on pull requests:
finding the ones waiting for you, reading them, reviewing them and merging
them. It runs like lazygit: type sangam in any terminal. It's built on
the GitHub CLI (gh), fzf and tmux, so it uses your existing gh sign-in
and needs no token, server or config to start.
See everything that needs you
h/l; each tab shows its count.gh account, so work and personal PRs sit side by side. Press u to
focus on one account.f cycles the state for every section;
s narrows a section with any GitHub search (author:, label:,
head:, words...).Read a PR properly
Enter on the checks view opens the
failed jobs' logs with timestamps stripped and errors highlighted.Act on it
$EDITOR), close or
reopen, toggle draft, check out the branch, copy the link, open it in
the browser.Fast and out of your way
? for a key sheet, q to quit.sangam is a Bash script. It runs on Linux (macOS isn't supported yet: it uses GNU tools, see the roadmap).
| Tool | Version | What for |
|---|---|---|
| bash | 4.4+ | sangam itself |
| gh (GitHub CLI) | 2.40+ | everything GitHub: sign-in, search, PR data, merging |
| fzf | 0.66+ | the list, preview and key handling |
| tmux | 3.3+ | the layout (sangam runs its own private tmux server; you don't need to use tmux yourself) |
| jq | 1.6+ | reading GitHub's JSON |
| git, less | any | the repo you're in, full-screen views |
| GNU coreutils, GNU grep, util-linux | any | standard on Linux (md5sum, stat, grep -P, setsid) |
Optional, but recommended:
| Tool | What you get |
|---|---|
| bat | syntax-highlighted diffs and Markdown descriptions |
| A Nerd Font in your terminal | the icons (without one they show as boxes) |
notify-send (libnotify) | desktop notifications after merges, reviews and comments |
wl-copy (Wayland), xclip (X11) | y copies a PR's link to the clipboard |
Install them with your package manager:
# Arch Linux
sudo pacman -S --needed github-cli fzf tmux jq git bat libnotify wl-clipboard
# Fedora
sudo dnf install gh fzf tmux jq git bat libnotify wl-clipboard
# Debian / Ubuntu (gh from GitHub's apt repo: https://github.com/cli/cli/blob/trunk/docs/install_linux.md)
sudo apt install gh tmux jq git bat libnotify-bin wl-clipboard
fzf version: Debian and Ubuntu ship an fzf older than 0.66. Install a current one from fzf's releases (a single binary: put it in
~/.local/bin) or withgit clone --depth 1 https://github.com/junegunn/fzf ~/.fzf && ~/.fzf/install. On Debian/Ubuntu, bat's command isbatcat; link it:ln -s /usr/bin/batcat ~/.local/bin/bat.
sangam doctor checks all of this for you.
curl -fsSL https://raw.githubusercontent.com/Theyashsawarkar/sangam/main/install.sh | bash
This clones sangam into ~/.local/share/sangam, links
~/.local/bin/sangam to it, and runs sangam doctor. No root needed.
If ~/.local/bin isn't on your PATH, the installer tells you the line
to add.
Installer options (pass them after bash -s --):
curl -fsSL https://raw.githubusercontent.com/Theyashsawarkar/sangam/main/install.sh | bash -s -- --ref v2.0.0 # a specific release
curl -fsSL https://raw.githubusercontent.com/Theyashsawarkar/sangam/main/install.sh | bash -s -- --bin-dir ~/bin
| Option | Default | |
|---|---|---|
--ref <tag or branch> | main | install a release (e.g. v2.0.0) instead of the latest code |
--bin-dir <dir> | ~/.local/bin | where the sangam link goes |
--dir <dir> | ~/.local/share/sangam | where sangam is cloned |
--uninstall | remove the link and the clone |
Arch Linux (package): a PKGBUILD that builds from the latest commit
lives in packaging/arch. It pulls in every
dependency and installs to /usr:
git clone https://github.com/Theyashsawarkar/sangam
cd sangam/packaging/arch
makepkg -si
System-wide with make:
git clone https://github.com/Theyashsawarkar/sangam
cd sangam
sudo make install # /usr/local/bin/sangam
make install PREFIX=~/.local # or just for you
make uninstall (with the same PREFIX) removes it again.
By hand: sangam is one script. Clone the repo anywhere and link
bin/sangam into your PATH:
git clone https://github.com/Theyashsawarkar/sangam ~/src/sangam
ln -s ~/src/sangam/bin/sangam ~/.local/bin/sangam
As a tmux plugin: see Using it inside tmux.
| Installed with | Update | Uninstall |
|---|---|---|
| the quick installer | run the install command again | … install.sh | bash -s -- --uninstall |
| the Arch PKGBUILD | makepkg -si again in packaging/arch (after git pull) | sudo pacman -R sangam-git |
make install | git pull && sudo make install | sudo make uninstall |
| TPM (tmux) | prefix U | remove the @plugin line, then prefix alt-u |
Uninstalling leaves your sections (~/.config/sangam) and cache
(~/.cache/sangam); delete them by hand if you want them gone.
Sign in to GitHub with gh (once):
gh auth login
To use several accounts (say, work and personal), run gh auth login
once per account. sangam uses all of them.
Check the setup:
sangam doctor
sangam 2.0.0
required
✓ bash 5.3.20(1)-release
✓ tmux 3.8
✓ gh 2.102.0
✓ fzf 0.74.5
✓ jq 1.8.2
✓ git 2.56.0
✓ less 710
✓ GNU tools coreutils, grep -P, setsid
GitHub
✓ signed in work-account, personal-account
optional
✓ bat highlighted diffs and descriptions
✓ notify-send desktop notifications
✓ clipboard wl-copy
! Nerd Font icons need a Nerd Font in your terminal (can't be checked from here)
✓ ready: run sangam
Run it, ideally from inside a repo you work on:
cd ~/code/my-project
sangam
You start in normal mode: j/k move through PRs, h/l switch
sections, 1–4 switch what the right side shows, m merges, ?
shows every key, q quits.
On first run sangam creates ~/.config/sangam/sections with three
sections: Review requested, My PRs and Involved. Make it yours
next: see Sections.
╭───────────────────────────────────────────────────────────────────────────────╮
│ Review requested 3 My PRs 5 my-project (here) 2 all accounts ? keys │ ← section tabs
╰───────────────────────────────────────────────────────────────────────────────╯
╭─ Review requested · open · 3 ─────────╮╭─ repo · 1 overview 2 diff 3 checks ──╮
│ # title author age ││ │
│ ▌#128 Add rate limiting alice 2h ││ the selected PR, in the view │
│ #127 Fix login redirect bob 1d ││ you picked │
╰───────────────────────────────────────╯╰──────────────────────────────────────╯
the PRs of the current section overview · diff · checks · comments
· while
loading). The current one is highlighted. On the right: the account
you're focused on (u) and any GitHub search (s). Long section names
shrink to their first word when the tabs don't fit.draft tag), author, age of the last update and the size
(+added −deleted). In the "all" state, merged and closed PRs are
tagged too.1 overview, 2 diff,
3 checks, 4 comments (Tab cycles them). J/K and
Ctrl+d/Ctrl+u scroll it; Enter opens it full screen.A section is a name, an optional account, and a GitHub search. They live
in ~/.config/sangam/sections, one per line:
# name | account | GitHub search
Review requested | | review-requested:@me
My PRs | | author:@me
Involved | | involves:@me -author:@me
Work: backend | work-login | repo:acme/api repo:acme/worker
Dependabot | | author:app/dependabot org:acme
gh account (as gh auth status lists it), or empty for
gh's active account. See Accounts.is:pr, the state (open/merged/closed) and newest
first, so leave those out. Several repo: filters in one search mean
any of these repos.# are comments.Useful searches:
| You want | Search |
|---|---|
| Waiting for your review | review-requested:@me |
| Waiting for your team's review | team-review-requested:acme/backend |
| Yours | author:@me |
| You're mentioned, assigned or commented | involves:@me |
| One repo / several | repo:acme/api · repo:acme/api repo:acme/web |
| A whole org | org:acme |
| A label | org:acme label:bug |
| Failing CI | author:@me status:failure |
| Approved, ready to go | author:@me review:approved |
| Drafts | author:@me draft:true |
| Bots | org:acme author:app/dependabot |
| Busy discussions | involves:@me comments:>10 |
Managing sections from inside sangam: press S for a menu to add
a section (name, account picked from your signed-in ones, search),
edit or delete the current one, move it left or right, or
pin the repo you're in as a permanent section. E opens the file in
your editor instead. Either way, sangam reloads right after.
The "here" tab: started inside a clone of a GitHub repo, sangam adds a
"repo (here)" section for it (unless a section already searches exactly
that repo), run as the folder's account (git config github.user, see
below). sangam remembers the section you were on last.
How many PRs: each section shows up to 50 PRs, newest activity first.
Narrow it with s or a more specific search to reach older ones.
sangam works with every account gh is signed in to (gh auth status):
A section with an account runs its search as that account. A section
without one runs as gh's active account, so it follows gh auth switch.
u focuses on one account: it cycles all accounts → each account →
all. Focused on one, you see its sections plus the account-less ones
run as it. The choice is remembered across runs (as long as that account
is still signed in), and shown at the top right.
Every action (review, merge, comment...) runs as the account of the section you're in.
The "here" tab uses git config github.user of the folder you started
in. If you keep work and personal code in different folders, set it per
folder with git's includeIf:
# ~/.gitconfig
[includeIf "gitdir:~/work/"]
path = ~/.config/git/work.gitconfig # contains: [github] user = work-login
/ filters the list as you type, fuzzy, over what's on screen (number,
title, author). Enter or Esc goes back to normal mode.s searches GitHub within the current section: anything GitHub search
takes, such as author:alice, label:bug, head:feature/x or words
from the title. It's added to the section's own search and shown at the
top right. An empty search clears it. It lasts until you quit.f cycles the state for every section: open → merged → closed →
all. F jumps between open and all.R reloads everything from GitHub (sangam also refreshes on its own
whenever you open it or change section, state, account or search).1 Overview: repo, number and title; a state badge (open, draft,
merged, closed), author, how long ago it was opened and updated, and
branch → base (fork PRs say so). Then status: whether it can merge
and why not (needs review, changes requested, behind, conflicts...),
checks passed/failed/running, reviews (who approved, who requested
changes, who's still requested), size with a change bar, labels and
assignees. Then the files with their +/− (long paths shortened in
the middle), the description rendered as Markdown, and a count of
comments.2 Diff: the whole diff, highlighted by bat.3 Checks: every check run, failed first, with its workflow and
duration. Enter here opens the failed jobs' logs: grouped by job
and step, timestamps removed, error lines in red.4 Comments: the conversation (comments and reviews with a body,
oldest first) and the review comments on the code, grouped by file and
line, replies marked.Enter opens the current view full screen in less (q returns).b opens the PR in your browser; y copies its link.| Key | What happens |
|---|---|
a | Approve, with an optional one-line message (Enter approves, Ctrl+c cancels) |
r | Request changes: your $EDITOR opens; write the review above the marker line and save. Leave it empty to cancel. |
c | Comment on the PR, in your editor the same way |
x | Close the PR without merging (asks first, optional closing comment); on a closed PR, reopen it |
d | Toggle between draft and ready for review |
o | Check out the PR's branch (gh pr checkout): only inside a clone of the PR's repo, asks first |
After each action the PR is re-read from GitHub, and you get a desktop
notification if notify-send is installed.
m opens the merge panel for the selected PR. It reads the PR and the
repo's merge settings fresh, then shows:
| Key | Shown when | Does |
|---|---|---|
s | it's ready and the repo allows squash | squash and merge; you can edit the commit title (prefilled Title (#123)) |
m | it's ready and the repo allows merge commits | create a merge commit |
r | it's ready and the repo allows rebase | rebase and merge |
u | the base moved on and the repo requires up-to-date branches | update the branch (merges the base in; checks run again) |
a | it's blocked (checks or review pending) and the repo allows auto-merge | enable auto-merge: GitHub squash-merges it once everything passes |
! | it's blocked and you're a repo admin | merge anyway as admin, bypassing branch protection |
d | it's a draft | mark it ready for review |
o | it has conflicts and you're in its clone | check out the branch to resolve them (outside its clone, sangam shows the gh command instead) |
q / Esc | always | close the panel |
Before merging, sangam asks whether to delete the branch on GitHub
afterwards (unless the repo already does that, or the PR comes from a
fork), then confirms once: Enter merges, Esc cancels. Your local
checkout is never touched. The panel re-reads the PR after each step, so
"update branch → enable auto-merge" works in one sitting.
sangam opens in normal mode: letters are commands. / switches to
typing a filter; Enter or Esc switches back.
Move and find
| Key | Action |
|---|---|
j / k | next / previous PR |
g / G | first / last PR |
h / l | previous / next section |
/ | filter the list |
s | search GitHub within the section |
f | cycle open / merged / closed / all |
F | toggle open ↔ all |
u | switch account |
R | reload from GitHub |
S | add / edit / delete / move sections, pin this repo |
E | edit the sections file |
Read
| Key | Action |
|---|---|
1 2 3 4 | overview / diff / checks / comments |
Tab | next view |
J / K | scroll the preview down / up |
Ctrl+d / Ctrl+u | scroll half a page |
Enter | current view full screen (failed logs in checks) |
b | open in the browser |
y | copy the link |
Act
| Key | Action |
|---|---|
m | merge panel |
a | approve |
r | request changes |
c | comment |
x | close / reopen |
o | check out the branch (in its clone) |
d | draft ↔ ready for review |
? | show every key |
q / Esc | quit |
The merge panel's own keys are listed under Merging.
sangam open it in this folder (any terminal, in tmux or not)
sangam -C <dir> open it as if started in <dir>
sangam doctor check the dependencies and the GitHub sign-in
sangam mcp an MCP server for AI agents (see For AI agents)
sangam call <tool> [json] one agent tool, for agents without MCP
sangam --version print the version
sangam --help show the help
sangam doctor exits non-zero when something required is missing, so it
also works in scripts.
An AI agent (Claude Code, Codex, Aider, anything that speaks MCP or runs a command) can use your pull requests through sangam: list and search them, read one with its checks, reviews and comments, read its diff, and comment, review or merge. Reading is free; anything that writes to GitHub waits for your yes.
Add it to Claude Code (any MCP client works the same way; the server is
sangam mcp, on stdio):
claude mcp add --scope user sangam -- sangam mcp
An agent without MCP runs the same tools as commands:
sangam call list the tools
sangam call pr_list '{"section":"Review requested"}'
sangam call pr_view '{"pr":"owner/repo#12"}'
| Tool | What it does |
|---|---|
pr_accounts | the signed-in gh accounts, gh's active one, and the one picked in sangam |
pr_counts | how many PRs wait for your review and how many of yours are open (per account) |
pr_list | a GitHub search (query), one of your sections (section), or every section; state, account, limit |
pr_view | one PR: state, branches, mergeability, reviews, requested reviewers, checks (failing ones with links), files, description, comments, inline review comments |
pr_diff | its diff, or one file's; cut at max_lines (2000) |
pr_comment | post a comment: asks you first |
pr_review | approve, request changes or comment: asks you first |
pr_merge | merge (squash, merge or rebase) or turn on auto-merge, optionally deleting the branch: asks you first |
A PR is owner/repo#number or its URL. Without account, the tools use
the account you picked in sangam with u (empty there: all accounts), else
gh's active one; for one PR, the first of those that can see it.
Approving. A write opens a popup on your tmux client (the agent's own pane when it runs in tmux, else the client you used last). It says in one sentence who wants what ("Claude Code wants to squash and merge into main"), then what you asked, then labels for what's at stake ("lands on main", "not ready: 1 check failed", "public on the PR"). The details sit beside the exact text or, for a merge, what's ready, the commits that land and what follows, numbered. A merge that isn't ready says what's stopping it (each failed check, who a review waits for); a comment or review says who gets notified. The border turns red for a merge. It stays perfectly still while it waits. It counts down to the 10 minutes after which no answer is a no, and after you answer says for a moment what that did:
| Key | |
|---|---|
y | approve: sangam does it and tells the agent |
n / Esc | decline: nothing happens, the agent is told you declined |
e | edit the text in your editor first; the agent is told what was posted |
u | undo your edit |
d | view the PR's diff |
l | open a failed check's log in the browser |
b | open the PR on GitHub in the browser |
j / k | scroll the text |
Enter never answers, and a key pressed as the popup opens can't either.
No answer in 10 minutes is a no. Without tmux, a desktop notification with
Approve / Decline buttons asks instead (no editing); with neither, writes
are refused. Titles, descriptions, comments and diffs are other people's
words, so the tools hand them to the agent inside <untrusted> blocks and
the server tells it to treat them as data.
The popup is a consent step, not a sandbox: an agent that can run gh
itself can still do so. It's there so an agent that uses sangam never acts
on GitHub without you seeing it first.
sangam doesn't need tmux to be your terminal setup: it runs its own private tmux server for its layout, with its own socket and none of your tmux config. Run it in a tmux pane like any other program.
If you do use tmux, sangam can also be a popup on a key: prefix G
opens it over whatever you're doing, in the current pane's folder, and
prefix G again closes it.
With TPM: add this to your tmux
config, above TPM's run line, then press prefix I:
set -g @plugin 'Theyashsawarkar/sangam'
TPM keeps its own copy in ~/.tmux/plugins/sangam; you don't need the
sangam command installed separately for the popup.
Without TPM: with sangam cloned somewhere, add:
run-shell ~/path/to/sangam/sangam.tmux
Options (set them before TPM's run line):
| Option | Default | |
|---|---|---|
@sangam-key | G | key after the prefix that opens the popup (and closes it from inside); none binds nothing |
@sangam-width | 90% | popup width |
@sangam-height | 88% | popup height |
@sangam-title | sangam | popup title |
@sangam-launcher | your own popup command instead of display-popup. It's run with display-popup's arguments appended (-E -d DIR -T TITLE CMD), tmux formats expanded |
For example, P instead of G, and a popup helper of your own:
set -g @sangam-key 'P'
set -g @sangam-launcher "~/.tmux/scripts/popup.sh '#{client_name}'"
sangam has its own palette. With varna
(a theme engine) installed, it takes the current theme's colours instead:
it reads ~/.local/state/varna/fzf.sh at start (the list, borders, badges,
review states, section tabs and the key sheet), so switching the theme
recolours the next sangam you open.
| Path | What |
|---|---|
~/.config/sangam/sections | your sections (format) |
~/.cache/sangam/ | cached lists and PR details (safe to delete), the last section and account |
~/.cache/sangam/changed | the time PRs last changed through sangam (or were reloaded): a status bar can watch it to recount |
$XDG_RUNTIME_DIR/sangam-ask.XXXXXX/ | an agent's request while it waits for your approval, removed after |
$XDG_RUNTIME_DIR/sangam.XXXXXX/ | one run's state and its private tmux socket, removed on quit |
sangam respects XDG_CONFIG_HOME and XDG_CACHE_HOME. Other variables:
| Variable | Used for |
|---|---|
VISUAL, EDITOR | writing reviews and comments, editing the sections file (default vi) |
BAT_THEME | the colors of diffs and descriptions (any bat --list-themes theme) |
GH_CONFIG_DIR, GH_TOKEN | passed through to gh as usual (sections with an account use that account's token) |
Upgrading from tmux-gh-pr (sangam's earlier name): your
~/.config/gh-pr/sections is copied to ~/.config/sangam/sections the
first time sangam runs. In tmux, replace Theyashsawarkar/tmux-gh-pr with
Theyashsawarkar/sangam and rename any @gh-pr-* options to
@sangam-*.
sangam is a single Bash script that calls itself for each part of the screen:
sangam --preview <repo#number>, and its
key bindings call back into sangam for every action. That split is what
lets the tabs span both the list and the preview.gh api graphql) that brings
the list with CI and review state in a single request. All sections are
fetched in parallel in the background at start, so tab counts fill in
and switching sections is instant.gh pr view), diffs and review comments are cached per PR
in ~/.cache/sangam and prefetched for the first PRs of a section.
Cached data shows first; fresh data replaces it as it arrives.gh commands (gh pr merge, gh pr review,
gh api ...), run with the section's account token
(gh auth token --user). sangam never stores a token itself."gh isn't signed in to github.com"
Run gh auth login. sangam only talks to github.com (not GitHub
Enterprise Server yet).
Icons show as boxes or question marks Your terminal's font isn't a Nerd Font. Install one (e.g. JetBrainsMono Nerd Font) and select it in your terminal's settings.
Colors look washed out or wrong
Your terminal needs truecolor (24-bit) support, which every modern
terminal has. If it's set up but not advertised, export
COLORTERM=truecolor in your shell's rc file.
sangam doctor says fzf is too old
Your distribution's fzf predates 0.66 (common on Debian and Ubuntu). See
Requirements for getting a current one.
A section always shows 0
Try its search on github.com (pull requests tab) or with
gh search prs "<search>". If it finds PRs there, check the section's
account: it needs access to those repos (private repos, org SSO). For an
org with SAML SSO, authorize gh's token for it in your GitHub settings
(Settings → Applications → Authorized OAuth Apps → GitHub CLI → Grant).
o (checkout) says it only works inside a clone
Checkout switches the branch of the folder sangam was started in, so
start sangam inside a clone of that PR's repo (or use sangam -C <clone>).
The diff or description has no colors
Install bat. On Debian/Ubuntu it's called batcat; link it as bat
(see Requirements).
The tmux popup opens but prefix G doesn't close it
Close it with q. The popup uses your tmux prefix at the time it opened;
if you changed your prefix since, reopen it. If you changed the key, set
@sangam-key before TPM's run line, then reload tmux.
Something else
Run sangam doctor, then open an issue
with its output and what you did.
Bug reports, ideas and pull requests are welcome. Before a PR:
make check # shellcheck + syntax + CLI smoke test (what CI runs)
Test changes by hand too: run bin/sangam from your clone. For the tmux
popup, use a throwaway tmux server so your real one isn't touched:
tmux -L test -f /dev/null new -s t
tmux -L test run-shell "$PWD/sangam.tmux" # then prefix (Ctrl+b) G
Theyashsawarkar/pr-playground is a public repo with one open PR per merge situation (clean, conflicting, behind its base, failing CI, draft, waiting for a review), handy for trying the merge panel. Every change gets an entry in CHANGELOG.md. More notes for contributors (and AI coding agents) are in CLAUDE.md.
stat/mktemp/grep, no setsid)MIT. sangam is part of Vayu, a keyboard-driven Arch Linux desktop, and works anywhere on its own. Built on the shoulders of gh, fzf, tmux, jq and bat.