Skip to main content

nifectl integrations Command Reference

Connect third-party services.

Overview​

The integrations commands are the Webhooks & Integrations page of the nife.io dashboard on the command line.

ChannelBelongs toWhat you can do
newrelican organisationconnect New Relic, install it on a cluster, switch it on for an app
slackyour usersave a Slack incoming webhook
pagerdutyyour usersave an integration key, send events and test alerts
emailyour usersave an address, send email
smsyour usersave a phone number (Twilio), send and test text messages

Subcommands​

SubcommandDescription
integrations newrelicConnect New Relic
integrations emailSend email notifications
integrations pagerdutyCreate PagerDuty incidents for critical alerts
integrations smsSend SMS for critical events
integrations slackSend notifications to Slack
nifectl integrations <subcommand> [flags]

Options​

--org string Slug of the organization (asked if you have more than one) (some subcommands)
-y, --yes Accept all confirmations (some subcommands)
-h, --help Help for integrations

Global Options​

-t, --access-token string Nife API Access Token
-j, --json JSON output format
-V, --verbose Verbose / debug output

integrations newrelic​

Connect New Relic.

Connect an organization to New Relic, install New Relic on a cluster and switch it on for an app. Mirrors Webhooks & Integrations and the New Relic windows of the nife.io dashboard.

The API key and licence key are encrypted before they are sent. Give them with --api-key and --license-key, with the NEW_RELIC_API_KEY and NEW_RELIC_LICENSE_KEY environment variables, or leave them out and you are asked (typing is hidden).

SubcommandDescription
integrations newrelic listShow the New Relic connection of each organization
integrations newrelic statusShow the New Relic connection of an organization
integrations newrelic connectSave a New Relic connection
integrations newrelic testCheck New Relic details without saving them
integrations newrelic disconnectRemove the New Relic connection of an organization
integrations newrelic secretsList the saved New Relic connections usable in a region
integrations newrelic installInstall New Relic on a cluster
integrations newrelic configureSwitch New Relic on for an app
nifectl integrations newrelic <subcommand> [flags]

integrations newrelic list​

Show the New Relic connection of each organization.

Show whether each of your organizations is connected to New Relic.

nifectl integrations newrelic list

Examples:

nifectl integrations newrelic list

integrations newrelic status​

Show the New Relic connection of an organization.

Keys are never shown, only their last characters.

nifectl integrations newrelic status [flags]

Options:

--org string Slug of the organization (asked if you have more than one)

Examples:

nifectl integrations newrelic status --org acme

integrations newrelic connect​

Save a New Relic connection.

Save a New Relic connection for an organization. nife.io checks it with New Relic first. If the organization is already connected, anything you leave out stays as it is.

nifectl integrations newrelic connect [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
--account-id string New Relic account ID
--region string New Relic data region: US (the default) or EU
--api-key string New Relic user API key (env: NEW_RELIC_API_KEY)
--name string A name for the connection
--license-key string New Relic licence (ingest) key (env: NEW_RELIC_LICENSE_KEY)

Examples:

nifectl integrations newrelic connect --org acme --account-id 1234567 --region US
NEW_RELIC_API_KEY=NRAK-... nifectl integrations newrelic connect --org acme --account-id 1234567

integrations newrelic test​

Check New Relic details without saving them.

Check an account ID and API key with New Relic. Nothing is saved.

nifectl integrations newrelic test [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
--account-id string New Relic account ID
--region string New Relic data region: US (the default) or EU
--api-key string New Relic user API key (env: NEW_RELIC_API_KEY)

Examples:

nifectl integrations newrelic test --org acme --account-id 1234567

integrations newrelic disconnect​

Remove the New Relic connection of an organization.

You are asked to confirm unless you pass --yes.

nifectl integrations newrelic disconnect [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
-y, --yes Accept all confirmations

Examples:

nifectl integrations newrelic disconnect --org acme --yes

integrations newrelic secrets​

List the saved New Relic connections usable in a region.

List the saved New Relic connections that can be used on the clusters of a region, and whether New Relic is already installed there.

nifectl integrations newrelic secrets [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
--region string Code of the region (cluster)

Examples:

nifectl integrations newrelic secrets --org acme --region us-east

integrations newrelic install​

Install New Relic on a cluster.

Install New Relic on a cluster of an organization. nife.io uses the account ID and licence key saved with "connect", edits the chart's values, installs it and records it.

--cluster is the cluster's ID, region code or region name. If you leave it out and the organization has more than one cluster, you are asked.

nifectl integrations newrelic install [flags]

Options:

--org string Slug of the organization (asked if you have more than one)
--cluster string ID, region code or region name of the cluster
--cluster-name string Name of the cluster in New Relic (letters, numbers, '.', '_' and '-')
--account-id string New Relic account ID (default: the one saved for the organization)
--license-key string New Relic licence key (default: the one saved for the organization) (env: NEW_RELIC_LICENSE_KEY)

Examples:

nifectl integrations newrelic install --org acme --cluster us-east --cluster-name prod-us-east

integrations newrelic configure​

Switch New Relic on for an app.

Switch New Relic on for a deployed app. The language picks the agent image; the app has to be redeployed afterwards.

Languages: python, nodejs, java, dotnet, php, ruby.

nifectl integrations newrelic configure [flags]

Options:

-a, --app string App name to operate on (env: NIFE_APP)
-c, --config string Path to an app config file or directory containing one (env: NIFE_APP_CONFIG)
--language string Language of the app: python, nodejs, java, dotnet, php or ruby

Examples:

nifectl integrations newrelic configure -a shop --language nodejs

integrations email​

Send email notifications.

Save the address that gets email notifications, and send emails. Mirrors the Email card of the Webhooks & Integrations page of the nife.io dashboard. The address belongs to your user.

SubcommandDescription
integrations email statusShow the saved email address
integrations email configureSave or replace the email address
integrations email removeRemove the saved email address
integrations email sendSend an email
nifectl integrations email <subcommand> [flags]

integrations email status​

Show the saved email address.

Show whether an email address is saved. The address is partly hidden.

nifectl integrations email status

Examples:

nifectl integrations email status

integrations email configure​

Save or replace the email address.

Save the address that gets email notifications. It is encrypted before it is sent.

nifectl integrations email configure [flags]

Options:

--recipient string Email address that gets the notifications

Examples:

nifectl integrations email configure --recipient ops@example.com

integrations email remove​

Remove the saved email address.

You are asked to confirm unless you pass --yes.

nifectl integrations email remove [flags]

Options:

-y, --yes Accept all confirmations

Examples:

nifectl integrations email remove --yes

integrations email send​

Send an email.

--to is the saved address unless you give another. Anything left out is asked for.

nifectl integrations email send [flags]

Options:

--to string Recipient (default: the saved address)
--subject string Subject of the email
--message string Text of the email

Examples:

nifectl integrations email send --subject "Deploy finished" --message "shop is live"
nifectl integrations email send --to someone@example.com --subject "Hello" --message "Hi"

integrations pagerduty​

Create PagerDuty incidents for critical alerts.

Save a PagerDuty integration key and send events to PagerDuty. Mirrors the PagerDuty card of the Webhooks & Integrations page of the nife.io dashboard. The key belongs to your user.

SubcommandDescription
integrations pagerduty statusShow whether a PagerDuty key is saved
integrations pagerduty configureSave or replace the PagerDuty integration key
integrations pagerduty removeRemove the saved PagerDuty key
integrations pagerduty sendSend an event to PagerDuty
integrations pagerduty testSend a test alert to PagerDuty
nifectl integrations pagerduty <subcommand> [flags]

integrations pagerduty status​

Show whether a PagerDuty key is saved.

Show whether a PagerDuty integration key is saved. Only the start and end of the key are shown.

nifectl integrations pagerduty status

Examples:

nifectl integrations pagerduty status

integrations pagerduty configure​

Save or replace the PagerDuty integration key.

Save the PagerDuty integration (routing) key. The key is encrypted before it is sent. Give it with --integration-key, with the PAGERDUTY_INTEGRATION_KEY environment variable, or leave it out and you are asked (typing is hidden).

nifectl integrations pagerduty configure [flags]

Options:

--integration-key string PagerDuty integration (routing) key (env: PAGERDUTY_INTEGRATION_KEY)

Examples:

nifectl integrations pagerduty configure --integration-key YOUR-KEY

integrations pagerduty remove​

Remove the saved PagerDuty key.

You are asked to confirm unless you pass --yes.

nifectl integrations pagerduty remove [flags]

Options:

-y, --yes Accept all confirmations

Examples:

nifectl integrations pagerduty remove --yes

integrations pagerduty send​

Send an event to PagerDuty.

This can page whoever is on call. It uses the saved key unless you give --integration-key.

Severities: critical (the default), error, warning, info.

nifectl integrations pagerduty send [flags]

Options:

--summary string What happened
--source string Where it came from (default "Nife CLI")
--severity string critical, error, warning or info (default "critical")
--class string Class or type of the event
--component string Component that is affected
--group string Logical group of the component
--integration-key string Key to use instead of the saved one (env: PAGERDUTY_INTEGRATION_KEY)

Examples:

nifectl integrations pagerduty send --summary "Checkout is failing" --severity error --component shop

integrations pagerduty test​

Send a test alert to PagerDuty.

This creates a real test incident. It uses the saved key unless you give --integration-key.

nifectl integrations pagerduty test [flags]

Options:

--integration-key string Key to use instead of the saved one (env: PAGERDUTY_INTEGRATION_KEY)

Examples:

nifectl integrations pagerduty test

integrations sms​

Send SMS for critical events.

Save the phone number that gets SMS notifications, and send text messages (through Twilio). Mirrors the SMS/Twilio card of the Webhooks & Integrations page of the nife.io dashboard. The number belongs to your user.

Numbers are in E.164 format, for example +14155550123.

SubcommandDescription
integrations sms statusShow the saved phone number
integrations sms configureSave or replace the phone number
integrations sms removeRemove the saved phone number
integrations sms sendSend a text message
integrations sms testSend a test text message
nifectl integrations sms <subcommand> [flags]

integrations sms status​

Show the saved phone number.

Show whether a phone number is saved. Only its last four digits are shown.

nifectl integrations sms status

Examples:

nifectl integrations sms status

integrations sms configure​

Save or replace the phone number.

Save the phone number that gets SMS notifications. It is encrypted before it is sent.

nifectl integrations sms configure [flags]

Options:

--phone string Phone number in E.164 format

Examples:

nifectl integrations sms configure --phone +14155550123

integrations sms remove​

Remove the saved phone number.

You are asked to confirm unless you pass --yes.

nifectl integrations sms remove [flags]

Options:

-y, --yes Accept all confirmations

Examples:

nifectl integrations sms remove --yes

integrations sms send​

Send a text message.

Send a text message (up to 1600 characters). --to is the saved number unless you give another.

nifectl integrations sms send [flags]

Options:

--to string Phone number (default: the saved number)
--message string Text of the message

Examples:

nifectl integrations sms send --message "shop deploy failed"
nifectl integrations sms send --to +14155550123 --message "hello"

integrations sms test​

Send a test text message.

--to is the saved number unless you give another.

nifectl integrations sms test [flags]

Options:

--to string Phone number (default: the saved number)

Examples:

nifectl integrations sms test

integrations slack​

Send notifications to Slack.

Connect a Slack incoming webhook so nife.io posts deployment and alert notifications to a channel. Mirrors the Slack card of the Webhooks & Integrations page of the nife.io dashboard. The webhook belongs to your user.

The URL is encrypted the way the dashboard does it. If your dashboard was built with its own VITE_SECRET_KEY, set the same value in NIFE_SLACK_SECRET_KEY.

SubcommandDescription
integrations slack statusShow whether a Slack webhook is connected
integrations slack connectConnect or replace the Slack webhook
integrations slack removeRemove the Slack webhook
nifectl integrations slack <subcommand> [flags]

integrations slack status​

Show whether a Slack webhook is connected.

The URL is shown with its secret part hidden.

nifectl integrations slack status

Examples:

nifectl integrations slack status

integrations slack connect​

Connect or replace the Slack webhook.

Connect a Slack incoming webhook, or replace the one that is connected.

Create the webhook in Slack: api.slack.com/apps → your app → Incoming Webhooks → Add New Webhook to Workspace. Give the URL with --webhook-url, with the SLACK_WEBHOOK_URL environment variable, or leave it out and you are asked (typing is hidden).

nifectl integrations slack connect [flags]

Options:

--webhook-url string Slack incoming webhook URL (env: SLACK_WEBHOOK_URL)

Examples:

nifectl integrations slack connect --webhook-url https://hooks.slack.com/services/T000/B000/XXXX

integrations slack remove​

Remove the Slack webhook.

You are asked to confirm unless you pass --yes.

nifectl integrations slack remove [flags]

Options:

-y, --yes Accept all confirmations

Examples:

nifectl integrations slack remove --yes

Best Practices​

  • Run a channel's status command first. It shows what is already connected without changing anything.
  • pagerduty test, pagerduty send, email send, sms send and sms test deliver real notifications, so use them deliberately.
  • Keys, addresses and numbers are encrypted before they are sent and are only shown in part, for example ********3064.
  • Pass --yes to remove and disconnect in scripts to skip the confirmation.

See Also​

Summary​

Nifectl Integrations connects New Relic, Slack, PagerDuty, email and SMS from the terminal, with the same checks the dashboard makes.