portray
portray copied to clipboard
portray should provide a way to run specific commands in the authorized environment
Right now it's difficult to write scripts that make use of portray, because it strictly opens a shell and doesn't parameterize any command to run.
I propose the following syntax:
portray auth [flags] [--] [command] [args…]
and
portray switch [flags] [--] [command] [args…]
This would cause portray
to run the given command
with the given list of args
instead of invoking $SHELL.
(I hope I'm not missing an existing way to do this...)
I think this would be great to have, though I have no time to implement it. I've also found myself wanting to use portray in scripts. We'd need to put some thought into how auth
and switch
interact with each other, since auth
is designed to be more interactive.
Definitely something I'd like to have, so I'm willing to review any PRs!
Just FYI, my use cases are for "interactive scripting" anyway -- i.e. convenience scripts that humans would run to do complex sequences of commands across multiple roles/accounts, so prompting is still okay.