@relay-works/cli
v0.0.2
Published
The official command-line interface for the Relay SMS platform, featuring integrated SMS development tools.
Readme
Relay CLI
The official command-line interface for the Relay SMS platform, featuring integrated SMS development tools.
Installation
npm install -g @relay-works/cliQuick Start
# Authenticate with Relay
relay login
# Generate configuration file
relay config init
# Start local development environment
relay dev
# Check status of development servers
relay statusSMS Development Integration
The Relay CLI includes seamless integration with sms-dev, a local SMS development server that acts as "Mailtrap for SMS" - allowing you to test SMS functionality without sending real messages.
Basic Usage
# Start development environment (includes sms-dev + UI)
relay dev
# Start with custom webhook URL
relay dev --webhook-url http://localhost:3000/webhook
# Start API only (no virtual phone UI)
relay dev --no-ui
# Start with custom ports
relay dev --api-port 4001 --ui-port 4000Configuration
Create a relay.json file in your project root:
relay config initExample relay.json:
{
"project": {
"name": "My SMS App",
"environment": "development"
},
"smsDev": {
"apiPort": 4001,
"uiPort": 4000,
"webhookUrl": "http://localhost:3000/webhook",
"verbose": false,
"startUI": true
}
}Direct SMS-Dev Commands
Access sms-dev functionality directly through the Relay CLI:
# Show all available sms-dev commands
relay sms-dev
# Mock phone management
relay sms-dev mock-phone create --phone +1234567890 --name "Test User"
relay sms-dev mock-phone list
relay sms-dev mock-phone delete --phone +1234567890
# Conversation flows
relay sms-dev flow create --name "Welcome Flow"
relay sms-dev flow list
relay sms-dev flow execute --flow-id flow_123 --phone +1234567890
# Data export
relay sms-dev export messages --format json --output messages.json
relay sms-dev export conversations --format csv
# Performance testing
relay sms-dev perf stats
relay sms-dev perf load-test --messages 100 --users 5
# Server management
relay sms-dev status
relay sms-dev stopCommands
Core Commands
relay login- Authenticate with Relay platformrelay logout- Sign out of your accountrelay status- Check development environment statusrelay open- Open Relay dashboard in browser
Development Commands
relay dev- Start local development environment with sms-devrelay config [init|show]- Manage configurationrelay sms-dev [command]- Access SMS development toolsrelay webhooks- Forward webhooks to local serverrelay logs- Tail production logsrelay env- Pull environment variables
Project Management
relay init- Initialize new Relay project
Configuration Priority
Configuration is loaded in this order (later values override earlier ones):
relay.jsonrelay.config.json.relayrc.relayrc.json- Environment variables
- Command-line options
Environment Variables
RELAY_API_URL- Relay API base URLSMS_DEV_API_PORT- SMS dev server API portSMS_DEV_UI_PORT- SMS dev server UI portSMS_DEV_WEBHOOK_URL- Webhook URL for testingSMS_DEV_VERBOSE=true- Enable verbose loggingSMS_DEV_NO_UI=true- Disable UI server
Development Workflow
- Setup:
relay loginandrelay config init - Development:
relay devstarts local SMS development environment - Testing: Use virtual phone UI at
http://localhost:4000 - API Testing: Point your app to
http://localhost:4001 - Production: Deploy with confidence knowing SMS works locally
Learn More
Support
- GitHub Issues: relay-works/relay-cli
- Documentation: docs.relay.works
- Support: [email protected]
Local Development (Contributing)
To run the CLI locally from source (e.g., within this repo):
Build the package:
npm run buildLink globally:
npm linkRun: You can now use
relaycommand anywhere on your system, pointing to your local source.relay --version
