This is the powerful CLI program for use with Mocean's API. To use this, you'll need a Mocean account. # for free at moceanapi.com.
Mocean-CLI is powered by NodeJS, so you will need first to install NodeJS and npm, before proceed to use Mocean-CLI.
To use the client library you'll need to have created a Mocean account.
To install the Node CLI client library using npm.
npm i mocean-cli -g
After installation, login to the cli with your credentials
> mocean login <api_key> <api_secret>
This will save your credentials to ~/.moceanrc
.
Add --local
to save it in the directory which running the command
> mocean login <api_key> <api_secret> --local
Run mocean logout
if you want to clear the credentials, this is strongly encouraged when running on untrusted device
> mocean logout
To logout from the directory, add --local
> mocean logout --local
> mocean account
Alias : mocean acc
> mocean account:balance
Alias : mocean ab
> mocean account:#
Alias : mocean ap
To use Mocean's SMS API to send an SMS message, use mocean sms <to> <text>
.
> mocean sms <to> <text>
Default from will be Mocean CLI
, you can override it by providing --from
option
> mocean sms <to> <text> --from "Mocean"
Use --confirm
to skip confirmation step
> mocean sms:status <msg_id>
Qlias : mocean ss <msg_id>
> mocean number:lookup <number>
Qlias : mocean nl <number>
> mocean -h
Usage: mocean [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
login [options] [api_key] [api_secret] Login using your api key and api secret
logout [options] Logout
account|acc Show logged in account
account:balance|ab Check Account Balance
account:#|ap Get Account #
sms [options] <to> <text...> Send a Sms
sms:status|ss <msg_id> Check message status
number:lookup|nl [options] <number> Perform Number Lookup
This library is released under the MIT License