A simple node app that allows you to send a text message to a phone number via the command line. Created for #100DaysOfCode
(Day 1).
$ git clone [email protected]:amaseda/text-via-cli.git && cd text-via-cli && npm install
Using this app requires a account and a Twilio phone number. Sign up here.
Note: Unless you upgrade your Twilio account, you can only send messages to "Verified Numbers."
Create an env.js
file in the root directory containing the below Twilio account credentials...
// env.js
module.exports = {
accountSid: "accountsid-goes-here",
authToken: "auth-token-goes-here",
number: "twilio-phone-number-goes-here"
}
Run the following command via CLI...
$ node app.js "phone-number" "message-body"
Example phone number: "+12025551234"
Map a phone number to a nickname by adding an entry to favorites.js
, like so...
// favorites.js
module.exports = {
"adrian": "+12025559876"
}
Using the above example...
$ node app.js "adrian" "message-body"