Nylas CLI Commands
Once you’ve installed and configured your Nylas CLI, you can use several commands within your terminal. For example, you can make API requests and set up webhooks as well as lookup documentation.
All actions use the format below.
nylas [command] [flag]
Nylas CLI Commands
api
: Access the Nylas API endpoints.auth
: Authenticate your email account.docs
: Documentation lookup.help
: Help information for any command.init
: Setup dashboard application credentials.version
: Displays current CLI version.webhook
: Create and test Nylas webhooks.
Flags
Flags are valid throughout the Nylas CLI. The help flag options show additional information for any command. Learn more about help in the Additional CLI Commands section.
-h
or--help
Global Flags
Global Flags modify your CLI configuration for a specific instance in your terminal use. View the table below for more about each flag.
Flag | Type | Description |
---|---|---|
--access_token |
string | Nylas account <ACCESS_TOKEN> . |
--config_dir |
string | Config directory (default "/Users/.../.nylas") ). |
--config_file |
string | Config file (default is config.yaml ). |
--dashboard_api_url |
string | Dashboard API URL. |
--debug |
N/A | Enable debugging output. |
--nylas_api_url |
string | Nylas API URL. |
-o , --output |
string | Output format (default JSON , table ). |
--silent |
N/A | Silences the output. |
--disable_telemetry |
N/A | Disables sending telemetry data. |
Using the Table Output Format
The output
flag options change the display of the responses for API requests through the CLI.
Flag | Option | Description |
---|---|---|
-o , --output |
JSON |
Default |
-o , --output |
table |
Columns and values separated by pipes in terminal. |
Response and Output
The JSON
output format is the default for all API request responses. The table
output format shows each value in columns separated by pipes in the terminal.
% nylas api calendars get -o json
[
{
"account_id": "<ACCOUNT_ID>",
"description": "Emailed events",
"id": "<CALENDAR_ID>",
"is_primary": null,
"location": null,
"name": "Emailed events",
"object": "calendar",
"read_only": true,
"timezone": null
},
{
"account_id": "<ACCOUNT_ID>",
"description": null,
"id": "<CALENDAR_ID>",
"is_primary": true,
"location": null,
"name": "Calendar",
"object": "calendar",
"read_only": false,
"timezone": null
},
{
"account_id": "<ACCOUNT_ID>",
"description": null,
"id": "<CALENDAR_ID>",
"is_primary": null,
"location": null,
"name": "United States holidays",
"object": "calendar",
"read_only": false,
"timezone": null
},
{
"account_id": "<ACCOUNT_ID>",
"description": null,
"id": "<CALENDAR_ID>",
"is_primary": null,
"location": null,
"name": "Birthdays",
"object": "calendar",
"read_only": false,
"timezone": null
}
]
% nylas api calendars get -o table
name | object | id | read_only | account_id | description
Emailed events | calendar | <CALENDAR_ID> | true | <ACCOUNT_ID> | Emailed events
Calendar | calendar | <CALENDAR_ID> | false | <ACCOUNT_ID> | %!s(<nil>)
United States holidays | calendar | <CALENDAR_ID> | false | <ACCOUNT_ID> | %!s(<nil>)
Birthdays | calendar | <CALENDAR_ID> | false | <ACCOUNT_ID> | %!s(<nil>)
Additional CLI Commands
These supporting CLI commands help you maintain your workflow and bring you the information you need within the terminal.
Docs
View the Nylas API endpoint documentation with the docs
command. Use the formatting below to specify endpoint and method.
nylas docs [endpoint] [http method] [flags]
Docs Command Example
In the example below, the Nylas CLI returns all information related to a specific API request.
nylas docs calendars get
Help
Within the CLI, you can get help and more information for any command. Help is available for any command in the Nylas CLI or as a flag.
help
--help
-h
nylas help api calendars get
nylas api calendars get --help
nylas api calendars get -h
Version
The version
command displays the currently isntalled Nylas CLI status.
$ nylas version
Version: 1.0.0