SMS — Command AI by Text
SMS — Command AI by Text — easy-to-understand guide based on official docs
Imagine sending a text message to a friend who can look things up, write emails, and solve problems for you — except that friend is an AI. That’s exactly what this feature does: you text your Twilio phone number, and Hermes texts you back with smart answers, no app required.
What You Need Before Starting
Think of this like setting up a new phone line for your AI assistant. You’ll need:
- A Twilio account (free trial works fine)
- A Twilio phone number that can send/receive SMS
- A server that’s publicly reachable (so Twilio can “knock” on your server’s door when a text arrives)
- One quick install — open your terminal and run:
cd ~/.hermes/hermes-agent && uv pip install -e ".[sms]"
Step 1: Grab Your Twilio Keys
Log into the Twilio Console and look for two important codes on your dashboard:
- Account SID (starts with
AC) - Auth Token (your secret password for Twilio)
Also, go to Phone Numbers → Manage → Active Numbers and write down your phone number in international format, like +15551234567.
Step 2: Tell Hermes About Your Twilio Setup
The easiest way is to use the built-in setup wizard:
hermes gateway setup
Select SMS (Twilio) from the list, and it will ask for your credentials step by step.
If you prefer doing it manually, open ~/.hermes/.env and add these lines:
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=your_auth_token_here
TWILIO_PHONE_NUMBER=+15551234567
Step 3: Decide Who Can Text Your AI
You probably don’t want strangers texting your AI. So list the people allowed to use it:
SMS_ALLOWED_USERS=+15559876543,+15551112222
Only these numbers will get responses. Everyone else gets ignored — like a bouncer at a club.
Step 4: Connect Twilio to Your Server
Twilio needs to know where to send incoming texts. In your Twilio console, find Phone Numbers → Active Numbers, click your number, and look for “Messaging” settings.
Set the webhook URL to something like:
https://your-server.com/webhook/sms
That’s it! Now when someone texts your Twilio number, Twilio forwards it to Hermes, and the AI replies automatically.
A Quick Test
Text your Twilio number something simple like:
What's the weather in Tokyo today?
If everything’s set up correctly, you’ll get a helpful reply within seconds.
Final Thoughts
This is perfect for when you’re away from your computer or want a simple, no-app-required way to use AI. The best part? It uses the same Twilio credentials as voice calls, so if you already have Twilio set up, you’re halfway there.
Practical tip: Start with just your own phone number in SMS_ALLOWED_USERS. Test it thoroughly, then add friends or family once you’re comfortable. You can always add more numbers later — just edit that line and restart Hermes.
📖 Official Docs
This article is based on the official Hermes Agent documentation:Official docs › user-guide/messaging/sms