Skip to content

codewithrafli/mainbound

Repository files navigation

Mainbound

Mainbound

From shell to main.

The macOS and Windows terminal workspace that collapses your entire shipping workflow —
terminal, git, and pull requests — into one focused window.

Latest release Downloads macOS & Windows Tauri 2

Mainbound demo

Terminal → Changes → Commit → Push → PR → CI → Merge


Why Mainbound?

Shipping a branch normally means juggling three apps: a terminal for the work, a git client for staging, and a browser tab for the pull request. Context switching burns focus.

Mainbound puts all three in one window. Every terminal session knows its repository, branch, and open PR. The cockpit strip shows live changes, ahead/behind count, review state, and CI status — without running a single status command.


Features

Terminal — the real thing

  • Native PTY over zsh/PowerShell, rendered with xterm.js + WebGL
  • Recursive splits⌘D right, ⇧⌘D down, infinite nesting
  • Drag-and-drop pane docking — grab a pane, drop it anywhere
  • ⌘F in-terminal search with highlighted matches
  • Full scrollback that survives view switches and app restarts
  • Sessions scoped per workspace — switch workspaces, sessions stay alive

PR Cockpit

Always-visible strip above the terminal:

  • Branch switcher with one-click checkout and new-branch creation
  • Changed files count — click to jump to File Changes
  • ↑↓ ahead/behind with push/pull buttons
  • Open PR title + number, live review state, CI pass/fail
  • Reveal in Finder / Explorer button for the active repo

File Changes

  • Status badges (M/A/D/R/U/!) with ±line counts
  • Syntax-highlighted unified diff (VS Code-grade, dark theme)
  • Stage / unstage / discard individual files or all at once
  • Per-hunk staging — stage specific diff blocks, not whole files
  • AI commit messages generated by the local claude CLI — no API key needed
  • Amend last commit toggle — rewrites with updated message or files
  • Cherry-pick any commit from history into the current branch
  • Stash manager — push with message, apply, drop
  • Conflict helper — Accept Ours / Accept Theirs per conflict file, then auto-stage
  • Filter files by name when the change list gets long

Pull Requests — fully in-app

  • Full conversation timeline: comments, reviews, commits, events
  • Inline review threads with reply and resolve, sorted by time
  • Per-file diffs with syntax highlighting
  • CI log streaming — open job logs inside Mainbound, not the browser
  • Merge with method picker (merge / squash / rebase) and confirmation
  • Convert draft → Ready for Review without touching GitHub
  • GitHub Issues list linked to the active repo
  • AI-generated PR descriptions via the local claude CLI
  • PR template auto-fill from .github/pull_request_template.md
  • Multi-account GitHub support — tokens live in the OS native keystore

Notifications

  • Three detection layers: terminal bell, OSC 9/777, and a "command finished" burst heuristic
  • Native OS notification + in-app toast + sidebar badge dot
  • Works with Claude Code: permission prompts and build completions surface as banners in the background

Everything else

  • Auto-update with changelog — checks on launch, installs in-app
  • Persisted zoom, window size, and sessions across restarts
  • Command palette ⌘K — jump to any session, repo, or action
  • No telemetry. No accounts. No cloud.

Install

macOS

One line — no Gatekeeper friction:

curl -fsSL https://raw.githubusercontent.com/codewithrafli/mainbound/main/install.sh | bash

Or grab the .dmg from Releases (Apple Silicon & Intel). Direct downloads are unsigned, so run this once after installing:

xattr -dr com.apple.quarantine /Applications/Mainbound.app

Windows

Download the .msi installer from Releases (x64).
Run the installer — no extra steps needed.

Requirements: Git for Windows and PowerShell 7+ (winget install Microsoft.PowerShell) recommended for the best terminal experience.


Mainbound updates itself — installing is a one-time affair.


Keyboard shortcuts

Shortcut Action
⌘T / Ctrl+T New terminal session
⌘D / Ctrl+D Split pane right
⇧⌘D / Ctrl+Shift+D Split pane down
⌘W / Ctrl+W Close focused pane
⌘1 / Ctrl+1 Terminal view
⌘2 / Ctrl+2 File Changes view
⌘F / Ctrl+F Find in terminal
⌘K / Ctrl+K Command palette
⌘↵ / Ctrl+Enter Commit (from commit form)
⌘= / Ctrl+= Zoom in
⌘− / Ctrl+- Zoom out
⌘0 / Ctrl+0 Reset zoom

Development

# Clone and install
git clone https://github.com/codewithrafli/mainbound.git
cd mainbound
bun install

# Run in dev mode
bun run tauri dev

Requirements: Rust (rustup), Bun, git on PATH.

src-tauri/.cargo/config.toml is machine-specific (custom target-dir) and gitignored — create your own if needed.

Record a demo:

bun run demo        # guided screen-record → MP4 + GIF
bun run demo 75     # fixed 75-second recording

Release:

bun run release 0.x.y   # bumps versions, tags, pushes → CI builds macOS + Windows

Architecture

src-tauri/src/
  pty.rs       — portable-pty sessions, UTF-8-safe streaming via pty://data/{id}
  git.rs       — git CLI (porcelain v2), stash, blame, hunk staging, cherry-pick
  github.rs    — GitHub REST + GraphQL, tokens in OS native keystore
  ai.rs        — commit/PR generation via local claude CLI
  notify.rs    — 3-layer notification dispatch (cross-platform)
  workspace.rs — workspace + repo discovery, session persistence

app/
  stores/      — terminals, git, github, cockpit, notifications, settings, updater
  components/  — terminal panes, file changes, PR detail, cockpit bar, command palette

Philosophy

Small and focused. Every feature answers one question: Does it speed up the journey from terminal to a merged PR?

No code editor. No AI chat. No dashboards. There are better tools for those.


Made with ☕ by codewithrafli