Execute terminal commands via API to control instances (e.g. from a Telegram bot)
rydihod
I propose adding the ability to execute terminal commands within a specific service instance using the Koyeb API. This would enable developers and administrators to automate service management with external tools, such as Telegram bots.
Use Case Example:
A user sets up a Telegram bot to manage their Koyeb instances. Rather than logging into a terminal to enter commands, they can press a button or send a message to the bot, which then calls the API to execute the command in the target service. This makes service management more accessible and convenient, especially on mobile devices.
Example use cases:
- Restarting services or processes within containers
- Running custom scripts (e.g., clearing logs, syncing data, triggering updates)
- Diagnosing issues (e.g., top, df -h, tail -n 100)
- Transforming a Telegram bot into a mobile-friendly control panel
Suggested API Format:
POST /v1/services/{service-id}/exec
Content-Type: application/json
{ "command": "ls -la /app" }
Expected response:
{ "stdout": "...", "stderr": "", "exit_code": 0 }
This feature would be highly valuable for remote automation, lightweight management tools, and developers managing services on the go.
ATTENTION: Translated with the help of AI, the author does not know English.
Log In