You can now access most of your Android phone's files from the Linux Terminal app, starting in Android 16 QPR2.
F-Droid has been around for about 15 years and is the largest source of free and open source software (FOSS) for Android.
Before getting started with telegram-files, you should apply a telegram api id and hash. You can apply for it on the Telegram API page.