diff --git a/.gitattributes b/.gitattributes index ade629c..827429e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -# Engine binaries are gitignored (see .gitignore). If you re-enable committing them -# and have git-lfs, uncomment to track them with LFS: -# bin/**/ast-grep filter=lfs diff=lfs merge=lfs -text -# bin/**/ast-grep.exe filter=lfs diff=lfs merge=lfs -text +# Engine binaries are large (~50 MB each) and tracked with Git LFS so the repo stays +# usable while fresh clones are fully self-contained (offline, no first-run fetch). +bin/**/ast-grep filter=lfs diff=lfs merge=lfs -text +bin/**/ast-grep.exe filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index aacafc0..7164fa5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ -# Bundled engine binaries are large (~50 MB) and platform-specific. They are NOT -# committed (no git-lfs here); they are fetched on first run or at packaging time. -# See bin/README.md. The local working tree keeps them so installed skills run offline. -bin/**/ast-grep -bin/**/ast-grep.exe +# Engine binaries ARE committed, via Git LFS (see .gitattributes) — fresh clones are +# fully self-contained. The compiled Svelte grammar stays local (one-command build). grammars/ # Skill runtime output (per-project ledger / reports), never part of the skill. diff --git a/SKILL.md b/SKILL.md index 9a7504f..56d88f5 100644 --- a/SKILL.md +++ b/SKILL.md @@ -61,8 +61,9 @@ Detect platform and pick the binary; fall back gracefully. - Arch: x86_64/amd64→`x64`, arm64/aarch64→`arm64`. 2. Use `/bin/-/ast-grep` (`ast-grep.exe` on Windows). Make it executable if needed (`chmod +x` on Unix). -3. **If that file is missing** (fresh clone — binaries aren't committed), fetch the pinned - release once into that dir, then verify against `bin/checksums.txt`: +3. The binaries are bundled via **git-lfs**, so a normal clone has them. **If the file is + an LFS pointer or missing** (lfs not installed / not pulled), run `git lfs pull`, or + fetch the pinned release once into that dir and verify against `bin/checksums.txt`: the version is in `bin/VERSION`; releases are at `https://github.com/ast-grep/ast-grep/releases/download//app-.zip` (triples: `x86_64-unknown-linux-gnu`, `aarch64-unknown-linux-gnu`, diff --git a/bin/README.md b/bin/README.md index 333c1d7..e0f9f9c 100644 --- a/bin/README.md +++ b/bin/README.md @@ -26,13 +26,11 @@ For each platform, download the release archive, extract the `ast-grep` binary i the matching `bin/-/` directory, and record its SHA-256 in `checksums.txt`. Pin a single upstream version across all platforms (see `VERSION`). -> Size note: the `ast-grep` binary is ~50 MB per platform. Because of that (and no -> git-lfs here), the binaries are **gitignored, not committed** (`.gitignore`). The skill -> is still self-contained *once installed* — the local working tree keeps the binary, so a -> copied/symlinked skill runs offline. On a **fresh clone**, `SKILL.md` Step 0 fetches the -> pinned release (`VERSION`) into `bin/-/` on first use and verifies it against -> `checksums.txt`. To pre-bundle for distribution instead, commit the binaries with -> git-lfs (see `.gitattributes`) or ship per-platform packages. +> Size note: the `ast-grep` binary is ~50 MB per platform (~250 MB total). The binaries +> are **committed via Git LFS** (`.gitattributes`), so a clone is fully self-contained and +> offline. After cloning, ensure `git lfs` is installed and run `git lfs pull` if the files +> are still pointers. As a fallback (no lfs), `SKILL.md` Step 0 fetches the pinned release +> (`VERSION`) and verifies it against `checksums.txt`. ## Verification diff --git a/bin/darwin-arm64/ast-grep b/bin/darwin-arm64/ast-grep new file mode 100755 index 0000000..a724fda --- /dev/null +++ b/bin/darwin-arm64/ast-grep @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:428f35359b297f7562cfc536bdf3104fdc6bc6c50ab38df70994ec15e992df0b +size 51416272 diff --git a/bin/darwin-x64/ast-grep b/bin/darwin-x64/ast-grep new file mode 100755 index 0000000..e545b64 --- /dev/null +++ b/bin/darwin-x64/ast-grep @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bdc4ad8bd72ae05a9c816296ccace501dafb3fb4a98df0a87fe49699b016057d +size 51741348 diff --git a/bin/linux-arm64/ast-grep b/bin/linux-arm64/ast-grep new file mode 100755 index 0000000..c899213 --- /dev/null +++ b/bin/linux-arm64/ast-grep @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:036104827852aa70feae65be7e7581b164becb64526c872a312677de5d82d4c9 +size 52302832 diff --git a/bin/linux-x64/ast-grep b/bin/linux-x64/ast-grep new file mode 100755 index 0000000..106ea71 --- /dev/null +++ b/bin/linux-x64/ast-grep @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e08eea52023724e309c7104ca32c41fb9b205d976d3b3e6e681753b2394a3069 +size 52721544 diff --git a/bin/win32-x64/ast-grep.exe b/bin/win32-x64/ast-grep.exe new file mode 100644 index 0000000..287ed2b --- /dev/null +++ b/bin/win32-x64/ast-grep.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:584c59eaf3b50bf436ad43cf36193af1d2fe5e29ddb21b7485c39f131691390f +size 52356608