---
title: "tongs: Unified code review for GitHub & GitLab in your terminal"
description: "The tongs tool unifies code review from GitHub, GitLab, and self-hosted instances into a single terminal inbox by scanning repos already cloned on disk and reading their Git remotes. It uses existing gh and glab command-line logins, never stores tokens, and requires no configuration beyond a working authentication for at least one forge. Users can read syntax-highlighted diffs, leave inline comments, suggest changes with the forge’s suggestion format, and inspect CI pipeline logs, all without opening a browser. A review mode collects comments into a local draft tied to the exact revision, preventing notifications until submission and surviving crashes via a SQLite database. An optional MCP server gives AI assistants read-only access to the same inbox, with tools for listing, viewing diffs, commenting, and approving, but deliberately excludes merge and close operations."
---

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

[Red Hat](https://yomu.fyi/company/red-hat) · Andre Lustosa, Rohan Devasthale · Nov 30, 2026

**Type:** Tutorial

## Summary

The tongs tool unifies code review from GitHub, GitLab, and self-hosted instances into a single terminal inbox by scanning repos already cloned on disk and reading their Git remotes. It uses existing gh and glab command-line logins, never stores tokens, and requires no configuration beyond a working authentication for at least one forge. Users can read syntax-highlighted diffs, leave inline comments, suggest changes with the forge’s suggestion format, and inspect CI pipeline logs, all without opening a browser. A review mode collects comments into a local draft tied to the exact revision, preventing notifications until submission and surviving crashes via a SQLite database. An optional MCP server gives AI assistants read-only access to the same inbox, with tools for listing, viewing diffs, commenting, and approving, but deliberately excludes merge and close operations.

## Context

The post addresses the problem of managing code reviews across multiple forges (GitHub, GitLab, self-hosted) with separate browser tabs and notification streams. It introduces tongs, a terminal-based tool that consolidates all reviews into one inbox by scanning local repositories and reading their Git remotes. The tool leverages existing gh and glab CLI logins, requires no additional tokens or configuration, and provides features for reading diffs, commenting, suggesting changes, inspecting CI pipelines, and approving or merging. It also includes a review mode for batching comments and an optional MCP server for AI assistant integration.

## Approach / What changed

The tongs tool is implemented as a Python CLI that scans a configurable directory (default ~/git) for cloned repositories, reads their Git remotes to identify the forge (GitHub or GitLab), and builds a unified review queue using a local SQLite cache. It authenticates by calling gh and glab on the command line at runtime, falling back to ~/.netrc or system keyring. The diff view uses Pygments for syntax highlighting and highlights changed words within lines. Comments and suggestions are posted via the forge’s API. Review mode stores drafts in SQLite, tied to the exact revision, and submits as a single review. The MCP server provides six tools (list\_mrs, get\_mr, get\_mr\_diff, post\_comment, approve\_mr, list\_pipelines) and excludes merge, close, reopen, and cancel for safety.

## Takeaways

- tongs unifies code review from GitHub, GitLab, and self-hosted instances into a single terminal inbox by scanning local repos and using existing gh/glab logins.
- Review mode collects comments into a local draft tied to the exact revision, preventing notifications until submission and surviving crashes via SQLite.
- The optional MCP server gives AI assistants read-only access to the review inbox, with tools for listing, viewing diffs, commenting, and approving, but excludes merge and close operations.

## FAQ

### How do I install and authenticate tongs?

Install tongs with pipx or uv, or try it without installing using uvx tongs. Authentication uses your existing gh and glab CLI logins; run gh auth login or glab auth login if not already configured. tongs never stores tokens and queries the CLI at runtime.

### Can tongs work with self-hosted GitHub or GitLab?

Yes. Configure self-hosted instances in ~/.config/tongs/config.toml by specifying the hostname and forge type. tongs can then scan repos from those instances and include them in the unified review queue.

### How does the MCP server for AI assistants work?

Install tongs with the mcp extra and add the server to your AI assistant (e.g., Claude Code or Codex). The server provides six tools for reading reviews, posting comments, and approving, but deliberately excludes merge, close, and other destructive operations for safety.

**Tags:** [CLI](https://yomu.fyi/topic/cli), [Code Review](https://yomu.fyi/topic/code-review), [GitHub](https://yomu.fyi/topic/github), [GitLab](https://yomu.fyi/topic/gitlab), [Terminal](https://yomu.fyi/topic/terminal)

- Source: [Red Hat](https://developers.redhat.com/articles/2026/11/30/tongs-unified-code-review-github-gitlab-your-terminal)
- Source URL: https://developers.redhat.com/articles/2026/11/30/tongs-unified-code-review-github-gitlab-your-terminal
- Ingested by Yomu: 2026-11-30T15:00:16.766Z

[Read original post](https://developers.redhat.com/articles/2026/11/30/tongs-unified-code-review-github-gitlab-your-terminal)
