|  | 
|  | 1 | +--- | 
|  | 2 | +title: Enterprise Configuration | 
|  | 3 | +--- | 
|  | 4 | + | 
|  | 5 | +`git-ai`'s behavior can be configured on developer machines by writing a JSON file in the user's home directory.  | 
|  | 6 | + | 
|  | 7 | +On Linux and macOS, this file is located at `$HOME/.git-ai/config.json`. | 
|  | 8 | +On Windows, this file is located at `%USERPROFILE%\.git-ai\config.json`. | 
|  | 9 | + | 
|  | 10 | +## Options  | 
|  | 11 | + | 
|  | 12 | +All the options in `config.json` are optional, and will fall back to default values if not provided.  | 
|  | 13 | + | 
|  | 14 | +| --- | --- | --- | | 
|  | 15 | +| `git_path` `Path` | The path to the (unaltered) `git` binary you distribute on developer machines | Defaults to whichever git is on the shell path | | 
|  | 16 | +| `ignore_prompts` `boolean` flag | Prompts be excluded from authorship logs | `false` | | 
|  | 17 | +| `allow_repositories` `Path[]` | Allow `git-ai` in only these remotes | If not specified or set to an empty list, all repositories are allowed.  | | 
|  | 18 | + | 
|  | 19 | +```json | 
|  | 20 | +{ | 
|  | 21 | +    "git_path": "/usr/bin/git", | 
|  | 22 | +    "ignore_prompts": false, | 
|  | 23 | +    "allow_repositories": [ | 
|  | 24 | +        "https://github.com/acunniffe/git-ai.git" | 
|  | 25 | +    ] | 
|  | 26 | +} | 
|  | 27 | +``` | 
|  | 28 | + | 
|  | 29 | +## Installing `git-ai` binary on developer machines | 
|  | 30 | + | 
|  | 31 | +When `git-ai` is installed using the [`install.sh` script](https://github.com/acunniffe/git-ai?tab=readme-ov-file#install) (reccomended for personal use) the downloaded binary will be configured to handle calls to both `git` and `git-ai`, effectively creating a wrapper/proxy to `git`.  | 
|  | 32 | + | 
|  | 33 | +If you would like to create a custom installation here is what `git-ai` requires to works correctly cross platform:  | 
|  | 34 | + | 
|  | 35 | +### Directory Structure | 
|  | 36 | + | 
|  | 37 | +**Unix/Linux/macOS:** | 
|  | 38 | +- Install the `git-ai` binary to: `$HOME/.git-ai/bin/git-ai` | 
|  | 39 | +- Create a symlink: `$HOME/.git-ai/bin/git` → `$HOME/.git-ai/bin/git-ai` | 
|  | 40 | +- Create a symlink: `$HOME/.git-ai/bin/git-og` → `/path/to/original/git` | 
|  | 41 | +- Make the binary executable: `chmod +x $HOME/.git-ai/bin/git-ai` | 
|  | 42 | +- On macOS only: Remove quarantine attribute: `xattr -d com.apple.quarantine $HOME/.git-ai/bin/git-ai` | 
|  | 43 | + | 
|  | 44 | +**Windows:** | 
|  | 45 | +- Install the binary to: `%USERPROFILE%\.git-ai\bin\git-ai.exe` | 
|  | 46 | +- Create a copy: `%USERPROFILE%\.git-ai\bin\git.exe` (copy of `git-ai.exe`) | 
|  | 47 | +- Create a batch file: `%USERPROFILE%\.git-ai\bin\git-og.cmd` that calls the original git executable | 
|  | 48 | +- Unblock the downloaded files (PowerShell: `Unblock-File`) | 
|  | 49 | + | 
|  | 50 | +### PATH Configuration | 
|  | 51 | + | 
|  | 52 | +**Unix/Linux/macOS:** | 
|  | 53 | +- Add `$HOME/.git-ai/bin` to the beginning of the user's PATH | 
|  | 54 | +- Update the appropriate shell config file (`.zshrc`, `.bashrc`, etc.) | 
|  | 55 | + | 
|  | 56 | +**Windows:** | 
|  | 57 | +- Add `%USERPROFILE%\.git-ai\bin` to the System PATH | 
|  | 58 | +- The directory should be positioned **before** any existing Git installation directories to ensure the git-ai shim takes precedence | 
|  | 59 | + | 
|  | 60 | +### Configuration File | 
|  | 61 | + | 
|  | 62 | +Create `$HOME/.git-ai/config.json` (or `%USERPROFILE%\.git-ai\config.json` on Windows) with the options outlined at the top of this page.  | 
|  | 63 | + | 
|  | 64 | +### IDE/Agent Hook Installation | 
|  | 65 | + | 
|  | 66 | +After installing the binary and configuring PATH, run: | 
|  | 67 | + | 
|  | 68 | +```bash | 
|  | 69 | +git-ai install-hooks | 
|  | 70 | +``` | 
|  | 71 | + | 
|  | 72 | +This sets up integration with supported IDEs and AI coding agents (Cursor, VS Code with GitHub Copilot, etc.). | 
|  | 73 | + | 
|  | 74 | +### Reference Implementation | 
|  | 75 | + | 
|  | 76 | +Our official install scripts implement all of these requirements and can serve as references: | 
|  | 77 | +- Unix/Linux/macOS: [`install.sh`](https://github.com/acunniffe/git-ai/blob/main/install.sh) | 
|  | 78 | +- Windows: [`install.ps1`](https://github.com/acunniffe/git-ai/blob/main/install.ps1) | 
|  | 79 | + | 
|  | 80 | +These scripts handle edge cases like detecting the original git path, preventing recursive installations, and gracefully handling errors.  | 
|  | 81 | + | 
|  | 82 | + | 
0 commit comments