Skip to content

Commit e05b233

Browse files
Drop the editor plugins and keep the docs in one README
The Vim, Neovim, and Emacs plugins only opened the graph in a browser tab, the same as running git-sim from the editor's shell prompt, and the Neovim one was never run. They're removed, along with every mention of them. The nested READMEs, docs/shell.md, and docs/integrations.md are folded into the main README: Get started has a step each for Jupyter and pull requests, and Installation has Terminal (git sim, aliases, completion, lazygit and tig), Jupyter, and GitHub (gh sim and the Action) sections. The test READMEs move into docs/testing.md. vscode/README.md stays, since it is the extension's Marketplace page. Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
1 parent 3a73eac commit e05b233

19 files changed

Lines changed: 207 additions & 1062 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ git_sim.egg-info/
1616
vscode/*.vsix
1717
vscode/LICENSE.txt
1818

19-
# the sanity run's clones, results and logs (tests/sanity/README.md)
19+
# the sanity run's clones, results and logs (docs/testing.md)
2020
tests/sanity/.work/

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ $ git-sim merge dev
5353
- `src/git_sim/`: one module per Git command (`merge.py`, `rebase.py`, and so on), sharing `git_sim_base_command.py`
5454
- `src/git_sim/render/`: the static renderer, which draws the SVG, PNG, and JPG output and the interactive page
5555
- `src/git_sim/live.py`, `preflight.py`, `mcp_server.py`, `claude_hook.py`: live mode, pre-flight, the MCP server, and the agent hook
56-
- `vscode/` and `integrations/`: the VS Code extension and the editor integrations
56+
- `vscode/`: the VS Code extension
57+
- `integrations/`: the GitHub CLI extension (`gh sim`) and the GitHub Action
5758
- `docs/`: guides for live mode, pre-flight and agents, embedding, integrations, and testing
5859
- `scripts/`: the scripts that draw the README's graphs
5960

‎README.md‎

Lines changed: 127 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
**The visual layer for Git in your own repos:** simulate, record, replay, audit, and share individual Git commands or entire Git workflows, wherever you or your agents run them.
77

8-
- **Simulate any Git command before it runs**, as an interactive graph you can step through. In the terminal, on the web, and in VS Code, Jupyter, Vim / Neovim / Emacs, and GitHub pull requests.
8+
- **Simulate any Git command before it runs**, as an interactive graph you can step through. In the terminal, on the web, and in VS Code, Jupyter, and GitHub pull requests.
99
- **Track your repo live** while recording every Git operation, human or agentic, as a visual command sequence you can replay. On the web and in VS Code.
1010
- **Catch and review risky Git commands from AI agents** in real time, before they harm your work. Claude Code, GitHub Copilot, Cursor, Codex, Gemini CLI, and any MCP agent.
1111
- **Share any git-sim output** as a link, an embed, an HTML page, a PNG or SVG image, an MP4 video, or a social post.
@@ -53,7 +53,7 @@ $ git-sim rebase main
5353

5454
By default, git-sim creates a web-first, shareable visualization that opens in your browser. It generates an interactive simulation of exactly how any Git command will impact your repo, without actually running the real Git command so nothing changes in your repo.
5555

56-
Run `git-sim -h` to list every command.
56+
Run `git-sim -h` to list every command. Once git-sim is installed, `git sim <command>` works too, and `git-sim aliases` adds `git preflight` and `git live` (see [Terminal](https://github.com/initialcommit-com/git-sim#terminal)).
5757

5858
**3. Watch your repo live:** a graph that follows your repo as it changes, and records every command you (or your agents) run
5959

@@ -69,13 +69,15 @@ $ code --install-extension initialcommit.git-sim
6969

7070
Or search for **git-sim** in the Extensions view (the Marketplace in VS Code, Open VSX in Cursor, Windsurf, and VSCodium).
7171

72-
**5. Vim, Neovim, and Emacs integration**
72+
**5. Jupyter integration:** with git-sim installed in the notebook's environment, the graph shows up right under the cell
7373

74-
For Vim, Neovim, and Emacs, see [integrations/](https://github.com/initialcommit-com/git-sim/tree/main/integrations/).
75-
76-
**6. Jupyter integration**
74+
```
75+
%load_ext git_sim.jupyter
76+
%gitsim rebase main
77+
%gitsim live
78+
```
7779

78-
For Jupyter, `gh`, and GitHub Actions, see [docs/integrations.md](https://github.com/initialcommit-com/git-sim/blob/main/docs/integrations.md).
80+
**6. Pull request integration:** `gh sim pr 42` simulates merging a pull request, and the git-sim GitHub Action comments the pre-flight report on each one. See [Installation](https://github.com/initialcommit-com/git-sim#github).
7981

8082
**7. Check a risky command before it runs:** how risky it is, and what you could lose
8183

@@ -768,6 +770,124 @@ This will enable you to run git-sim subcommands as [described above](https://git
768770

769771
</details>
770772

773+
### Terminal
774+
775+
Git runs any program named `git-<name>` as `git <name>`, so `git sim rebase main` works as soon as git-sim is installed. To add `git preflight` and `git live` to your global Git config:
776+
777+
```console
778+
$ git-sim aliases
779+
```
780+
781+
`--local` adds them to the current repo only, and `--remove` takes them out. Aliases you already have with those names are left alone.
782+
783+
For tab completion in bash, zsh, fish, or PowerShell, run `git-sim --install-completion` and restart your terminal.
784+
785+
<details>
786+
<summary>lazygit and tig key bindings</summary>
787+
788+
In lazygit's `config.yml` (`lazygit --print-config-dir` shows where it is):
789+
790+
```yaml
791+
customCommands:
792+
- key: "S"
793+
context: "localBranches"
794+
description: "git-sim: simulate rebasing onto this branch"
795+
command: "git-sim rebase {{ .SelectedLocalBranch.Name }}"
796+
- key: "S"
797+
context: "commits"
798+
description: "git-sim: simulate resetting to this commit"
799+
command: "git-sim reset {{ .SelectedLocalCommit.Sha }}"
800+
- key: "P"
801+
context: "commits"
802+
description: "git-sim: pre-flight a hard reset to this commit"
803+
command: "git-sim preflight reset --hard {{ .SelectedLocalCommit.Sha }}"
804+
output: terminal
805+
- key: "L"
806+
context: "global"
807+
description: "git-sim: watch this repo live"
808+
command: "git-sim live"
809+
output: terminal
810+
```
811+
812+
In `~/.tigrc`, for the selected commit in tig's main view:
813+
814+
```
815+
bind main S !git-sim reset %(commit)
816+
bind main C !git-sim cherry-pick %(commit)
817+
bind main P !git-sim preflight reset --hard %(commit)
818+
bind generic L !git-sim live
819+
```
820+
821+
</details>
822+
823+
### Jupyter
824+
825+
Install git-sim in the same environment as the notebook's kernel (`pip install git-sim`), then in a notebook:
826+
827+
```
828+
%load_ext git_sim.jupyter
829+
%gitsim rebase main
830+
%gitsim --height 700 -C ../other-repo merge feature
831+
%gitsim preflight reset --hard HEAD~1
832+
%gitsim live
833+
%gitsim live stop
834+
```
835+
836+
Commands run in the notebook's working directory, or the `-C` path. The graph's frame grows to fit it unless you set `--height`. `%gitsim live` runs live mode in the background until you stop it or restart the kernel, and needs Jupyter running on your own machine (not Colab, JupyterHub, or Binder).
837+
838+
### GitHub
839+
840+
<details>
841+
<summary>GitHub CLI: gh sim</summary>
842+
843+
With the [GitHub CLI](https://github.com/cli/cli#installation) installed and logged in (`gh auth login`), install the extension from a clone of this repo:
844+
845+
```console
846+
$ git clone https://github.com/initialcommit-com/git-sim.git ~/git-sim
847+
$ cd ~/git-sim/integrations/gh-sim
848+
$ gh extension install .
849+
```
850+
851+
Then, inside a clone of the pull request's repo:
852+
853+
```console
854+
$ gh sim pr 42 # what merging pull request #42 into its base would do
855+
$ gh sim pr 42 rebase # what rebasing it onto its base would do
856+
```
857+
858+
`gh sim pr` simulates in a temporary worktree, so your checkout and branches are never touched. Any other `gh sim` command is the same as running git-sim. On Windows, `gh` runs the extension with the bash from Git for Windows.
859+
860+
</details>
861+
862+
<details>
863+
<summary>GitHub Actions: a pre-flight comment on each pull request</summary>
864+
865+
Add this to your repo as `.github/workflows/git-sim.yml`:
866+
867+
```yaml
868+
name: git-sim
869+
on:
870+
pull_request:
871+
types: [opened, synchronize, reopened]
872+
permissions:
873+
contents: read
874+
pull-requests: write
875+
jobs:
876+
check:
877+
runs-on: ubuntu-latest
878+
steps:
879+
- uses: actions/checkout@v4
880+
with:
881+
fetch-depth: 0
882+
- uses: initialcommit-com/git-sim/integrations/github-action@v0.4.0
883+
```
884+
885+
Each pull request gets one comment with the risk level, the commits that come in, what you could lose and how to undo it, and a text commit graph. The interactive graph is attached to the run as the artifact `git-sim-pr-<number>`.
886+
887+
Inputs, set under `with:`: `mode` (`merge` or `rebase`, default `merge`), `comment` and `artifact` (`"true"` or `"false"`), `python-version` (default `3.12`), and `token`. Pull requests from forks get a read-only token, so set `comment: "false"` if you take them.
888+
889+
</details>
890+
771891
## Support git-sim
772892

773893
Git-Sim is Free and Open-Source Software (FOSS). Your support will help me work on it (and other Git projects) full time!

‎docs/integrations.md‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎docs/mcp.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Running it again updates git-sim's entries in place. `git-sim unwire-agents` rem
6161

6262
git-sim writes the hook and MCP server as full paths, so they work even when an agent's `PATH` doesn't include git-sim.
6363

64-
Where you type `git` yourself, `git sim <command>` already works, and `git-sim aliases` adds `git preflight` and `git live`. See [shell.md](shell.md).
64+
Where you type `git` yourself, `git sim <command>` already works, and `git-sim aliases` adds `git preflight` and `git live`. See [Terminal](../README.md#terminal).
6565

6666
## The pre-flight hook
6767

‎docs/shell.md‎

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)