phone-numbers:buy:* commands appear in autocomplete but fail

Open Beginner friendly
#707 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js
Domain
cli

Research direction

Start with src/hooks/init/buy-phone-number.js and trace how the dynamically added commands are loaded, then inspect the topic not-found handler described in the issue. Reproduce the autocomplete and purchase commands locally; done means the phone-numbers:buy:* commands execute their intended operation instead of exiting silently.

Written by the indexing model from the issue text.

Description

$ twilio version
twilio-cli/6.2.4 darwin-arm64 node-v20.20.2

$ twilio phone-numbers: <tab>
…-numbers:buy:local               (purchase a local phone number)
…-numbers:buy:machine-to-machine  (purchase a machine-to-machine phone number)
[...many more supposedly available commands...]

$ twilio phone-numbers:buy:local --country-code US --friendly-name test
[no output, no phone number bought]

It appears the phone-numbers:buy:* commands are generated at startup by an init hook (src/hooks/init/buy-phone-number.js) that pushes a dynamic plugin into config.plugins, but it never calls config.loadCommands() so they don't actually work. And then the not-found handler for the topic just prints nothing and exits.

Dominant language
JavaScript
Stars
193
Forks
114
Avg merge
2d 2h
Merged PRs (30d)
7

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.

More from twilio/twilio-cli

All issues in twilio/twilio-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.