Getting Started with the Nylas CLI
Quickly install, set up credentials, and begin API requests with the steps in the guide below.
To start using the Nylas CLI, you'll need the requirements below.
Run the command below to install the Nylas CLI using
brew install nylas/nylas-cli/nylas
Also, for upgrading to the most recent version of the Nylas CLI, use the following
brew upgrade nylas
For users wanting to install the binary file, the links below contain downloads for each respective operating system. The checksum is available for file verification.
- Checksum verification
After installing the Nylas CLI, begin initializing and authenticating your Dashboard credentials. Once you’ve completed the process, these settings continue to work in the CLI for your application without having to input account information again.
Setup your Nylas CLI with the Client ID and Client Secret from your Nylas Dashboard. Follow the steps from the terminal actions below.
With your account’s email address, start the authentication within your terminal. You can choose to authenticate through your browser or through the terminal prompts.
The code below shows the formatting of the command and response when authenticating.
nylas auth [email_address]
INFO Using Nylas's Hosted Authentication, we will obtain a valid access token that can be used to interact with Nylas's public APIs.
INFO For more info, visit: https://developer.nylas.com/docs/developer-guide/authentication/hosted-authentication/
y to begin authenticating in your browser through Hosted Authentication.
? Open your browser to authenticate your account (Y/n): y
INFO Opening your browser for hosted authentication login...
? Check your browser, or, manually enter your access token:
SUCCESS Verified and saved your access token <ACCESS_TOKEN>.
In the response, the Nylas CLI also verifies your access token in the terminal when authenticating in the browser.
n requires you to manually authenticate in the terminal with your credentials.
With your account credentials configured, you can begin to make API requests from your terminal.
Retrieve your account information with a
GET request in the Nylas CLI.
nylas api accounts get
You’ll see similar results to the example below with a successful request.
"email": "[email protected]"
"email": "[email protected]"
You’re well on your way to using the Nylas CLI in your workflow! Once you’ve completed the process, these settings continue to work in the CLI for your application without having to input account credentials again.
Prefer video? You can watch our LiveStream Coding with Nylas.
When you’re ready to build your own application, you can use the credentials from your provider as the
<CLIENT_SECRET> for any requests as well. Learn more in the Create an App guide. The links below help you make the most of your Nylas CLI experience.