gateway command launches Weaver as a persistent service, enabling channel integrations (Telegram, Discord, Slack), scheduled tasks, heartbeat monitoring, and REST API access.
Usage
Options
Enable debug mode with verbose logging
Startup Sequence
When gateway starts, it displays comprehensive initialization status:Services
Gateway automatically starts multiple services:1. Agent Loop
Core AI agent processing engine:- Loads tools and skills
- Manages conversation sessions
- Processes messages from all channels
2. Channel Manager
Integrations enabled in config:- Telegram - Bot API integration
- Discord - Bot with voice support
- Slack - Slack App integration
3. Cron Service
Scheduled task executor:- Loads jobs from
workspace/cron/jobs.json - Executes on defined schedules
- Delivers results to specified channels
weaver cron for job management.
4. Heartbeat Service
Periodic health check and proactive monitoring:- Interval configured in
config.json - Can trigger agent actions
- Disabled by default
5. Device Event Service
USB device monitoring (optional):- Detects device connections/disconnections
- Can trigger agent workflows
- Requires
devices.enabled: truein config
6. REST API Server
HTTP endpoints for external integrations:POST /chat
POST /chat
Send messages to the agentRequest:Response:
GET /health
GET /health
Health check endpointResponse:
GET /ready
GET /ready
Readiness check for orchestratorsResponse:
7. Voice Transcription (Optional)
Groq-powered voice message transcription:- Automatically enabled if
providers.groq.api_keyis set - Attaches to Telegram, Discord, and Slack channels
- Converts voice messages to text for agent processing
Configuration
Gateway behavior is controlled by~/.weaver/config.json:
Shutdown Sequence
Graceful shutdown with Ctrl+C:- Stop accepting new requests
- Cancel agent context
- Stop health server
- Stop device service
- Stop heartbeat service
- Stop cron service
- Stop agent loop
- Stop all channels
Debug Mode
Enable detailed logging:- Tool registration details
- Skill loading process
- Channel connection attempts
- Message routing
- API request/response logs
Examples
Exit Codes
| Code | Reason |
|---|---|
| 0 | Clean shutdown via Ctrl+C |
| 1 | Config loading failed |
| 1 | Provider creation failed |
| 1 | Channel startup failed |
Error Handling
Port Already in Use
Channel Configuration Error
~/.weaver/config.json.
Cron Service Error
workspace/cron/jobs.json for syntax errors.
Performance
- Startup time: ~2-4 seconds
- Memory usage: ~100-200 MB (varies with channels)
- Response time: <1s for most operations
Production Deployment
Related Commands
weaver agent- Direct CLI interaction (no gateway)weaver cron- Manage scheduled jobsweaver status- Check configuration