jurassiscripts / velociraptor

The npm-style script runner for Deno

Home Page:https://velociraptor.run

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Print scripts using a parsable format

fedeci opened this issue · comments

Hello maintainers! We are adding the velociraptor spec to Fig and we are encountering troubles parsing the output of vr. I think it should be possible to add a --json flag allowing users to get a json output. WDYT? I can work on this feat if required.
Thanks!

Ciao @fedeci! That's super cool, Fig looks awesome 🙌
While adding a --json option should be feasible, would it not make more sense to use vr's built-in autocomplete? For example:

$ vr completions complete scriptid

returns a newline-separated list of all the runnable scripts from the resolved configuration.
Or - even better - we could work with Cliffy's authors to add a json or fig generation target that automatically exports the command structure as a Fig spec!

But the scriptid autocomplete doesn't provide the description, command, etc. I'll take a shot at adding something like a vr json or just vr --json next week, maybe.

Or - even better - we could work with Cliffy's authors to add a json or fig generation target that automatically exports the command structure as a Fig spec!

That's also a great idea 😈

At this point I think it's worth trying to implement it directly into Cliffy.
@ryanccn do you want to open an issue in their repo?

That's a pretty good idea. Meanwhile I'll work on a possible PR to add JSON output to Velociraptor. How about that?