casey / just

🤖 Just a command runner
https://just.systems
Creative Commons Zero v1.0 Universal
17.6k stars 399 forks source link

Expose parser as a crate / AST output as JSON #2007

Open ewen-lbh opened 3 weeks ago

ewen-lbh commented 3 weeks ago

Hi! First of all thanks a lot for this projects, the DX is 100x better than Makefiles'.

I looked at the Rust crate on docs.rs and saw basically nothing, so I guess there's just the CLI entrypoint that's exposed?

I built a small silly script that takes a Justfile and spits out markdown of the recipes to include in a README: https://gist.github.com/ewen-lbh/d8eb815ad36e4f9d4652c6def0c1a9cd [Usage example]

The parsing is pretty rudimentary and I wondered if exposing the parse output is some way (either by exposing some methods of the rust crate, or by adding a subcommand that dumps a JSON-encoded repr of the AST) would be easy to do, so that people can build things on top of Just