"Send SMS from terminal"
Do you mean the terminal of your iPhone or the terminal of your PC/Mac?
If you mean the terminal of your iPhone, you can open a connection to your /dev/tty.debug file and use AT commands to request sending a message.
This website has some nice introduction about AT commands:
SMS Tutorial: How to Send SMS Messages from a Computer/PC Using a Mobile Phone or GSM/GPRS Modem? AT Commands