twilio / twilio/twilio-cli

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

Open
#256 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: low status: help wanted triage queue type: community enhancement
Dominant language
JavaScript
Stars
193
Forks
114
Avg merge
2d 2h
Merged PRs (30d)
7

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Twilio CLI command execution and output handling, focusing on how piped input could reach a subsequent command. Define the supported dot-prefixed property access and verify the example chaining a services list into an environments list, while preserving existing jq-based workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.