twilio / twilio/twilio-cli

Avoid network calls during autocomplete initialization

Open
#498 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Autocompletion script is triggering update checks

I have the autocomplete setup in my .zshrc as instructed by the CLI when running twilio autocomplete zsh:

eval $(twilio autocomplete:script zsh)

However each time I start my shell, I get this reminder that there is an update available:

 ›   Warning: twilio-cli update available from 5.3.2 to 5.3.3. For more information: https://twil.io/cli

It should probably be disabled in this case as this update check:

  • Makes a network call and slows shell initialization down when ZSH is evaluating .zshrc.
  • Is not very useful when the CLI is installed through a package manager that is taking care of keeping the CLI updated.

So either disabling the check in this particular context or having a configuration parameter to disable update checks globally (and as a bonus, set it to not execute checks when the CLI is installed through a package manager) would solve this.

Steps to Reproduce
  1. Follow autocomplete setup instructions.
  2. Open a shell when an update is ready.
  3. Wait...and see the reminder
Technical details:
  • twilio-cli version: twilio-cli/5.3.2 darwin-x64
  • node version: node-v19.0.0
  • Command output with debug logging enabled (adding -l debug to the end of the command): N/A

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 with the twilio autocomplete:script zsh entry point and reproduce the update warning while evaluating the generated command in .zshrc. Trace how autocomplete initialization invokes update checks, then verify that initialization makes no network call or displays an update reminder while normal CLI update checks remain covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.