A Telegram bot that acts as a remote shell session. Execute shell commands from your phone via Telegram.
-
Install dependencies
uv sync
-
Configure environment
cp .env.example .env # Edit .env with your bot token and user ID -
Get your Telegram bot token
- Message @BotFather on Telegram
- Create a new bot with
/newbot - Copy the token to
.env
-
Get your Telegram user ID
- Message @userinfobot
- Copy your ID to
.env
make dev # Foreground mode (for development)
make run # Background mode
make stop # Stop background bot
make restart # Restart background bot
make status # Check if running
make log # View log file
make log-tail # Follow log in real-timemake install # Register LaunchAgent
make uninstall # Remove LaunchAgent| Command | Description |
|---|---|
/start |
Start session |
/help |
Show help |
/pwd |
Show current directory (with bookmark button) |
/cd <path> |
Change directory |
/home |
Go to home directory |
/bookmark |
Show saved bookmarks |
Any other text is executed as a shell command.
Only users listed in ALLOWED_USERS can use the bot. Configure in .env:
ALLOWED_USERS=123456789,987654321
Block dangerous commands in blacklist_cmd.txt (one per line):
rm
sudo
Block access to sensitive directories in blacklist_dir.txt:
~/.ssh
~/API
| File | Description |
|---|---|
bot.py |
Main bot code |
.env |
Environment variables (gitignored) |
blacklist_cmd.txt |
Blocked commands (gitignored) |
blacklist_dir.txt |
Blocked directories (gitignored) |
*.template.txt |
Templates for blacklists |
launchd.plist.template |
macOS LaunchAgent template |
MIT