Repository: ast-grep/ast-grep (language: rust)

Issue:
[feature] make ast-grep cargo binstall friendly
# ⭐ Suggestion

Assets are currently not [cargo binstall](https://github.com/cargo-bins/cargo-binstall) friendly.

<img src="https://github.com/user-attachments/assets/48395be4-6401-43e8-a7d9-644c490f20bb" width="350" />


# 💻 Use Cases

You already support npm, pip, cargo, homebrew, scoop and  macports, `cargo binstall` downloads assets and if not found it runs `cargo install`

# Fix

Either upload assets to github with one of this formats
<img src="https://github.com/user-attachments/assets/0eda4e73-e725-46d8-8c6e-e2210b781a34" width="250" />

Or adding `package.metadata.binstall` to cargo.toml
<img src="https://github.com/user-attachments/assets/dd637c17-10b0-4b37-b12a-be7e7dc6546e" width="650" />

What would you prefer? The cargo.toml option should be fairly non-intrusive

Glad to provide a pr with the necessary changes if you like this.


Discussion / hints:
>  The cargo.toml option should be fairly non-intrusive

This option sounds great to me. Thank you if you can make a pull request

Fix patch:
diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml
index cedbb1481b..97f59fd6d2 100644
--- a/crates/cli/Cargo.toml
+++ b/crates/cli/Cargo.toml
@@ -52,4 +52,10 @@ clap_complete = "4.5.2"
 [dev-dependencies]
 assert_cmd = "2.0.14"
 predicates = "3.1.0"
-tempfile = "3.10.1"
\ No newline at end of file
+tempfile = "3.10.1"
+
+# Support cargo bininstall, https://github.com/ast-grep/ast-grep/issues/1742
+[package.metadata.binstall]
+pkg-url = "{ repo }/releases/download/v{ version }/app-{ target }{ archive-suffix }"
+bin-dir = "app-{ target }/{ bin }{ binary-ext }"
+disabled-strategies = ["quick-install"]


Test patch: