Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: Make chaining a first-class citizen in the CLI #256

Open
dkundel opened this issue May 24, 2021 · 1 comment
Open

Feature suggestion: Make chaining a first-class citizen in the CLI #256

dkundel opened this issue May 24, 2021 · 1 comment
Labels
status: help wanted requesting help from the community triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. type: community enhancement feature request not on Twilio's roadmap

Comments

@dkundel
Copy link
Member

dkundel commented May 24, 2021

Problem

Right now if you want to chain Twilio CLI commands you'll have to do two things:

  1. You'll have to define your output type into something parseable, for example -o json
  2. Parse the output, for example with jq
  3. Use the parsed output in your new 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 to jq).

For example:

twilio api:serverless:v1:services:list | twilio api:serverless:v1:environments:list --sid ".[0].sid" --properties 

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.

@Sindhura3
Copy link
Contributor

@dkundel Thank you for suggesting this; we've added it to our list. Pull requests and +1s on the feature suggestion will help it move up the backlog.

@thinkingserious thinkingserious added status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap labels May 26, 2021
@shrutiburman shrutiburman added the triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. label Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

4 participants