This would list all environments for the first serverless service it finds since it .[0].sid would access the first entry of the list returned by the first command accesses the sid property.
I don't think it would need to support any complex mechanisms (at least at first) as those could still be relegated to actual parsing tools such as jq. But this would allow both content creators as well as users to create basic scripts without requiring the installation of additional tools or navigating multiple screens through the Twilio UI.
Problem
Right now if you want to chain Twilio CLI commands you'll have to do two things:
-o json
jq
twilio
command.This either requires additional tools in the case of
jq
or more extreme knowledge of built-in scripting utilities.Proposed Solution
Make chaining of Twilio commands a first-class citizen of the Twilio CLI through piping.
If a command output gets piped into another Twilio command you'll automatically have access to the output if you prefix it by a
.
(similar tojq
).For example:
This would list all environments for the first serverless service it finds since it
.[0].sid
would access the first entry of the list returned by the first command accesses thesid
property.I don't think it would need to support any complex mechanisms (at least at first) as those could still be relegated to actual parsing tools such as
jq
. But this would allow both content creators as well as users to create basic scripts without requiring the installation of additional tools or navigating multiple screens through the Twilio UI.