Open thebauda opened 5 months ago
I've submitted a pull request which adds an restish/embedded package that allows restish to be imported as a library. It allows for setting a different appname (separate config from restish installed on system), sending an authorization token prefix and token in the function call (new handler added in cli/auth.go), and optionally passsing in io.Writers to redirect cli.Stdout and cli.Stderr. I didn't write any tests for it but I got a branch of my fork working in another CLI app once I fixed the imports. github.com/loicalleyne/restish@embedtest
Awesome, thank you!
Description
Rather than following command line prompts, allow restish to be used in a non-interactive mode where users can pass flags to streamline API configuration and modification.
Background
Our team uses restish to expose proprietary APIs through a CLI written in Golang. Behind the scenes, we configure APIs through restish and wrap the inputs and outputs to conform to our desired user experience. By having restish in a non-interactive format, it will streamline our API onboarding and reconfiguration process where we have to guess what output will be returned, as well as guess where the user's
restish.json
file is located so we don't have to modify it directly.