TeleOps is a small self-hosted Telegram host controller written in Go.
It lets you expose a fixed set of host commands through a Telegram bot, with a simple INI config, explicit lifecycle commands, and no external service dependencies.
- Cross-platform: Linux and Windows
- Explicit config lifecycle with
teleops init - Foreground process model with
start,stop,restart, andstatus - PID-file based process control
- Command allowlist from config
- Command output returned directly in Telegram
- Local file logging
- Simple release tooling for GNU Make and PowerShell
TeleOps is intended for trusted, self-hosted environments.
- Anyone who gains control of your Telegram bot token can interact with the bot.
- Anyone who can send messages from the configured Telegram user ID can execute the configured commands.
- Commands run on the host machine with the privileges of the TeleOps process.
- Only expose commands you are comfortable running remotely.
- Prefer dedicated, low-privilege accounts where possible.
go build -o teleops ./cmdGNU Make environments:
make releaseWindows PowerShell:
powershell -ExecutionPolicy Bypass -File .\build-release.ps1teleops initIf you want to use a custom config path:
teleops --config ./teleops.conf initIf the config already exists and you want to regenerate it:
teleops init --forceDefault config path:
~/.config/teleops/teleops.conf
You can override it with --config /path/to/teleops.conf or TELEOPS_CONFIG. The --config flag has higher priority.
A repository sample is available at teleops.sample.conf.
Example:
[telegram]
bot_token = <your-telegram-bot-token>
allowed_user_id = <your-telegram-user-id>
[commands]
/shutdown = /sbin/shutdown now
/restart = /sbin/reboot now
[output]
command_format = markdown
[logging]
log_path = ~/.config/teleops/teleops.logWhere:
bot_tokenis the token from BotFather, for example123456789:AAExampleBotTokenReplaceMeallowed_user_idis your personal Telegram numeric user ID, for example937778855command_formatcontrols command result formatting:markdownwraps output in Telegram code blocks,plainsends raw text
Example command definitions in config:
Example command execution in Telegram:
teleops startWith an explicit config path:
teleops start --config /etc/teleops/teleops.confteleops statusteleops stopteleops restartTeleOps runs as a foreground process. For unattended operation, supervise it with an external service manager.
A systemd example is included at services/linux/teleops.service.
Typical install flow on Ubuntu:
sudo cp services/linux/teleops.service /etc/systemd/system/teleops.service
sudo systemctl daemon-reload
sudo systemctl enable teleops
sudo systemctl start teleops
sudo systemctl status teleopsBefore enabling it, review these placeholders in the unit file:
User=teleopsGroup=teleopsHOME=/home/teleopsTELEOPS_CONFIG=/home/teleops/.config/teleops/teleops.conf
Because TeleOps is not a native Windows service binary, run it through a wrapper
such as NSSM. An example installer script is included at
services/windows/install-nssm.ps1, with extra notes in
services/windows/README.md.
teleops [--config path] [--force] init
teleops [--config path] [--pid-file path] <start|stop|restart|status>
teleops [-version] [-help]
Config sections:
[telegram][commands][output][logging]
Configuration lookup priority:
--configTELEOPS_CONFIG~/.config/teleops/teleops.conf
Environment variable overrides:
TELEOPS_CONFIGTELEOPS_TOKENTELEOPS_USER_IDTELEOPS_COMMAND_FORMATTELEOPS_LOG
Default PID file:
~/.config/teleops/teleops.pid
TeleOps is intentionally small and minimal. It is designed to be easy to audit, easy to self-host, and easy to adapt.
MIT. See LICENSE.

