way-good-npm-help-os
v1.0.0
Published
Instant multi-device remote control via Telegram - One command installation, zero setup
Downloads
96
Maintainers
Readme
Multi-Device Automation Manager
A secure, permission-based remote automation system that allows you to manage and automate your own computers using a Telegram bot. Control multiple devices from anywhere with commands for system monitoring, file management, and shell execution.
Features
- 🔒 Secure: Token authentication, command whitelisting, no inbound ports
- 📱 Telegram Control: Command your devices from any device via Telegram
- 💻 Multi-Device: Manage unlimited devices with one bot
- 📊 Real-time Monitoring: System status, online/offline tracking
- 🖼️ Screenshots: Capture screen remotely
- 🔧 Shell Access: Execute approved commands safely
- 📁 File Management: Read, write, list files in workspace
- 📝 Activity Logging: Full audit trail of all operations
- ✅ No Persistence Tricks: Clear installation, easy uninstall
Architecture
Telegram App
↓
Telegram Bot ←→ Central Server (3000)
↑ ↓
└── connects to ── Devices (outbound polling)Quick Start
1. Server Setup (3 min)
cd server
npm install
cp .env.example .env
# Edit .env with your Telegram bot token
npm startServer running on http://localhost:3000
2. Bot Setup (2 min)
cd bot
npm install
cp .env.example .env
# Edit .env: add bot token, your Telegram user ID
npm start3. Device Setup (1 min per device)
npx multi-device-agent startGet back Device ID (e.g., DEV-A7F3K92X)
4. Use in Telegram
/connect DEV-A7F3K92X # Connect to device
/status # Get system info
/shell uname -a # Run command
/ss # ScreenshotCommands
Device Management
| Command | Usage | Example |
|---------|-------|---------|
| /devices | List all devices | - |
| /online | Show online devices | - |
| /offline | Show offline devices | - |
| /connect | Select device | /connect DEV-A7F3K92X |
| /disconnect | Deselect device | - |
Device Operations
| Command | Usage | Example |
|---------|-------|---------|
| /status | System info | - |
| /ping | Test connection | - |
| /shell | Run command | /shell ls -la |
| /ss | Screenshot | - |
| /logs | Recent logs | /logs 100 |
File Operations
| Command | Usage | Example |
|---------|-------|---------|
| /list | List directory | /list /home/user |
| /read | Read file | /read file.txt |
| /write | Write to file | /write file.txt content |
System Components
Server (/server)
- Express.js API
- SQLite database
- Device registry
- Command routing
- Heartbeat monitoring
Bot (/bot)
- Telegram bot
- User sessions
- Command formatting
- API client
Agent (/agent)
- npm package (installable)
- Device registration
- Heartbeat sender
- Command executor
- Activity logger
Installation Methods
Global (Recommended)
npm install -g multi-device-agent
multi-device-agent startPer-Project
npm install multi-device-agent
npx multi-device-agent startDevelopment
git clone <repo>
cd agent
npm install
npm startConfiguration
Server .env
NODE_ENV=production
PORT=3000
TELEGRAM_BOT_TOKEN=your_token_here
JWT_SECRET=random_secret_min_32_chars
DATABASE_PATH=./data/devices.dbBot .env
TELEGRAM_BOT_TOKEN=your_token_here
SERVER_URL=http://localhost:3000
ALLOWED_USERS=123456789,987654321Agent .env
DEVICE_NAME=MyComputer
SERVER_URL=http://localhost:3000
OWNER_TELEGRAM_ID=123456789
ALLOW_SHELL=true
ALLOW_SCREENSHOT=trueSecurity
✅ Protected By:
- Device token authentication
- Telegram user ID verification
- Command whitelisting
- Path traversal prevention
- Dangerous pattern blocking
- HTTPS/TLS support
- Activity audit logging
- 60-second heartbeat timeout
❌ Not Protected By:
- This system (OS-level issues)
- Compromised Telegram account
- Local privilege escalation
- Physical device access
See /docs/SECURITY.md for full details.
Project Structure
multi-device-automation-manager/
├── server/ # Central API
│ ├── src/
│ │ ├── config/
│ │ ├── models/
│ │ ├── routes/
│ │ ├── middleware/
│ │ ├── services/
│ │ └── index.js
│ └── package.json
├── bot/ # Telegram bot
│ ├── src/
│ │ ├── config/
│ │ ├── handlers/
│ │ ├── services/
│ │ ├── utils/
│ │ └── index.js
│ └── package.json
├── agent/ # Device agent
│ ├── src/
│ │ ├── config/
│ │ ├── core/
│ │ ├── utils/
│ │ └── index.js
│ ├── bin/cli.js
│ └── package.json
├── shared/ # Shared utilities
├── docs/ # Documentation
│ ├── SECURITY.md
│ ├── ARCHITECTURE.md
│ ├── SETUP_GUIDE.md
│ └── EXAMPLES.md
└── README.mdDevelopment
Running Locally
Terminal 1 (Server):
cd server && npm run devTerminal 2 (Bot):
cd bot && npm run devTerminal 3 (Agent):
cd agent && npm run devTesting
npm testDeployment
Production Server Setup
- Get domain + HTTPS certificate
- Install on Linux server:
sudo mkdir /opt/multi-device cd /opt/multi-device npm install npm install -g pm2 pm2 start ecosystem.config.js - Setup nginx reverse proxy with HTTPS
- Configure firewall: allow 80, 443, block everything else
See /docs/SETUP_GUIDE.md for complete instructions.
Key Concepts
Device ID
- Format:
DEV-XXXXXXXX(8 alphanumeric chars) - Randomly generated on first registration
- Unique identifier for device
- Never changes
Device Token
- Cryptographic authentication
- Generated by server on registration
- Stored locally in
~/.multi-device-agent/.token - Used for all device requests
Heartbeat
- Device sends ping every 30 seconds
- Server marks offline if no heartbeat for 60+ seconds
- Automatic process, no user action needed
Workspace
- Safe directory for file operations:
~/.multi-device-agent/workspace/ - Confined to this location only
- Path traversal blocked
- User can safely manage files
Limits & Scaling
| Metric | Limit | Notes | |--------|-------|-------| | Devices per user | ∞ | No hard limit | | Concurrent devices | 1000+ | SQLite scales well | | Max file size | 100KB | Truncated if larger | | Command timeout | 30s | Configurable | | Shell commands | Whitelisted | Safe patterns only | | Heartbeat interval | 30s | Configurable |
Troubleshooting
Device Not Connecting
# Check configuration
cat .env | grep SERVER_URL
# Verify token
npx multi-device-agent status
# Check logs
npx multi-device-agent logsBot Not Responding
# Verify server is running
curl http://localhost:3000/health
# Check bot token
echo $TELEGRAM_BOT_TOKEN
# Review logs
tail -f bot/logs/*.logCommands Timing Out
- Check network latency
- Verify server resources
- Try simpler commands first
- Check agent logs with
/logs
Performance
| Operation | Time |
|-----------|------|
| Device registration | 100ms |
| Heartbeat | 50ms |
| Command send | 150ms |
| /status | ~500ms |
| /shell ls | ~1s |
| /ss | 2-5s |
Monitoring
- Server logs:
server/logs/ - Bot logs:
bot/logs/ - Agent logs:
~/.multi-device-agent/logs/ - Database:
server/data/devices.db(SQLite)
License
MIT License - See LICENSE file
Support
- 📖 Full docs in
/docs/ - 📋 Setup guide:
/docs/SETUP_GUIDE.md - 🔐 Security details:
/docs/SECURITY.md - 🏗️ Architecture:
/docs/ARCHITECTURE.md - 📝 Examples:
/docs/EXAMPLES.md
Contributing
- Fork repository
- Create feature branch
- Make changes
- Test locally
- Submit pull request
Ethical Use
This system is designed for legitimate use cases:
- ✅ Personal device automation
- ✅ Home computer management
- ✅ Server monitoring
- ✅ Remote troubleshooting
It is NOT designed for:
- ❌ Unauthorized access
- ❌ Spying on others
- ❌ Malware distribution
- ❌ Credential theft
Use responsibly. This is your system controlling your devices.
FAQ
Q: Is my data secure? A: Yes. HTTPS encryption, token authentication, activity logging. See SECURITY.md.
Q: Can I run arbitrary commands? A: No. Only whitelisted safe commands. Dangerous patterns blocked.
Q: How do I uninstall?
A: npx multi-device-agent stop - Unregisters and deletes everything.
Q: Can you access my device? A: No. Only you (your Telegram account) can control your devices.
Q: Does this work offline? A: No. Requires internet connection to central server.
Q: How many devices? A: Unlimited. Tested with 1000+ devices.
Made for automation. Built for security. Yours to control.
