telminal
A Terminal in Telegram!
There is a lovely messenger in the world that has so many features that we can manage our Linux server with those features.
What is this?
Telminal is a Python package that helps you have your own server assistant Telegram bot. You can use Telminal as a terminal or to download & upload files.
Telminal features
- HTML and image output
- Process state info
- Interactive command support
- Download from server
- Upload to server
- Multi user
- Tasks
Getting Started
Prerequisites
You need telegram developer API and a bot token
API ID API hash
Bot token
Very fast and easy you can have those, just follow this two official links.
Installation
pip install telminal
Setup
Run telminal command after installation finished. Telminal needs those Telegram tokens for first run.
Also you can create a config.json file inside the package directory in this format:
{
"api_id": 1234,
"api_hash": "abcs",
"token": "efgh",
"admins": [8888, 9999]
}
⚠️ First admin can manage other admins, so order of admins list matter.
In this sample config 8888 must be your Telegram user ID.
Interactive Mode
You can activate this mode for last running process by sending /interactive_mode or by clicking on Interactive mode button of each process.
In interactive mode you are talking to the process and each message means an input for that process.
Also a two characters message starts with ^ has own meaning and behave like a control command so ^c means CTRL + C.
To return to normal mode and creating a new process just use /normal_mode or Exit interactive mode button.
Optional image output
Image creation for process result is optimized and will be okay on a server with minimum resources.
However, creating an image on the server is an expensive process. so if you want to run multiple commands at once or have a process that does not require image output, I strongly recommend using the text version by sending \image_off command.
Download file from server
You can save any file (up to 2GB) of your server on telegram.
There are two ways to do this :
- Inline query
- !get command
Inline query just works for current directory and runs a ls -la | grep <your_query> in background.
With !get command you can specify path of a file manually.
Also you have a nice progress bar when you are downloading or uploading a heavy file.😎
Upload file to server
Upload a file on your server just by sending to Telminal chat.
that file can be in telegram or on your hard disk.
Multi admin in group
Fortunately, all features can be used in a group too. by default, Telminal only responds to your commands.
!trust and !untrust are two commands that manage a user permission.
just reply to one of the user's messages with these commands.
Tasks
At this moment there is only one type of task.
A watcher task downloads a file periodically. write your first watcher in the following format:
!watch <number><s,m,h> <file_path>
Some real examples :
1️⃣ get telminal.log every 50 seconds
👉 !watch 50s telminal.log
2️⃣ get temp.png every 5 minutes
👉 !watch 5m home/temp.png
3️⃣ get sql.dump every 24 hours
👉 !watch 24h /backups/sql.dump
Finally set Telminal commands in Botfather using this text.
image_off - Just text output image_on - Text and image output tasks - List of active tasks interacive_mode - Interact with last process normal_mode - Process creation mode
Thanks
Metadata
Release files for telminal 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| telminal-1.0.1.tar.gz | 15.3 kB | Without provenance | Details for telminal-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| telminal-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for telminal-1.0.1-py3-none-any.whl |
Total release size: 30.2 kB
Release files / telminal-1.0.1.tar.gz
| Download URL | telminal-1.0.1.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d4d46e1d1faa5af03ef08589c65fabc8cad68bb7933de3dc11796e0e1f94f41
|
|
BLAKE2b-256 checksum How to use checksums |
18c528e2d80a5daa300f03c3573339c22d22f1b7200c2a4bc6eafcbb9f993b5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / telminal-1.0.1-py3-none-any.whl
| Download URL | telminal-1.0.1-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad4b706925672bbd77a20b41c54647dce3d3d11aa30ed2aa3faa84dcb4dcece7
|
|
BLAKE2b-256 checksum How to use checksums |
1d2b64992fe142d5ae1aef7b3934591ecb7f2d31def8753a0221e218f23dba7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for telminal 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.