You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6af3195
Browse filesBrowse the repository at this point in the historyBrowse files
Add a VS Code extension, a preflight command, and VS Code agent hooks
vscode/: a thin client over the command line, plain JavaScript with no
build step. Simulate a Git command and see git-sim's interactive page in
an editor tab; pre-flight one and get the risk, facts, losses, undo and
text graph with a Simulate button. Reachable from the Command Palette,
the Source Control toolbar, editor and terminal context menus for a
selected command, a recent-commands pick, and Ctrl+Alt+G, whose prompt
opens with "git-sim " typed. A status bar entry shows whether git-sim is
installed. build_vsix.py packages it without Node.
git-sim preflight <command>: the pre-flight check from the terminal,
readable or --json, with git's own options passing through in order.
The extension calls it.
git-sim media-dir: prints the folder simulations are saved in. That
folder now defaults to the user's cache area outside any repository
(%LOCALAPPDATA%, ~/Library/Caches, ~/.cache) with a subfolder per repo;
--media-dir and git_sim_media_dir still override it. The hook and MCP
server write there too instead of a temp folder.
The installer never writes a bare program name: it uses the console
script's absolute path, or the interpreter with -m when the scripts are
missing (an editable install made before they existed), and recognises
either form on later runs. VS Code is a hook-capable agent now: its agent
hooks read Copilot CLI hook files, so it shares ~/.copilot/hooks/git-sim.json.
The hook understands VS Code's runTerminalCommand payload and answers in
a shape both VS Code and Copilot CLI read. Under VS Code it renders the
interactive page rather than an image, opens no viewer window, and leaves
a note in git-sim_media/inbox that the extension turns into a tab; it
also reports SAFE / CAUTION for commands below the threshold so a verdict
shows on every git command (GIT_SIM_HOOK_REPORT_SAFE).
Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,7 @@ Git-Sim is Free and Open-Source Software (FOSS). Your support will help me work
45
45
- Animation only: Add custom branded intro/outro sequences if desired
46
46
- Animation only: Speed up or slow down animation speed as desired
47
47
- NEW: [MCP server and Claude Code hook](docs/mcp.md) so AI coding agents (Claude Code, Cursor, etc.) run deterministic pre-flight checks — facts, a text commit graph and a simulation image — before executing destructive git commands in your repo. Included in the default install.
48
+
- NEW: `git-sim preflight <command>` runs that same check from the terminal, and the [VS Code extension](docs/vscode.md) puts simulations and pre-flight checks in an editor tab.
48
49
49
50
## Quickstart
50
51
Note: If you prefer to install git-sim with Docker, skip steps (1) and (2) here and jump to the [Docker installation](#docker-installation) section below, then come back here to step (3).
@@ -101,7 +102,7 @@ Or if you want to do it all in a single command:
5) Simulated output will be created as an interactive `.html` page (or a `.jpg` / `.png` image with `--img-format`). Output files are named using the subcommand executed combined with a timestamp, and by default are stored in a subdirectory called `git-sim_media/`. The location of this subdirectory is customizable using the command line flag`--media-dir=path/to/output`. Note that when the `--animate` global flag is used, render times will be much longer and a `.mp4` video output file will be produced.
105
+
5) Simulated output will be created as an interactive `.html` page (or a `.jpg` / `.png` image with `--img-format`). Output files are named using the subcommand executed combined with a timestamp, and are stored in a `git-sim_media/` folder with a subfolder per repository. By default that folder lives in your user cache area, outside any repository (`%LOCALAPPDATA%\git-sim_media` on Windows, `~/Library/Caches/git-sim_media` on macOS, `~/.cache/git-sim_media` on Linux); `git-sim media-dir` prints it. Move it with`--media-dir=path/to/output` or the `git_sim_media_dir` environment variable (`--media-dir .` puts it in the current folder, as older versions did). Note that when the `--animate` global flag is used, render times will be much longer and a `.mp4` video output file will be produced.
105
106
106
107
6) For convenience, environment variables can be set for any global command-line option available in git-sim. All environment variables start with `git_sim_` followed by the name of the option.
107
108
@@ -562,7 +563,7 @@ Use light mode (soft off-white background, dark text) instead of the default dar
562
563
$ git-sim --light-mode status
563
564
```
564
565
565
-
The default output is a self-contained interactive HTML page, saved under `git-sim_media/` and opened in the git-sim viewer at initialcommit.com. Drag the Before / After slider (or press play) to watch the command happen, hover commits for details, ctrl + wheel to zoom. The graph travels compressed in the link's `#fragment`, which browsers never send to a server, and the link git-sim opens carries nothing else about you or your repository (the command rides in the fragment too), so the server learns nothing about your code. The hosted page notes that git-sim opened it and the name of the local copy. The Share button builds a link meant for posting: that one also puts the command and a short text graph (`git log --oneline`, up to 12 lines) in the query string so the link gets a preview card. `#before`, `#after` or `#step=N` in a link pins the state, and `git_sim_viewer_url` points links at your own copy of the viewer:
566
+
The default output is a self-contained interactive HTML page, saved under `git-sim_media/`in your user cache area (see `git-sim media-dir`) and opened in the git-sim viewer at initialcommit.com. Drag the Before / After slider (or press play) to watch the command happen, hover commits for details, ctrl + wheel to zoom. The graph travels compressed in the link's `#fragment`, which browsers never send to a server, and the link git-sim opens carries nothing else about you or your repository (the command rides in the fragment too), so the server learns nothing about your code. The hosted page notes that git-sim opened it and the name of the local copy. The Share button builds a link meant for posting: that one also puts the command and a short text graph (`git log --oneline`, up to 12 lines) in the query string so the link gets a preview card. `#before`, `#after` or `#step=N` in a link pins the state, and `git_sim_viewer_url` points links at your own copy of the viewer:
0 commit comments