Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Better API DX with a CLI - APIdays Jakarta

Phil Nash
February 24, 2021

Better API DX with a CLI - APIdays Jakarta

When you try to improve the experience for using your API you might consider a command line interface. CLIs allow developers to explore the API, automate API usage, and most importantly never leave the keyboard. If you have an OpenAPI spec you can even generate a CLI automatically. But replicating the API for the command line is the baseline, CLIs have so much more potential.

In this talk we'll discuss how Twilio built a CLI for our API and the opportunities it gave us to improve the developer experience of working with the API. With the Twilio CLI we enhanced API endpoints with extra features, helped to demystify webhooks, and let the community create their own plugins to supercharge their experience.

When done right, an API and a CLI are worth more than the sum of their parts.

---

Links:

Twilio CLI: https://twil.io/cli
Twilio CLI Source: https://github.com/twilio/twilio-cli
Twilio CLI features you should know about: https://www.twilio.com/blog/five-twilio-cli-features-you-should-know-about

Phil Nash

February 24, 2021
Tweet

More Decks by Phil Nash

Other Decks in Programming

Transcript

  1. Better API DX with a CLI Application Programming Interface Developer

    eXperience Command Line Interface @philnash
  2. Know your audience Not everyone will want to use a

    CLI Hypothesis: developers prefer the command line to the console Hypothesis: developers would like to automate Twilio actions @philnash
  3. Building a CLI for an API - 3 questions What's

    the minimum a CLI can do to be useful? What can you add to a CLI to make it a better experience? What can your users add to the CLI? @philnash
  4. Minimum Viable CLI Commands for your API endpoints Documentation You

    probably want to generate these commands @philnash
  5. Building a CLI for an API - 3 questions What's

    the minimum a CLI can do to be useful? What can you add to a CLI to make it a better experience? What can your users add to the CLI? @philnash