@fuad24/gitbridge 0.1.0 β†’ 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +160 -164
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,223 +1,219 @@
1
- <div align="center">
1
+ # GitBridge
2
2
 
3
- <br />
3
+ [![npm version](https://img.shields.io/npm/v/@fuad24/gitbridge.svg)](https://www.npmjs.com/package/@fuad24/gitbridge)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.8-blue.svg)](https://www.typescriptlang.org/)
6
+ [![Tests](https://img.shields.io/badge/tests-44%20passed-brightgreen.svg)](https://github.com/FuadTesfaye/gitbridge/actions)
4
7
 
5
- # πŸŒ‰ `GitBridge`
6
- ### *Universal Git Identity, Multi-Account & Provider Management Layer*
8
+ GitBridge is a lightweight CLI and credential management layer that automates Git identities, provider accounts, and SSH keys across projects and directories.
7
9
 
8
- <p align="center">
9
- <b>Seamlessly manage identities, provider accounts, and SSH keys across Git workflows without wrapping or replacing native Git.</b>
10
- </p>
10
+ It operates entirely locally through native Git and SSH configuration hooks (`includeIf`, `credential.helper`, and `~/.ssh/config`), requiring no wrappers or changes to standard `git` commands.
11
11
 
12
- <p align="center">
13
- <a href="https://github.com/FuadTesfaye/gitbridge/actions"><img src="https://img.shields.io/badge/Tests-44%2F44%20Passed-2ea44f?style=for-the-badge&logo=githubactions&logoColor=white" alt="Tests" /></a>
14
- <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.8-3178c6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" /></a>
15
- <a href="https://bun.sh/"><img src="https://img.shields.io/badge/Bun-1.3-fbf0df?style=for-the-badge&logo=bun&logoColor=black" alt="Bun" /></a>
16
- <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-f1c40f?style=for-the-badge" alt="License: MIT" /></a>
17
- <a href="./extension"><img src="https://img.shields.io/badge/IDE-VS%20Code%20%7C%20Cursor%20%7C%20Antigravity-8a2be2?style=for-the-badge&logo=visualstudiocode&logoColor=white" alt="IDE Extension" /></a>
18
- </p>
12
+ ---
19
13
 
20
- <p align="center">
21
- <a href="#-quick-start"><b>⚑ Quick Start</b></a> β€’
22
- <a href="#-why-gitbridge"><b>πŸ’‘ Why GitBridge?</b></a> β€’
23
- <a href="#-fast-command-matrix-gitbridge--gb"><b>⌨️ Fast Commands</b></a> β€’
24
- <a href="#-ide-extension-vs-code-cursor--antigravity"><b>πŸ–₯️ IDE Extension</b></a> β€’
25
- <a href="#-security-model--local-only-architecture"><b>πŸ”’ Security</b></a>
26
- </p>
14
+ ## Features
27
15
 
28
- <br />
16
+ - **Directory-Based Identity Routing**: Automatically switch author names, emails, and GPG/SSH signing keys based on repository paths using Git's native `includeIf` mechanism.
17
+ - **SSH Host & Key Isolation**: Route distinct SSH keys to separate accounts on the same provider (e.g. personal vs. work GitHub) using isolated `Host` aliases with `IdentitiesOnly yes`.
18
+ - **Native OS Credential Storage**: Store personal access tokens in OS-native secure keychains (Linux Secret Service, macOS Keychain, Windows Credential Manager) with an AES-256-GCM encrypted vault fallback.
19
+ - **Zero Runtime Overhead**: Integrates directly into Git and SSH configuration files. Your terminal, IDEs, and Git GUIs continue to invoke native `git` directly.
20
+ - **Pre-Commit Identity Guard**: Optional pre-commit hook that verifies author email matches the expected directory identity before commits are written.
21
+ - **Dual CLI Binaries**: Provides both `gitbridge` and `gb` commands with concise shorthand aliases.
22
+ - **Editor Extension**: Companion extension for VS Code, Cursor, and Antigravity IDE for visual status bar context and identity switching.
29
23
 
30
- ```
31
- Developer / IDE (VS Code, Cursor, Antigravity)
32
- β”‚
33
- (Standard git commands)
34
- β–Ό
35
- Native Git
36
- β”‚
37
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
38
- β”‚ β”‚ β”‚
39
- [includeIf / .gitconfig] [credential.helper] [~/.ssh/config]
40
- β”‚ β”‚ β”‚
41
- β–Ό β–Ό β–Ό
42
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
43
- β”‚Identity Engineβ”‚ β”‚Secure Keyring β”‚ β”‚SSH Host Routerβ”‚
44
- β”‚personal vsworkβ”‚ β”‚macOS/Linux/Winβ”‚ β”‚github.com-workβ”‚
45
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
46
- ```
24
+ ---
47
25
 
48
- </div>
26
+ ## Installation
49
27
 
50
- ---
28
+ ### Using npm
29
+ ```bash
30
+ npm install -g @fuad24/gitbridge
31
+ ```
51
32
 
52
- ## πŸ’‘ Why GitBridge?
33
+ ### Using Bun
34
+ ```bash
35
+ bun add -g @fuad24/gitbridge
36
+ ```
53
37
 
54
- | The Problem Without GitBridge ❌ | The Solution With GitBridge ⚑ |
55
- |---|---|
56
- | **Accidental Leaks**: Committing with your personal email in company repos or your corporate email in open-source projects. | **Automatic Context Routing**: Enter `~/Personal` and Git automatically signs as personal; enter `~/Projects/work` and it seamlessly switches identities via `includeIf`. |
57
- | **SSH Collision Hell**: Pushing to multiple GitHub accounts fails or attempts the wrong SSH key. | **Isolated SSH Routing**: Generates discrete `Host github.com-<account>` aliases with `IdentitiesOnly yes` automatically. |
58
- | **Plaintext Tokens**: Personal access tokens written in plaintext files or cleartext git configs. | **Hardware Keyring Integration**: Tokens are stored 100% locally in **Linux Secret Service**, **macOS Keychain**, or **Windows Credential Manager**. |
59
- | **Bloated CLI Wrappers**: Tools that alias or intercept `git` add runtime latency and break editor tools. | **Native-First Architecture**: 0ms overhead. VS Code, Cursor, JetBrains, and terminal execute pure native Git. |
38
+ Verify installation:
39
+ ```bash
40
+ gb --version
41
+ ```
60
42
 
61
43
  ---
62
44
 
63
- ## ⚑ Quick Start
45
+ ## Quick Start
64
46
 
65
- ### 1. Global Installation
47
+ ### 1. Run Setup Wizard
66
48
  ```bash
67
- # Via Bun (Fastest)
68
- bun add -g @fuad24/gitbridge
69
-
70
- # Or via npm
71
- npm install -g @fuad24/gitbridge
49
+ gb setup
72
50
  ```
51
+ The interactive wizard guides you through:
52
+ - Creating personal and work identities (name, email, signing keys).
53
+ - Mapping directories to identities (e.g. `~/work/**` -> Work identity).
54
+ - Authenticating provider accounts (GitHub, GitLab, Bitbucket).
55
+ - Activating Git (`~/.gitconfig`) and SSH (`~/.ssh/config`) configuration blocks.
73
56
 
74
- ### 2. Run the 60-Second Setup Wizard
57
+ ### 2. Verify Status & Context
75
58
  ```bash
76
- gb setup
59
+ # Check global status
60
+ gb st
61
+
62
+ # Check identity resolution for the current directory
63
+ gb ctx
77
64
  ```
78
- The interactive setup will guide you through:
79
- 1. Configuring your **Personal** and **Work** identities.
80
- 2. Connecting your provider accounts (**GitHub Device Flow**, **GitLab**, or **Bitbucket**).
81
- 3. Defining workspace directory routing rules (e.g. `~/Projects/work/**` $\to$ `work`).
82
- 4. Activating Git and SSH integration points.
83
65
 
84
- ### 3. Verify Health & Connectivity
66
+ ### 3. Run System Diagnostics
85
67
  ```bash
86
68
  gb doc
87
69
  ```
88
- Runs comprehensive diagnostics for your Git toolchain, OS keyring, SSH keys, and provider API reachability.
70
+ Verifies Git installation, keyring availability, discovered SSH keys, and provider API reachability.
89
71
 
90
72
  ---
91
73
 
92
- ## ⌨️ Fast Command Matrix (`gitbridge` / `gb`)
93
-
94
- GitBridge provides dual binaries (`gitbridge` and `gb`) with identical high-speed execution and short aliases:
95
-
96
- | Category | Fast Command | Full Command | Action |
97
- |---|---|---|---|
98
- | πŸ“Š **Overview** | `gb st` | `gitbridge status` | Display dashboard of identities, accounts, rules & status |
99
- | πŸ” **Context** | `gb ctx` | `gitbridge context` | Inspect active identity and email mismatch warnings for current folder |
100
- | πŸ”„ **Switch** | `gb sw [id]` | `gitbridge switch [id]` | Switch Git identity for the current repo (or `-g` for global default) |
101
- | πŸ› οΈ **Init** | `gb init` | `gitbridge init` | Initialize repository profile & pre-commit safety guard |
102
- | πŸ‘€ **Identities** | `gb id ls` | `gitbridge identity list` | List all configured commit identities |
103
- | | `gb id add` | `gitbridge identity add` | Create a new Git identity (interactive or with `--name`, `--email`) |
104
- | | `gb id use <id>` | `gitbridge identity use <id>` | Set an identity as global default |
105
- | | `gb id rm <id>` | `gitbridge identity remove <id>` | Remove an identity |
106
- | πŸ™ **Accounts** | `gb acc ls` | `gitbridge account list` | List authenticated Git provider accounts |
107
- | | `gb acc rm <id>` | `gitbridge account remove <id>` | Remove account and wipe tokens from OS keyring |
108
- | πŸ”‘ **Auth** | `gb auth login` | `gitbridge auth login [prov]` | Authenticate with GitHub (Web Browser/PAT), GitLab, or Bitbucket |
109
- | | `gb auth logout`| `gitbridge auth logout <prov>`| Revoke tokens and log out |
110
- | πŸ“ **Rules** | `gb rules ls` | `gitbridge rule list` | List directory routing rules |
111
- | | `gb rule add` | `gitbridge rule add [dir] [id]` | Map a workspace folder path to a Git identity |
112
- | | `gb rule rm` | `gitbridge rule remove <id>` | Delete a directory routing rule |
113
- | πŸ”— **Remotes** | `gb rem ls` | `gitbridge remote list` | List remotes configured for current repository |
114
- | | `gb rem add` | `gitbridge remote add <n> <u>` | Add remote with automatic SSH account host routing |
115
- | πŸš€ **Multi-Push** | `gb push --all` | `gitbridge push --all` | Push active branch to all configured remotes simultaneously |
116
- | βš™οΈ **Integrations**| `gb enable` | `gitbridge enable` | Safely inject GitBridge managed blocks into Git & SSH configs |
117
- | | `gb disable` | `gitbridge disable` | Safely remove GitBridge blocks and restore original configs |
118
- | 🩺 **Doctor** | `gb doc` | `gitbridge doctor` | Run full diagnostics (Git CLI, Keyring, SSH Keys, Provider APIs) |
74
+ ## Command Reference
75
+
76
+ Both `gitbridge` and `gb` are available:
77
+
78
+ ### General & Status
79
+ | Shorthand | Full Command | Description |
80
+ |---|---|---|
81
+ | `gb st` | `gitbridge status` | Display configured identities, accounts, and directory rules |
82
+ | `gb ctx` | `gitbridge context` | Show resolved identity and warnings for the current directory |
83
+ | `gb sw [id]` | `gitbridge switch [id]` | Switch repository identity (`-g` for global default) |
84
+ | `gb init` | `gitbridge init` | Initialize repo profile and install pre-commit guard |
85
+ | `gb doc` | `gitbridge doctor` | Run system and connectivity diagnostics |
86
+ | `gb enable` | `gitbridge enable` | Inject GitBridge configuration blocks into Git and SSH configs |
87
+ | `gb disable` | `gitbridge disable` | Safely remove GitBridge configuration blocks |
88
+
89
+ ### Identity Management (`gb id`)
90
+ | Shorthand | Full Command | Description |
91
+ |---|---|---|
92
+ | `gb id ls` | `gitbridge identity list` | List all configured identities |
93
+ | `gb id add` | `gitbridge identity add` | Create a new identity (`--name`, `--email`, `--signing-key`) |
94
+ | `gb id use <id>` | `gitbridge identity use <id>` | Set default global identity |
95
+ | `gb id rm <id>` | `gitbridge identity remove <id>` | Remove an identity |
96
+
97
+ ### Account & Authentication (`gb acc`, `gb auth`)
98
+ | Shorthand | Full Command | Description |
99
+ |---|---|---|
100
+ | `gb acc ls` | `gitbridge account list` | List authenticated provider accounts |
101
+ | `gb acc rm <id>` | `gitbridge account remove <id>` | Remove account and delete credentials from OS keyring |
102
+ | `gb auth login [provider]` | `gitbridge auth login` | Authenticate with GitHub, GitLab, or Bitbucket |
103
+ | `gb auth logout <provider>` | `gitbridge auth logout` | Log out and revoke stored tokens |
104
+
105
+ ### Directory Rules (`gb rules`)
106
+ | Shorthand | Full Command | Description |
107
+ |---|---|---|
108
+ | `gb rules ls` | `gitbridge rule list` | List directory mapping rules |
109
+ | `gb rules add <path> <id>` | `gitbridge rule add` | Map a directory path to an identity |
110
+ | `gb rules rm <id>` | `gitbridge rule remove <id>` | Delete a directory rule |
111
+
112
+ ### Remotes & Multi-Push (`gb rem`, `gb push`)
113
+ | Shorthand | Full Command | Description |
114
+ |---|---|---|
115
+ | `gb rem ls` | `gitbridge remote list` | List remotes for current repository |
116
+ | `gb rem add <name> <url>` | `gitbridge remote add` | Add remote with automatic SSH host alias routing |
117
+ | `gb push --all` | `gitbridge push --all` | Push active branch to all configured remotes concurrently |
119
118
 
120
119
  ---
121
120
 
122
- ## πŸ–₯️ IDE Extension (VS Code, Cursor & Antigravity)
123
-
124
- GitBridge includes a built-in extension in [`extension/`](./extension) compatible with **VS Code**, **Cursor**, **Windsurf**, and **Google Antigravity IDE**:
121
+ ## How It Works
125
122
 
126
- <div align="center">
123
+ ### 1. Git Identity Routing via `includeIf`
124
+ GitBridge generates a modular Git configuration file at `~/.gitbridge/gitconfig` and injects an `include` directive into your `~/.gitconfig`:
127
125
 
126
+ ```gitconfig
127
+ # ~/.gitconfig
128
+ # --- BEGIN GITBRIDGE MANAGED BLOCK ---
129
+ [include]
130
+ path = ~/.gitbridge/gitconfig
131
+ # --- END GITBRIDGE MANAGED BLOCK ---
128
132
  ```
129
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
130
- β”‚ Activity Bar β”‚ GitBridge Explorer (Sidebar) β”‚
131
- β”‚ ───────────── β”‚ ────────────────────────────────────────────────────────── β”‚
132
- β”‚ πŸŒ‰ GitBridge β”‚ β–Ό ACTIVE CONTEXT β”‚
133
- β”‚ β”‚ πŸ“ Repository: my-awesome-app β”‚
134
- β”‚ β”‚ πŸ‘€ Identity: Fuad Tesfaye <personal@example.com> β”‚
135
- β”‚ β”‚ 🏷️ Source: Directory Rule (~/Personal) β”‚
136
- β”‚ β”‚ πŸ™ Account: @FuadTesfaye (GitHub) β”‚
137
- β”‚ β”‚ πŸ”— Remote: origin (git@github.com:...) β”‚
138
- β”‚ β”‚ β”‚
139
- β”‚ β”‚ β–Ό IDENTITIES [+] β”‚
140
- β”‚ β”‚ βœ” personal (Fuad Tesfaye <personal@example.com>) β”‚
141
- β”‚ β”‚ β—‹ work (Fuad Tesfaye <work@company.com>) β”‚
142
- β”‚ β”‚ β”‚
143
- β”‚ β”‚ β–Ό ACCOUNTS & PROVIDERS [+] β”‚
144
- β”‚ β”‚ πŸ™ GitHub: @FuadTesfaye (OAuth Keyring) β”‚
145
- β”‚ β”‚ 🦊 GitLab: @fuad_corp (PAT) β”‚
146
- β”‚ β”‚ β”‚
147
- β”‚ β”‚ β–Ό DIRECTORY RULES [+] β”‚
148
- β”‚ β”‚ πŸ“ ~/Personal βž” personal β”‚
149
- β”‚ β”‚ πŸ“ ~/Projects/work βž” work β”‚
150
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
151
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
152
- β”‚ Status Bar: [$(person) personal: Fuad Tesfaye] [$(github) @FuadTesfaye] β”‚
153
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
133
+
134
+ Directory rules compile into conditional includes:
135
+ ```gitconfig
136
+ # ~/.gitbridge/gitconfig
137
+ [includeIf "gitdir:~/work/**"]
138
+ path = ~/.gitbridge/identities/work.gitconfig
139
+
140
+ [includeIf "gitdir:~/personal/**"]
141
+ path = ~/.gitbridge/identities/personal.gitconfig
154
142
  ```
155
143
 
156
- </div>
144
+ ### 2. SSH Account Isolation
145
+ When multiple accounts use the same Git provider, GitBridge configures host aliases in `~/.ssh/config` to prevent SSH key collisions:
146
+
147
+ ```sshconfig
148
+ Host github.com-work
149
+ HostName github.com
150
+ User git
151
+ IdentityFile ~/.ssh/id_work
152
+ IdentitiesOnly yes
153
+
154
+ Host github.com-personal
155
+ HostName github.com
156
+ User git
157
+ IdentityFile ~/.ssh/id_personal
158
+ IdentitiesOnly yes
159
+ ```
157
160
 
158
- ### Extension Highlights:
159
- - πŸ‘€ **Live Status Bar Widget**: Shows active identity badge and provider account at all times.
160
- - πŸ”„ **Real-Time State Watcher**: Run `gb sw work` in your terminal and the IDE status bar and explorer update instantly without an editor reload.
161
- - ⚠️ **Mismatch Warning**: Highlights mismatched `.git/config` emails before you commit.
162
- - πŸš€ **One-Click Multi-Push**: Trigger parallel pushes directly from the sidebar.
161
+ ### 3. Secure Credential Helper
162
+ GitBridge implements the standard Git credential helper protocol:
163
+ ```bash
164
+ git config --global credential.helper "gitbridge credential"
165
+ ```
166
+ Credentials queried by Git are resolved from:
167
+ 1. **Linux**: Secret Service API (`libsecret` / `secret-tool`)
168
+ 2. **macOS**: Keychain Services (`/usr/bin/security`)
169
+ 3. **Windows**: Windows Credential Manager (DPAPI)
170
+ 4. **Headless/Fallback**: Local encrypted vault (`~/.gitbridge/vault.enc`, AES-256-GCM with PBKDF2 key derivation)
163
171
 
164
172
  ---
165
173
 
166
- ## πŸ”’ Security Model & Local-Only Architecture
174
+ ## Identity Resolution Order
167
175
 
168
- GitBridge is engineered with a **zero-trust, local-only security architecture**:
176
+ When determining the active identity for a Git repository, GitBridge applies the following precedence:
169
177
 
170
- - πŸ›‘οΈ **100% Local Execution**: GitBridge operates exclusively on your local machine. It has **no telemetry, no tracking, and no external cloud servers**. Requests are made only directly to the Git providers you configure (GitHub, GitLab, Bitbucket).
171
- - πŸ”‘ **Hardware-Backed OS Keychains**: Access tokens and passwords are **never written to plain JSON files, logs, or git config files**. They are stored directly in your operating system's native secure keyring:
172
- - **Linux**: Linux Secret Service (`secret-tool` / libsecret / DBus Session Keyring).
173
- - **macOS**: Apple Keychain Services (`/usr/bin/security` backed by Secure Enclave).
174
- - **Windows**: Windows Credential Manager (DPAPI-encrypted).
175
- - πŸ” **Air-Gapped / Headless Fallback**: In environments without a graphical keychain daemon (e.g. CI containers), credentials are encrypted in `~/.gitbridge/vault.enc` using **AES-256-GCM** with a **PBKDF2** machine-unique derivation key (100,000 rounds of SHA-256 with cryptographically random salt and 12-byte IV).
176
- - πŸ“ **Restricted POSIX Permissions**: All configuration and generated files enforce strict permission modes:
177
- - `~/.gitbridge/` directory: `0700` (`rwx------`, owner only)
178
- - Config, key & vault files: `0600` (`rw-------`, owner only)
179
- - πŸ—οΈ **SSH Key Isolation**: Dedicated `Host <host>-<account_id>` blocks enforce `IdentitiesOnly yes`, ensuring the SSH agent only presents the specific key mapped to that accountβ€”preventing cross-account identity leaks.
178
+ 1. **Local Repository Profile**: Explicit override configured in `.git/config` or `.gitbridge/repo.json`.
179
+ 2. **Directory Rule**: Most specific matching `includeIf "gitdir:..."` rule.
180
+ 3. **Global Default**: The fallback identity marked as default in GitBridge.
181
+ 4. **System Git Config**: Existing global `user.name` and `user.email` in `~/.gitconfig`.
180
182
 
181
183
  ---
182
184
 
183
- ## πŸ—οΈ Identity Resolution Precedence
184
-
185
- When Git or GitBridge resolves an identity for any directory:
185
+ ## IDE Extension
186
186
 
187
- $$\text{Local Repository Profile} \succ \text{Directory Rule (includeIf)} \succ \text{Global Default Identity} \succ \text{System Git Config}$$
187
+ GitBridge includes an extension for VS Code, Cursor, and Antigravity IDE (available in [`extension/`](./extension)):
188
188
 
189
- ```mermaid
190
- flowchart TD
191
- Start["Git Action Triggered (commit / push / clone)"] --> CheckRepo{"Explicit Repo Profile in .git/config?"}
192
- CheckRepo -- Yes --> ApplyRepo["Apply Repository Identity"]
193
- CheckRepo -- No --> CheckRule{"Matches Directory includeIf Rule?"}
194
- CheckRule -- Yes --> ApplyRule["Apply Directory Rule Identity"]
195
- CheckRule -- No --> CheckGlobal{"GitBridge Default Identity?"}
196
- CheckGlobal -- Yes --> ApplyGlobal["Apply GitBridge Global Default"]
197
- CheckGlobal -- No --> ApplySystem["Fallback to System Git Config"]
198
-
199
- ApplyRepo --> Exec["Execute Native Git Command Seamlessly"]
200
- ApplyRule --> Exec
201
- ApplyGlobal --> Exec
202
- ApplySystem --> Exec
203
- ```
189
+ - **Status Bar Indicator**: Real-time display of the resolved identity and account for the active file.
190
+ - **Sidebar Explorer**: Interactive view of active context, configured identities, authenticated accounts, and directory rules.
191
+ - **Live State Synchronization**: File watcher updates the IDE UI immediately when identities or configurations change via CLI.
204
192
 
205
193
  ---
206
194
 
207
- ## πŸ§ͺ Testing & Verification
208
-
209
- GitBridge is verified with a comprehensive automated test suite covering unit schemas, credential stores, injectors, URL parsers, and full Git lifecycle integrations:
195
+ ## Development & Testing
210
196
 
211
197
  ```bash
212
- # Run all 37 unit & integration tests
198
+ # Clone the repository
199
+ git clone https://github.com/FuadTesfaye/gitbridge.git
200
+ cd gitbridge
201
+
202
+ # Install dependencies
203
+ bun install
204
+
205
+ # Run test suite (44 unit & integration tests)
213
206
  bun test
214
207
 
215
- # Run strict TypeScript typechecks
208
+ # Typecheck
216
209
  bun run typecheck
210
+
211
+ # Build CLI and extension bundles
212
+ bun run build
217
213
  ```
218
214
 
219
215
  ---
220
216
 
221
- ## πŸ“„ License
217
+ ## License
222
218
 
223
- MIT Β© [Fuad Tesfaye](https://github.com/FuadTesfaye)
219
+ [MIT](LICENSE) Β© [Fuad Tesfaye](https://github.com/FuadTesfaye)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuad24/gitbridge",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Universal Git Identity & Multi-Account Management Layer",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",