Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Resources to explore

Check out popular resources, tools, and information from Red Hat. We'll recommend more as you browse.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

tongs: Unified code review for GitHub & GitLab in your terminal

November 30, 2026
Andre Lustosa Rohan Devasthale
Related topics:
Developer tools
Related products:
Red Hat Trusted Artifact Signer

    It's Monday morning. You have 3 pull requests (PRs) waiting on github.com, 2 merge requests (MRs) on your company's GitLab, and 1 on a self-hosted GitHub Enterprise you'll forget about until someone pings you. That's 3 browser tabs, 3 notification streams, and 3 different ideas of what "approve" means.

    The tongs tool puts all of them in 1 inbox, in your terminal. It finds the repos already cloned on your disk, reads their Git remotes, and builds a single review queue across GitHub and GitLab, including self-hosted instances. From there you read syntax-highlighted diffs, leave inline comments, suggest changes, dig into failing continuous integration (CI), and approve, without opening a browser.

    No new accounts, no new tokens, no config to start. If gh or glab already works on your machine, try it now:

    uvx tongs

    This post follows 1 full review from start to finish: install, inbox, diff, comments, CI, and approval. At the end, we show how to give an AI assistant access to the same inbox, with guardrails that stop it from merging anything.

    What you need

    Before you start, make sure your environment meets these requirements:

    • Python 3.12 or newer. The tongs tool doesn't require a compiler or system-level dependencies.
    • A login for at least 1 forge. Because tongs never stores tokens, it queries gh and glab on the command line at runtime, falling back to ~/.netrc or your system keyring if configured.
    • Some cloned repos. By default, tongs searches ~/git.

    We verified everything in this post against tongs 1.1.1 (October 2026). The project updates frequently, so check release notes if behavior varies.

    Install and authenticate

    Use pipx or uv to isolate tongs from the rest of your environment:

    pipx install tongs
    # or
    uv tool install tongs
    # or try it without installing
    uvx tongs

    If gh or glab is already working, you're all set. Otherwise, run:

    gh auth login                                     # GitHub
    glab auth login                                   # gitlab.com
    glab auth login --hostname gitlab.example.com     # self-hosted GitLab

    You never configure credentials twice. Once gh and glab work on the command line, tongs works. Should a GitLab OAuth token expire mid-session, tongs runs glab auth status to refresh it and automatically retries the request.

    Point it at your repos

    Run tongs with no arguments to scan your default ~/git directory, or pass --scan-root to specify another path:

    tongs                          # scans ~/git
    tongs --scan-root ~/projects   # one-off override

    To make your root directory permanent, update ~/.config/tongs/config.toml. Self-hosted instances go here too, because tongs can't determine whether an address like git.corp.com serves GitHub Enterprise or GitLab:

    [general]
    scan_root = "~/projects"
    scan_depth = 5
    [hosts.work-gitlab]
    hostname = "gitlab.example.com"
    forge_type = "gitlab"
    [hosts.work-ghes]
    hostname = "github.corp.com"
    forge_type = "github"

    Once configured, run tongs to view your unified review queue (Figure 1).

    tongs inbox listing pull requests and merge requests from GitHub and GitLab side by side.
    Figure 1. The tongs inbox showing GitHub PRs and GitLab MRs in one list, with CI status and author columns.

    The inbox is fast because of a local SQLite cache. Lists stay cached for 60 seconds, diffs for 300 seconds, and the whole cache is capped at 100 MB with least-recently-used eviction. Any write you make, such as posting a comment or approving, clears the entries it affects. If you need fresh data, Ctrl+R refreshes the current view, and Clear Cache in the command palette (Ctrl+P) wipes everything.

    Reading the diff

    Press Enter on a review to open it. The detail screen has 5 tabs—Overview, Diff, Commits, Discussion, and Pipeline—mapped to keys 1 throuh 5. Press 2 for the diff.

    The diff view has a file tree on the left and the diff on the right. Highlighting uses Pygments, and inside a changed line the words that changed are bold and underlined. On a long line where only 1 argument changed, this highlighting makes the edit easy to spot.

    These are the keys that matter most:

    KeyWhat it does
    j or kMove down or up
    n or NMove to the next or previous file
    vSwitch between unified and split view
    eExpand the folded unchanged lines under the cursor
    FShow the whole file
    mRender a Markdown file as a preview
    ] or [Jump to the next or previous comment

    Long stretches of unchanged code fold into "... N unchanged lines ..." markers. If a file is too large for the forge's API to return, it still shows up in the tree with its added and deleted line counts and an option to open it in the browser, so it doesn't disappear.

    Commenting and suggesting changes

    Move to a line and press c. A comment editor opens at the bottom of the screen. Write your comment and press Ctrl+S to post it. Press F2 if you'd rather write in your own $EDITOR.

    To comment on several lines, extend the selection with Shift+J or Shift+K (or press Ctrl and click) and then press c.

    If you try only 1 thing in tongs, try suggested changes. Select the lines you want changed and press F3. Next, tongs opens your $EDITOR with that code already in it. Edit it, save, and tongs posts the forge's own suggestion format: a suggestion block on GitHub or suggestion:-0+N on GitLab. Either way, the author can accept the change in a single step by selecting Apply suggestion.

    Existing comment threads show up as markers in the diff's gutter. Press d to expand a thread, r to reply, and R twice to resolve it. The Discussion tab (4) shows every thread as a card, filterable by unresolved or resolved, and pressing Enter on a card jumps to its line in the diff.

    Review like a human: 1 notification, not 20

    Posting every comment the moment you write it sends dozens of notifications to the author. Press Ctrl+G to start review mode instead. Your comments, replies, and suggestions go into a local draft, and nothing reaches the forge until you submit.

    A status bar shows where the draft stands:

    REVIEW DRAFT | 2 comments | v3 | editable | Ctrl+G review

    Every save is a transaction in the same local SQLite database, so a draft survives a crash, a closed terminal, or a reboot. Open the review again and your draft is still there. When you're done, press Ctrl+G to open the draft, v to choose a verdict (Comment, Approve, or Request changes on GitHub), and Ctrl+S to submit everything as 1 review.

    The draft is tied to the exact revision you were reviewing. If the author pushes while you're writing, tongs marks the draft as stale and lets you start a new revision. Your comments never land on code you didn't read.

    When CI is red

    The Pipeline tab (5) lets you step through 3 levels: pipelines, jobs grouped by stage, the full job log with its American National Standards Institute (ANSI) colors intact. Press / to search the log and n or N to jump between matches. Press F2 to open the log in your editor, or R twice to retry a flaky job.

    That's usually enough to tell whether a failure is the author's fault or the runner's.

    Approve and merge

    Back on the review, the last steps are single keys:

    • A: Approve
    • M: Merge
    • X: Close
    • U: Remove your approval (GitLab)

    Each of these needs a double press to confirm, so a stray keystroke can't merge anything. The Overview tab also shows whether the review is ready to merge: draft status, conflicts, failing CI, and the forge's own merge status.

    Bonus: Give your AI assistant the same inbox

    An optional Model Context Protocol (MCP) server comes with tongs, so an AI assistant like Claude Code or Codex can read your reviews using the same configuration and the same tokens you already set up:

    pip install "tongs[mcp]"
    claude mcp add tongs -- tongs-mcp     # Claude Code
    codex mcp add tongs -- tongs-mcp      # Codex

    The server gives the assistant 6 tools: list_mrs, get_mr, get_mr_diff, post_comment, approve_mr, and list_pipelines. The server deliberately excludes merge, close, reopen, and cancel operations as a security boundary. That means you can ask "Summarize the open PRs on github.com/acme/app and tell me which ones have failing pipelines" without worrying that the assistant will merge something on its own.

    Coming next: Open a repo without cloning it

    This feature is on main now and should ship in the next release. It fills the 1 gap in the scan-your-disk model: sometimes you need to review a project you've never cloned. In the repository list, press a and enter a path such as gitlab.com/group/subgroup/project. You can also paste a web URL, a clone URL, or a link to a single review. After you enter the address, tongs checks that it can read the project and opens its inbox. The project stays in the repo list, marked (remote), until you press x or quit.

    Rohan built this feature, starting from issue #454. It's a good example of how tongs grows: an issue describes the gap, and a contributor picks it up.

    Prefer RPMs?

    Each stable release attaches Fedora RPMs to its GitHub release (install them with dnf install ./*.rpm), along with a software bill of materials (SBOM) and Sigstore signatures.

    Wrapping up

    Here is a quick recap of how tongs simplifies your review workflow:

    • tongs builds 1 review inbox from the Git remotes already on your disk, across GitHub, GitLab, and their self-hosted versions.
    • It uses your existing gh and glab logins and never stores tokens.
    • Review mode and the MCP server both pin your work to the exact revision you read, so nothing lands on code nobody looked at.

    Try it in 1 command. Run uvx tongs in a directory full of repos and press ? for the keybindings.

    Tell us what's missing. The tongs project is young and moves fast. If a workflow doesn't fit, a forge behaves oddly, or something breaks, open an issue at github.com/andre-motta/tongs. Many features and fixes in tongs started as an issue.

    Build it with us. Issues labeled "good first issue" in the repository are a good place to start, and the documentation at tongs.tools cover the rest. Rohan's open-without-cloning feature started as an issue, so the next one could be yours.

    Recent Posts

    • tongs: Unified code review for GitHub & GitLab in your terminal

    • Red Hat OpenShift AI and OpenShift on AWS for sovereign AI agents

    • Performance testing: Where benchmarks meet reality

    • Securing multimodal AI with NeMo Guardrails and vision models

    • Scaling multicluster GitOps with argocd-agent and Red Hat Advanced Cluster Management for Kubernetes

    What’s up next?

    Share graphics_Git

    Git cheat sheet

    Bob Reselman
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI