{"id":13527842,"url":"https://github.com/Nexmo/nexmo-cli","last_synced_at":"2025-04-01T10:32:53.610Z","repository":{"id":44220892,"uuid":"57385121","full_name":"Nexmo/nexmo-cli","owner":"Nexmo","description":"Nexmo CLI (Command Line Interface)","archived":true,"fork":false,"pushed_at":"2023-07-18T21:49:18.000Z","size":1308,"stargazers_count":78,"open_issues_count":35,"forks_count":51,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-01-22T15:15:44.507Z","etag":null,"topics":["cli","command-line","command-line-tool","developer-destination","nexmo","vonage"],"latest_commit_sha":null,"homepage":"https://nexmo.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nexmo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-29T13:15:49.000Z","updated_at":"2024-08-05T10:00:57.000Z","dependencies_parsed_at":"2024-06-18T22:38:23.476Z","dependency_job_id":"7375483d-7831-4339-9d09-6eb1039d9bab","html_url":"https://github.com/Nexmo/nexmo-cli","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nexmo","download_url":"https://codeload.github.com/Nexmo/nexmo-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246625695,"owners_count":20807803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","command-line-tool","developer-destination","nexmo","vonage"],"created_at":"2024-08-01T06:02:03.350Z","updated_at":"2025-04-01T10:32:53.211Z","avatar_url":"https://github.com/Nexmo.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Nexmo CLI\n\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)\n[![npm version](https://badge.fury.io/js/nexmo-cli.svg)](https://badge.fury.io/js/nexmo-cli) [![Build Status](https://travis-ci.org/Nexmo/nexmo-cli.svg?branch=main)](https://travis-ci.org/Nexmo/nexmo-cli)\n[![Known Vulnerabilities](https://snyk.io/test/github/Nexmo/nexmo-cli/badge.svg)](https://snyk.io/test/github/Nexmo/nexmo-cli)\n[![codecov](https://codecov.io/gh/Nexmo/nexmo-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/Nexmo/nexmo-cli)\n\n\u003cimg src=\"https://developer.nexmo.com/assets/images/Vonage_Nexmo.svg\" height=\"48px\" alt=\"Nexmo is now known as Vonage\" /\u003e\n\n|\u003cp align=\"left\"\u003e:exclamation: Th CLI has moved! It is now the [Vonage CLI](https://github.com/Vonage/vonage-cli).\u003cbr /\u003e\u003cbr /\u003e We will support this repository for 12 months, ending October 2022, with any needed bug or security fixes for the last release. New features will be released under  the Vonage CLI`, so to take advantage of those please make sure to switch as soon as possible so you don't miss out!\u003c/p\u003e   |\n|-----------------------------------------|\n\n[Installation](#installation) | [Usage](#usage) | [Contributing](#contributing) | [License](#license)\n\n## Installation\n\nThe Nexmo CLI requires Node.js 4 or above. If you don't have Node.js installed on your system, go to https://nodejs.org/en/download/ and download the appropriate installer for your system.\n\nWith Node.js installed, you can then install the `nexmo-cli` package from the npm registry.\n\n```bash\nnpm install nexmo-cli -g   # Using npm\nyarn global add nexmo-cli  # Using yarn\n```\n\n\u003e If you see an `EACCES` error when you try to install a package globally, follow the steps outlined at [_How to Prevent Permissions Errors_](https://docs.npmjs.com/getting-started/fixing-npm-permissions).\n\nAfter installation, set up the CLI with your [Nexmo](https://dashboard.nexmo.com/settings) API key and secret:\n\n```bash\n\u003e nexmo setup \u003capi_key\u003e \u003capi_secret\u003e\nCredentials written to /Users/yourname/.nexmorc\n```\n\nThis will save your credentials to `~/.nexmorc`. If you want to use different credentials per project, you can pass the `--local` flag as follows:\n\n```bash\n\u003e nexmo setup \u003capi_key\u003e \u003capi_secret\u003e --local\n```\n\nThis will save the config to your local folder instead.\n\n## Usage\n\n[Flags](#flags) | [Account](#account) | [Pricing](#pricing) | [Numbers](#numbers) | [SMS](#sms) | [Applications](#applications) | [Linking](#linking) | [Insight](#insight) | [JWT](#jwt)\n\n### Flags\n\nUse `--quiet` to silence all but errors and warnings, and use `--verbose` to get more detailed output.\n\n### Account\n\n#### Account login\n\n```bash\n\u003e nexmo setup \u003capi_key\u003e \u003capi_secret\u003e\nCredentials written to /home/username/.nexmorc\n```\n\nAlias: `nexmo s`.\n\n#### Account info\n\n```bash\n\u003e nexmo account\nAPI Key:    \u003capi_key\u003e\nAPI Secret: \u003capi_secret\u003e\n\n\u003e nexmo account:key\n\u003capi_key\u003e\n\n\u003e nexmo account:secret\n\u003capi_secret\u003e\n```\n\nAlias: `nexmo a`.\n\n#### Account balance\n\n```bash\n\u003e nexmo balance\n18.96 EUR\n\n\u003e nexmo balance -v\n18.9589 EUR\n```\n\nAlias: `nexmo b`\n\n### Pricing\n\n#### Price to send an SMS to a number\n\n```bash\n\u003e nexmo price:sms 44555555555\n0.03140000 EUR\n```\n\nAlias: `nexmo ps`\n\n#### Price to make a call to a number\n\n```bash\n\u003e nexmo price:voice 44555555555\n0.02400000 EUR\n```\n\nAlias: `nexmo pv`\n\n#### Price for outbound SMS per country\n\n```bash\n\u003e nexmo price:country GB\n0.03140000 EUR\n\n\u003e nexmo price:country LU -v\n\nnetwork           | mtPrice\n------------------------------\nPOST Luxembourg   | 0.01280000\nOrange Luxembourg | 0.01280000\nJoin Experience   | 0.01280000\nTango             | 0.01280000\n```\n\nAlias: `nexmo pc`\n\n### Numbers\n\n#### List all numbers on your account\n\n- Optional flags:\n\n  - `--size` The number of results to return\n  - `--page` The page of results to return\n  - `--pattern \u003cpattern\u003e` to be matched in number (use * to match end or start of number)\n\n```bash\n\u003e nexmo numbers:list\n31555555555\n44655555555\n44555555555\n\n\u003e nexmo numbers:list --verbose\nItem 1-3 of 3\n\nmsisdn      | country | type       | features  | voiceCallbackType | voiceCallbackValue | moHttpUrl | voiceStatusCallbackUrl\n----------------------------------------------------------------------------------------------------------------------------\n31555555555 | NL      | mobile-lvn | VOICE,SMS | app               | b6d9f957           | undefined | https://example.com\n44655555555 | GB      | mobile-lvn | VOICE,SMS | app               | b6d9f957           | undefined | https://example.com\n44555555555 | GB      | mobile-lvn | SMS       | app               | b6d9f957           | undefined | https://example.com\n```\n\nAlias: `nexmo nl`, `nexmo numbers` and `nexmo number:list`.\n\n#### Search for new numbers\n\nParameters:\n\n- `country_code` - an ISO 3166-2 country code for the country you are trying to find a number for.\n- Optional flags:\n\n  - `--pattern \u003cpattern\u003e` to be matched in number (use * to match end or start of number)\n  - `--voice` to search for voice-enabled numbers\n  - `--sms` search for SMS enabled numbers\n  - `--size` the number of results to return\n  - `--page` the page of results to return\n\n```bash\n\u003e nexmo number:search US\n12057200555\n12069396555\n12069396555\n12155961555\n\n\u003e nexmo number:search NL --sms --pattern *007 --verbose\nmsisdn      | country | cost | type       | features\n-----------------------------------------------------\n31655551007 | NL      | 3.00 | mobile-lvn | VOICE,SMS\n31655552007 | NL      | 3.00 | mobile-lvn | VOICE,SMS\n31655553007 | NL      | 3.00 | mobile-lvn | VOICE,SMS\n```\n\nAlias: `nexmo ns` and `nexmo numbers:search`.\n\n#### Buying a number\n\nParameters:\n\n- `number` - The number to buy\n- or `country_code` and `pattern` - The country and search pattern to find a number for and directly buy.\n\n```bash\n\u003e nexmo number:buy 12069396555\nBuying 12069396555\\. This operation will charge your account.\n\nPlease type \"confirm\" to continue: confirm\n\nNumber purchased\n\n\u003e nexmo number:buy US *555\nBuying 12069396555\\. This operation will charge your account.\n\nPlease type \"confirm\" to continue: confirm\n\nNumber purchased: 12069396555\n\n\u003e nexmo number:buy 12069396555 --confirm\nNumber purchased: 12069396555\n```\n\nAlias: `nexmo nb` and `nexmo numbers:buy`.\n\n#### Cancelling a number\n\n```bash\n\u003e nexmo number:cancel 12069396555\nThis operation can not be reversed.\n\nPlease type \"confirm\" to continue: confirm\n\nNumber cancelled: 12069396555\n\n\u003e nexmo number:cancel 12069396555 --confirm\nNumber cancelled: 12069396555\n```\n\nAlias: `nexmo nc` and `nexmo numbers:cancel`.\n\n#### Update a number\n\nFor shortcuts of these options see [Linking](#linking).\n\n```bash\n\u003e nexmo number:update 445555555555 --voice_callback_type app --voice_callback_value asdasdas-asdd-2344-2344-asdasdasd345\nNumber updated\n```\n\nAlias: `nexmo nu` and `nexmo numbers:update`.\n\n### SMS\n\n#### Send an SMS\n\nSend a message through Nexmo to any number. Either provide a from number, name, or leave it blank to sends as \"Nexmo CLI\".\n\n```bash\n\u003e nexmo sms \u003cdestination_number\u003e Hello world! --confirm\nMessage sent to:   \u003cdestination_number\u003e\nRemaining balance: 26.80110000 EUR\nMessage price:     0.03330000 EUR\n\n\u003e nexmo sms  \u003cdestination_number\u003e Hello world! --from \"Acme Inc\" --confirm\nMessage sent to:   \u003cdestination_number\u003e\nRemaining balance: 26.80110000 EUR\nMessage price:     0.03330000 EUR\n```\n\n**Note:** Some carriers (e.g. US and Canadian) do not allow alphanumeric senders. In these cases, you must use one of your Nexmo virtual numbers in the `from` parameter. For example:\n\n```bash\nnexmo sms \u003cto_number\u003e Hello world! --from \u003cfrom_number\u003e --confirm\n```\n\n### Applications\n\n#### List your Applications\n\n- Optional flags:\n\n  - `--size` The number of results to return\n  - `--page` The page of results to return\n\n```bash\n\u003e nexmo app:list\nasdasdas-asdd-2344-2344-asdasdasd123 | Test Application 1\nasdasdas-asdd-2344-2344-asdasdasd234 | Test Application 1\nasdasdas-asdd-2344-2344-asdasdasd345 | Test Application 2\n\n\u003e nexmo app:list --verbose\nItem 1-3 of 3\n\nid                                   | name\n---------------------------------------------------------\nasdasdas-asdd-2344-2344-asdasdasd123 | Test Application 1\nasdasdas-asdd-2344-2344-asdasdasd234 | Test Application 1\nasdasdas-asdd-2344-2344-asdasdasd345 | Test Application 2\n```\n\nAlias: `nexmo al` and `nexmo apps`.\n\n#### Create a new Application\n\nParameters:\n\n- `name` - the custom name of your application.\n- `answer_url` - the URL where your webhook delivers the Nexmo Call Control Object that governs this call.\n- `event_url` - the URL the platform sends event information asynchronously to when the call_status changes\n- Optional flags:\n\n  - `--keyfile \u003ckeyfile\u003e` The file to save your private key to\n  - `--type \u003ctype\u003e` The product you want to access with this application. (Default: voice)\n  - `--answer_method \u003canswer_method\u003e` The http method for the `answer_url`. (Default: GET)\n  - `--event_method \u003cevent_method\u003e` The http method for the `event_url`. (Default: GET)\n\n```\n\u003e nexmo app:create \"Test Application 1\" http://example.com http://example.com  --keyfile private.key\nApplication created: asdasdas-asdd-2344-2344-asdasdasd345\nPrivate Key saved to: private.key\n\n\u003e nexmo app:create \"Test Application 1\" http://example.com http://example.com -v\n[id]\nasdasdas-asdd-2344-2344-asdasdasd345\n\n[name]\nTest Application 1\n\n[voice.webhooks.0.endpoint_type]\nevent_url\n\n[voice.webhooks.0.endpoint]\nhttp://example.com\n\n[voice.webhooks.0.http_method]\nPOST\n\n[voice.webhooks.1.endpoint_type]\nanswer_url\n\n[voice.webhooks.1.endpoint]\nhttp://example.com\n\n[voice.webhooks.1.http_method]\nGET\n\n[keys.public_key]\n...\n\n[keys.private_key]\n...\n\n[_links.self.href]\n/applications/asdasdas-asdd-2344-2344-asdasdasd345\n```\n\nAlias: `nexmo ac`.\n\n#### Show details for an Application\n\n```bash\n\u003e nexmo app:show asdasdas-asdd-2344-2344-asdasdasd345\n[id]\nasdasdas-asdd-2344-2344-asdasdasd345\n\n[name]\nTest Application 1\n\n[voice.webhooks.0.endpoint_type]\nevent_url\n\n[voice.webhooks.0.endpoint]\nhttp://example.com\n\n[voice.webhooks.0.http_method]\nPOST\n\n[voice.webhooks.1.endpoint_type]\nanswer_url\n\n[voice.webhooks.1.endpoint]\nhttp://example.com\n\n[voice.webhooks.1.http_method]\nGET\n\n[keys.public_key]\n...\n\n[_links.self.href]\n/applications/asdasdas-asdd-2344-2344-asdasdasd345\n\n\nPrivate Key saved to: private.key\n```\n\nAlias: `nexmo as` and `nexmo app`.\n\n#### Update an Application\n\nParameters:\n\n- `app_id` - the UUID of your application.\n- `name` - the custom name of your application.\n- `answer_url` - the URL where your webhook delivers the Nexmo Call Control Object that governs this call.\n- `event_url` - the URL the platform sends event information asynchronously to when the call_status changes\n- Optional flags:\n\n  - `--type \u003ctype\u003e` The product you want to access with this application. (Default: voice)\n  - `--answer_method \u003canswer_method\u003e` The http method for the `answer_url`. (Default: GET)\n  - `--event_method \u003cevent_method\u003e` The http method for the `event_url`. (Default: GET)\n\n```bash\n\u003e nexmo app:update asdasdas-asdd-2344-2344-asdasdasd345 \"Test Application 1\" http://example.com http://example.com\nApplication updated: asdasdas-asdd-2344-2344-asdasdasd345\n\n\u003e nexmo app:update asdasdas-asdd-2344-2344-asdasdasd345 \"Test Application 1\" http://example.com http://example.com -v\n[id]\nasdasdas-asdd-2344-2344-asdasdasd345\n\n[name]\nTest Application 1\n\n[voice.webhooks.0.endpoint_type]\nevent_url\n\n[voice.webhooks.0.endpoint]\nhttp://example.com\n\n[voice.webhooks.0.http_method]\nPOST\n\n[voice.webhooks.1.endpoint_type]\nanswer_url\n\n[voice.webhooks.1.endpoint]\nhttp://example.com\n\n[voice.webhooks.1.http_method]\nGET\n\n[keys.public_key]\n...\n\n[keys.private_key]\n...\n\n[_links.self.href]\n/applications/asdasdas-asdd-2344-2344-asdasdasd345\n```\n\nAlias: `nexmo au`.\n\n#### Delete an application\n\nParameters:\n\n- `app_id` - The UUID of your application.\n\n```bash\n\u003e nexmo app:delete asdasdas-asdd-2344-2344-asdasdasd345\nThis operation can not be reversed.\n\nPlease type \"confirm\" to continue: confirm\n\nApplication deleted\n\n\u003e nexmo app:delete asdasdas-asdd-2344-2344-asdasdasd345 --confirm\nApplication deleted\n```\n\nAlias: `nexmo ad`.\n\n#### Show numbers for an application\n\nParameters:\n\n- `app_id` - The UUID of your application.\n\n- Optional flags:\n\n  - `--size` The amount of results to return\n  - `--page` The page of results to return\n\n```bash\n\u003e nexmo app:numbers asdasdas-asdd-2344-2344-asdasdasd345\n31555555555\n44655555555\n44555555555\n\n\u003e nexmo app:numbers asdasdas-asdd-2344-2344-asdasdasd345 --verbose\nItem 1-3 of 3\n\nmsisdn      | country | type       | features  | voiceCallbackType | voiceCallbackValue | moHttpUrl | voiceStatusCallbackUrl\n----------------------------------------------------------------------------------------------------------------------------\n31555555555 | NL      | mobile-lvn | VOICE,SMS | app               | b6d9f957           | undefined | https://example.com\n44655555555 | GB      | mobile-lvn | VOICE,SMS | app               | b6d9f957           | undefined | https://example.com\n44555555555 | GB      | mobile-lvn | SMS       | app               | b6d9f957           | undefined | https://example.com\n```\n\nAlias: `nexmo an` and `nexmo apps:numbers`.\n\n### Linking\n\n#### Link a number to an app\n\n```bash\n\u003e nexmo link:app 12057200555 asdasdas-asdd-2344-2344-asdasdasd345\nNumber updated\n\n\u003e nexmo unlink:app 12057200555\nNumber updated\n```\n\nAlias: `nexmo la`\n\n#### Link a number to another phone number\n\n```bash\n\u003e nexmo link:tel 12057200555 4455555555\nNumber updated\n\n\u003e nexmo unlink:tel 12057200555\nNumber updated\n```\n\nAlias: `nexmo lt`\n\n#### Link a number to an SMS callback URL\n\n```bash\n\u003e nexmo link:sms 12057200555 http://example.com/callback\nNumber updated\n\n\u003e nexmo unlink:sms 12057200555\nNumber updated\n```\n\nAlias: `nexmo lsms`\n\n#### Link a number to a Voice XML callback URL\n\n```bash\n\u003e nexmo link:vxml 12057200555 http://example.com/callback\nNumber updated\n\n\u003e nexmo unlink:vxml 12057200555\nNumber updated\n```\n\nAlias: `nexmo lv`\n\n#### Link a number to SIP URI\n\n```bash\n\u003e nexmo link:sip 12057200555 sip:123@example.com\nNumber updated\n\n\u003e nexmo unlink:sip 12057200555\nNumber updated\n```\n\nAlias: `nexmo lsip`\n\n### Insight\n\n#### Insight Basic\n\nThis is the free Number Insight API:\n\n```bash\n\u003e nexmo insight:basic 447555555555\n447555555555 | GB\n```\n\nAlias: `nexmo insight` and `nexmo ib`\n\n#### Insight Standard\n\nThis API will charge your account but provide additional details:\n\n```bash\n\u003e nexmo insight:standard 447555555555 --confirm\n447555555555 | GB | Telefonica UK Limited\n```\n\nVerbose mode will return additional information.\n\nAlias: `nexmo is`\n\n#### Insight Advanced\n\nThis API will charge your account but provide additional details:\n\n```bash\n\u003e nexmo insight:advanced 447555555555 --confirm\n447555555555 | GB | Telefonica UK Limited\n```\n\nVerbose mode will return additional information.\n\nAlias: `nexmo ia`\n\n### JWT\n\n#### Generate\n\n```bash\njwt:generate [options] \u003cprivate_key\u003e [claim=value...]\n```\n\nGenerate a JWT for your voice application.\n\n```bash\n\u003e nexmo jwt:generate path/to/private.key application_id=asdasdas-asdd-2344-2344-asdasdasd345\n```\n\nGenerate a JWT for the Client SDK\n\n```bash\n\u003e nexmo jwt:generate path/to/private.key subject=username application_id=asdasdas-asdd-2344-2344-asdasdasd345\n```\n\n## Contributing\n\nThis project is written in ES2015 and compiled using Babel. The source can be found in the `/src` folder, and the build is compiled to the `/lib` folder.\n\nTo add changes, fork and clone the project.\n\n```bash\nnpm install        # to install all dependencies\nnpm run build      # to explicitly build the source\nnpm install -g ./  # to implicitly build the source, and then install the `nexmo` binary into your PATH\nnpm test           # to run all tests\nnpm run watch:test # to watch for changes and run tests\n```\n\nYou can run the `nexmo` command with the `--debug` / `-d` flag to get extra debug info from the underlying Node.js library.\n\n# License\n\nThis library is released under the [MIT License][license]\n\n[license]: LICENSE.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNexmo%2Fnexmo-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNexmo%2Fnexmo-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNexmo%2Fnexmo-cli/lists"}