{"id":13495556,"url":"https://github.com/vicalloy/telegram-shell-bot","last_synced_at":"2025-04-09T16:18:49.414Z","repository":{"id":46268031,"uuid":"243963545","full_name":"vicalloy/telegram-shell-bot","owner":"vicalloy","description":"A telegram Bot to run shell commands","archived":false,"fork":false,"pushed_at":"2023-03-05T10:10:30.000Z","size":704,"stargazers_count":196,"open_issues_count":8,"forks_count":85,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T16:18:43.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vicalloy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-02-29T12:19:24.000Z","updated_at":"2025-03-23T06:42:16.000Z","dependencies_parsed_at":"2024-01-16T09:52:59.189Z","dependency_job_id":"427bae6c-635f-4cd6-b110-696dd3857ea4","html_url":"https://github.com/vicalloy/telegram-shell-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicalloy%2Ftelegram-shell-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicalloy%2Ftelegram-shell-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicalloy%2Ftelegram-shell-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicalloy%2Ftelegram-shell-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vicalloy","download_url":"https://codeload.github.com/vicalloy/telegram-shell-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T19:01:35.863Z","updated_at":"2025-04-09T16:18:49.392Z","avatar_url":"https://github.com/vicalloy.png","language":"Python","readme":"\n# Telegram Shell Bot\n\nThis is a [Telegram](http://telegram.org) Bot to run shell commands.\n\n![](screenshot/main.jpeg)\n\n## Requirments\n\n- Python 3.8+\n- Poetry\n\n## Install\n1. Create a bot and get token from [BotFather bot](https://telegram.me/BotFather)\n1. Clone `Telegram Shell Bot`\n\n        git clone https://github.com/vicalloy/telegram-shell-bot.git\n\n1. Copy `settings.py.sample` to `settings.py` and config it.\n    - `TOKEN` Bot token generated by BotFather\n    - `ENABLED_USERS` Your telegram user id. Only enabled users can use this bot.\n        - `-999999` will disable authentication. Public bot is very danger for your server, dont's use root to run this bot. You must add settings `CMD_WHITE_LIST` or `ONLY_SHORTCUT_CMD=True`(recommend) for a public bot. \n    - `CMD_WHITE_LIST` Only command in `CMD_WHITE_LIST` can be execute. Let it empty if no restriction.\n    - `CMD_BLACK_LIST` Ignore command in `CMD_BLACK_LIST`.\n    - `CMD_BLACK_CHARS` Ignore command contain char in `CMD_BLACK_LIST`.\n    - `PROXY_URL` Proxy url.\n    - `SC_MENU_ITEM_ROWS` Command shortcut config.\n    - `ONLY_SHORTCUT_CMD` Run command by shortcut menu only. Other commands will be ignored.\n\n1. Create a virtual environment and install required packages\n\n        poetry install --only main\n        poetry shell\n\n## Run\n\n```\npoetry shell\npython bot.py\n```\n\n\n## Run with pm2\n\npm2 is one of the best tools today for server production and make your bot for remote online 24/7 hours\n\ninstall and doc for pm2 in https://pm2.keymetrics.io/\n\nstart bot with\n``` bash\npm2 start telegram-shell-bot.yml\npm2 save # save runing command\npm2 startup # for autostart on bot\n```\n\n## Usage\n\n1. Talk to the bot. Every message will be treated as a shell command.\n1. `/tasks` to show all running tasks\n1. `/kill` to kill a running task\n1. `/download` to download file from server. `ex: /download README.md`\n1. The file send to bot will upload to folder `./upload/` .\n1. `/sudo_login` to call sudo\n1. `/script` to run scripts in ./scripts directory\n1. The bot sends first 3sec's output for every command. You can add `oa` in command to send all output. E.g.:\n\n        oa;ping google.com\n        /script oa;demo.py\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicalloy%2Ftelegram-shell-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvicalloy%2Ftelegram-shell-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicalloy%2Ftelegram-shell-bot/lists"}