A single-operator, self-hosted software forge with native Git Desktop source control, local CI actions runner, and an autonomous AI coding agent β running entirely on your own hardware.
SourceHub turns any directory of local git repositories (default: ~/Dev) into a comprehensive, high-performance development forge served on your machine (localhost by default; LAN only if you intentionally rebind).
Designed specifically for solo developers, single operators, and agentic AI pair programming, SourceHub replaces both GitHub and GitHub Desktop without relying on external cloud infrastructure, subscriptions, or telemetry:
- π₯οΈ Full Source Control Workbench β Hunk-level staging, discard, auto-fill commits, undo commit, stash management, branch switching, and remote sync.
- Autonomous AI Coding Agent ("Helper") β Async task execution using local Ollama models. The agent snapshots the repository, ranks relevant files, writes code in an isolated git worktree, commits changes with audit trailers, opens PRs, runs reviews, and even addresses review comments automatically.
- π Pull Requests & Code Review β Full PR lifecycle backed by Node's built-in SQLite, featuring pre-flight merge conflict detection, squash/rebase/merge strategies, CI check gating, post-merge issue auto-closing, and branch pruning.
- β‘ Local Actions CI Runner β Executes
.sourcehub/workflows/*.ymllocally with live step-by-step logs, status indicators, and duration tracking. - π Issue Tracker β Built-in issue lifecycle with one-click "Assign to Agent" handoff.
- π Git Smart HTTP Wire Protocol β Built-in Smart HTTP server allows standard
git clone http://<host>:5177/git/<repo>.gitover localhost and LAN. - π Secrets, Keys & Webhooks β Encrypted repository/global secrets vault, SSH user & deploy keys registry, hashed Personal Access Tokens (enforced), optional
SOURCEHUB_TOKENshared secret for LAN, and outbound webhooks with optional HMAC signing and live ping testing. - π¨ 14 Themes & Profile Customization β Matrix Neon (default), Cyber Amber, Tokyo Night, Dracula, OLED Black, and more, alongside persistent operator profile settings stored in SQLite.
- π Zero Web Framework Overhead β Powered by Node 22+ built-in
node:httpandnode:sqlite, eliminating bloated web frameworks and native C++ binary dependencies.
1 β The Hook Β· Helper agent
Prompt a coding task, pick a local Ollama model, and watch the run move through Queued β Ready with an audit trail.
2 β The Classic Workflow Β· Desktop
Hunk staging, live diffs, and commit/push for day-to-day source control.
3 β The Proof Β· Pull requests
Full PR lifecycle on the local forge β merge strategies, CI gating, and Smart HTTP-backed repos.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Surfaces β
β Web Browser (LAN / Local) β Desktop App Launcher β Git CLI β
βββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β HTTP / REST / Git Smart HTTP
βββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β SourceHub Standalone Daemon β
β Native Node 22+ HTTP Server (node:http) β No Express / No Fastify β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Git Service (Native CLI runner) β’ Working Copy Status β
β β’ Hunk Staging / Apply Patch Engine β’ Smart HTTP (Upload Pack) β
β β’ Pull Request & Merge Pre-flight β’ Local Actions CI Runner β
β β’ AI Helper Service (Ollama Worktrees) β’ Outbound Webhook Dispatch β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Storage & Execution Layer β
β β’ Built-in SQLite (node:sqlite) β ~/.sourcehub/sourcehub.db β
β β’ Repositories Directory β ~/Dev/* β
β β’ Isolated Agent Worktrees β ~/.sourcehub/worktrees/* β
β β’ Local Ollama Daemon β http://localhost:11434 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Live Status Monitoring: Tracks modified, added, deleted, renamed, and untracked files with ahead/behind commit indicators and upstream tracking.
- Hunk-Level Staging: Interactive unified diff view allowing staging or unstaging of individual hunks via native
git apply --cached. - Auto-Fill Commit Fields: Generates concise, conventional commit summaries and descriptions by analyzing staged diffs.
- Safe Operations: Discard changes per file, selection, or all working changes at once; undo last commit (
git reset --soft HEAD~1). - Branch Management: Quick branch switcher, new branch modal with base branch selection, and active branch deletion protection.
- Stash Drawer: Save working state to stash with custom messages, pop, apply, or drop stashes.
- Remote Synchronization: Manage multiple remotes (add, edit, remove), fetch, pull, and push with automatic upstream tracking setup, plus assisted GitHub remote integration.
Helper is an asynchronous repository agent designed for autonomous code development:
- Context Snapshotting & File Ranking: Rather than naive full-repo dumps, SourceHub uses semantic scoring to prioritize and rank relevant tracked files alongside branch diffs, tree structure, and commit history.
- Isolated Worktrees: The agent performs all edits inside dedicated git worktrees (
~/.sourcehub/worktrees/<run-id>), preventing interference with your active workspace. - Robust Code Parsing: Parses both structured multi-file blocks (
<<<FILE: path>>>...<<<END_FILE>>>) and standard markdown headers. - Audit Trailers: Commits are authored using your operator identity with a transparent audit trailer:
SourceHub-Agent-Run: <run-id>. - PR Lifecycle Integration:
- Autonomous PR Creation: Opens a PR with AI-generated titles and descriptions.
- Automated PR Review: Performs line-by-line automated code review on PR diffs.
- Address Review Comments: The agent reads reviewer feedback, checks out the branch, implements the requested changes, commits them, and replies to comment threads.
- Ollama Integration: Seamless model discovery from
localhost:11434or custom endpoints, pre-configured for models likeglm-5.3-flash:cloud,llama3,deepseek-coder,qwen, and more.
- Rich Diff Viewer: Side-by-side and unified diff views with syntax highlighting.
- Pre-Flight Conflict Engine: Checks mergeability against target branches in real time before attempting a merge.
- 3 Merge Strategies: Support for Squash and Merge, Rebase and Merge, and Create a Merge Commit.
- CI Check Gating: Protects target branches by requiring passing Actions CI runs prior to merge.
- Post-Merge Automation: Automatically closes linked issues (e.g.,
#1,Closes #4) and prunes deleted feature branches. - Line & File Comments: Real conversation threads on pull requests.
- Declarative Workflows: Reads workflow definitions from
.sourcehub/workflows/*.yml. - Real Local Execution: Runs workflow
run:steps as shell commands on the host user β treat workflow YAML as trusted code. - Audit & History: Real-time log capture, exit code recording, execution timestamps, and run durations.
- Event Triggers: Dispatches automatically on
push,pull_request,agent_run, or manual UI dispatch.
- Clone and fetch directly with standard Git CLI tools:
# Loopback (no SOURCEHUB_TOKEN): unauthenticated local use git clone http://localhost:5177/git/my-repo.git # LAN / shared secret: pass token via HTTP Basic (password field) or configure git credential helper. # Preferred: Authorization Bearer / X-SourceHub-Token on API; for git CLI use: git -c http.extraHeader="Authorization: Bearer $SOURCEHUB_TOKEN" clone http://<lan-ip>:5177/git/my-repo.git # or with a PAT: git -c http.extraHeader="Authorization: Bearer sh_pat_β¦" clone http://<lan-ip>:5177/git/my-repo.git
- Dynamic LAN IP detection displayed in the repository clone drawer when the server is reachable on the LAN.
- Encrypted Secrets Vault: Store repository-scoped and global secrets with masked values for CI and agent workflows.
- Keys Management: Register and manage SSH user keys and deploy keys (fingerprints stored for display).
- Operator Shared Secret (
SOURCEHUB_TOKEN): When set, required for all/api/*and/git/*requests viaAuthorization: Bearer <token>orX-SourceHub-Token: <token>. Binding non-loopback (0.0.0.0/ LAN IP) without this env var causes the server to refuse to start. - Personal Access Tokens (PATs): Real tokens (
sh_pat_β¦) β SHA-256 hashed in SQLite; full token returned once on create; list UI shows prefix/last4 only. Accepted as Bearer credentials on API and Smart HTTP. - Auth acceptance order:
- Valid
SOURCEHUB_TOKEN, OR - Valid PAT, OR
- Unauthenticated only when bind is loopback and
SOURCEHUB_TOKENis unset.
- Valid
- Browser SPA: Settings β Access Tokens stores the operator token or PAT in
localStorageand sends it on every same-origin fetch. - Outbound Webhooks: Dispatch event notifications; HMAC SHA-256 signatures (
X-SourceHub-Signature-256) are attached when a webhook secret is configured. Built-in ping test tools included. - CI sandboxing (pragmatic): Workflow
run:steps execute viaexecFile('/bin/bash', ['-c', β¦])with sanitized env (no fullprocess.envdump), repo cwd, timeout/maxBuffer, and a light dangerous-pattern guard. Workflow YAML is trusted operator content β not a multi-tenant sandbox.
SourceHub features 14 tailored themes designed for readability and style:
- β‘ Matrix Neon (Default β Obsidian black with vivid electric green)
- π Cyber Amber (Phosphor VT220 amber on onyx)
- πΌ Tokyo Night (Midnight indigo with vibrant cyan & violet)
- β Catppuccin Mocha (Warm pastel & lavender dark)
- π¨ Monokai Pro (Charcoal with vivid yellow & lime)
- π Solarized Dark (Deep marine teal & amber)
- π High Contrast Dark (Ultra-crisp dark & azure)
- π GitHub Dark (Classic dimmed charcoal)
- π Midnight OLED (True 0x000 black)
- π§ Dracula (Iconic purple & cyan palette)
- βοΈ Nord Frost (Arctic blues & frost slate)
- π Synthwave 84 (Neon pink & cyan glow)
- βοΈ High Contrast Light (Clean, crisp daylight)
- π Warm Sepia (Warm parchment paper tone)
Persist your operator profile (name, username, email, bio, initials, avatar gradient, and theme) across reloads in SQLite.
- Node.js 22.0.0+ (Required for native
node:sqlite) - Git 2.30+ installed on the system path
- (Optional) Ollama installed and running (
ollama serve) for AI Helper capabilities
Pre-compiled packages for Debian, Ubuntu, and Linux Mint are available in the releases/ directory:
# Install package
sudo dpkg -i releases/sourcehub_0.1.3_amd64.deb
# Launch SourceHub (opens in default browser)
sourcehub# Clone the repository
git clone https://github.com/Nick040791/SourceHub.git
cd SourceHub
# Install frontend and server dependencies
npm installnpm run devVisit http://localhost:5177 in your browser.
SourceHub includes a standalone production HTTP server powered by native node:http:
# Build the React 19 frontend
npm run build
# Start the standalone server
npm run serveRun SourceHub automatically on login as a background service:
./scripts/install-service.shManage the service with standard systemd commands:
# Check status
systemctl --user status sourcehub.service
# View live logs
journalctl --user -u sourcehub.service -f
# Stop or restart
systemctl --user stop sourcehub.service
systemctl --user restart sourcehub.service
# Uninstall service
./scripts/uninstall-service.shA pre-configured launcher script is available in bin/:
./bin/launch-sourcehub.shThis checks if the SourceHub daemon is running, starts it if necessary, and opens the hub in your default browser.
| Variable | Default | Description |
|---|---|---|
PORT |
5177 |
Port for the HTTP server to listen on. |
HOST |
127.0.0.1 |
Bind address for the production daemon / Vite / packaged service (assets/sourcehub.conf). Use 0.0.0.0 only with SOURCEHUB_TOKEN set β the server refuses non-loopback binds without it. |
SOURCEHUB_TOKEN |
(unset) | Operator shared secret. When set, required for /api/* and /git/*. Required to bind beyond loopback. |
SOURCEHUB_REPOS_DIR |
~/Dev |
Base directory containing git repositories to discover and manage. |
SOURCEHUB_DATA_DIR |
~/.sourcehub |
Directory storing SQLite database (sourcehub.db), worktrees, and logs. |
NODE_ENV |
development |
Set to production when serving static frontend bundles. |
Threat model (single-operator forge): Default bind is 127.0.0.1 for both production and npm run dev. Loopback + unset SOURCEHUB_TOKEN allows unauthenticated local use. For LAN exposure: set a strong SOURCEHUB_TOKEN (e.g. openssl rand -hex 32), bind HOST=0.0.0.0, and paste the same token (or a PAT) into Settings β Access Tokens so the SPA can authenticate. Anyone who can reach the bind address without a valid shared secret or PAT cannot use the API or Smart HTTP.
AI provider settings (Ollama URL, default model) and user profile preferences can be configured directly in the Settings tab and Profile Modal within the web interface.
SourceHub/
βββ bin/
β βββ launch-sourcehub.sh # Desktop launcher script
βββ public/
β βββ sourcehub.svg # High-contrast logo & icon assets
βββ scripts/
β βββ install-service.sh # Systemd user service installer
β βββ uninstall-service.sh # Systemd user service uninstaller
βββ server/
β βββ auth.ts # Shared secret + PAT auth & workflow env helpers
β βββ agentService.ts # Autonomous AI coding agent & worktree manager
β βββ db.ts # Built-in SQLite database initialization (node:sqlite)
β βββ gitService.ts # Git CLI operations, Smart HTTP, and diff engines
β βββ index.ts # Production standalone daemon (node:http)
β βββ vitePluginGitApi.ts # API route handlers & development middleware
β βββ webhookService.ts # Outbound HMAC-signed webhook dispatcher
β βββ workflowService.ts # Local Actions CI runner engine
βββ src/
β βββ components/
β β βββ actions/ # CI workflow execution views & log viewers
β β βββ agents/ # Helper AI session launcher & run tracker
β β βββ code/ # Tree browser, blob viewer, & doc preview
β β βββ desktop/ # Source control workbench (hunks, commit, stash)
β β βββ issues/ # Issue list, details, and agent assignment
β β βββ layout/ # App header, repo header, and hamburger menu
β β βββ pr/ # PR comparison, diffs, reviews, and merge controls
β β βββ profile/ # Profile settings modal & 14 theme selectors
β β βββ settings/ # Secrets, tokens, keys, webhooks, and AI config
β βββ services/ # Frontend API client
β βββ types/ # Shared TypeScript interfaces
β βββ App.tsx # Root application component
β βββ index.css # Tailwind CSS & custom theme definitions
βββ package.json
βββ tailwind.config.js
βββ vite.config.ts
SourceHub is built with simplicity and autonomy in mind:
- No Heavy Frameworks: The backend is pure Node.js. When adding API endpoints or git operations, keep them fast, deterministic, and dependency-light.
- Keep Everything Local: Do not introduce required dependencies on cloud services or external APIs.
- Code Style: Follow TypeScript standards and ensure code passes type-checking:
npm run typecheck # client (tsconfig.json) + server/tests (tsconfig.server.json) npm test npm run build # runs typecheck, then vite build
Released under the MIT License. Copyright (c) 2026 SourceHub contributors.
Designed and maintained for single-operator autonomy.


