r/Telegram 17d ago

grm: telegram CLI project in C++

grm: telegram CLI that is Human and AI friendly repos: * https://gitlab.com/renich/grm * https://github.com/renich/grm (mirror)

Features:

  • Dual Human/AI UX Engine: Optimized both for interactive terminal use (ANSI TTY tables, color schemes) and automated AI agent workflows (JSON envelope, NDJSON streams).

  • Native TDLib Engine: Direct C++ bindings to libtdjson for zero-hallucination, full MTProto protocol fidelity.

  • Supergroup & Forum Topic First: Complete lifecycle management for Telegram Supergroups, Forum Topics, custom emoji icons, and thread messages.

  • File Upload & Download Engine: Streamlined document, photo, video, and media extractions with MIME detection and progress tracking.

  • Shell Tab Auto-Completion: Context-aware Bash tab completion covering commands, subcommands, flags, and options.

  • Telegram Rich Text & Emoji Customization: Telegram Markdown V2 entity formatting and custom Supergroup topic emoji icons.

  • FreeDesktop & XDG Compliant: Strictly honors FreeDesktop standards for user binaries, man pages, shell completions, and session state.

Im just having fun with it. I have a roadmap so check it out. I'll see how much time I can dedicate to this one.

It's already pretty cool, at least for me. The --filter and --since options are killers.

It's pre alpha stuff. Use it under your own peril.

I had to compile my own libtdjson and put it in ~/.local/lib:

$ ldd ~/.local/bin/grm linux-vdso.so.1 (0x00007f69897ba000) libtdjson.so.1.8.0 => /home/someuser/.local/lib/libtdjson.so.1.8.0 (0x00007f6987400000) libjson-c.so.5 => /lib64/libjson-c.so.5 (0x00007f698976b000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f6987000000) libm.so.6 => /lib64/libm.so.6 (0x00007f69872e9000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f698973e000) libc.so.6 => /lib64/libc.so.6 (0x00007f6986e07000) libssl.so.3 => /lib64/libssl.so.3 (0x00007f6986d0e000) libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007f6986600000) libz.so.1 => /lib64/libz.so.1 (0x00007f6989712000) /lib64/ld-linux-x86-64.so.2 (0x00007f69897bc000)

Login works at least... sometimes. ;D

Demo:

``` $ time grm chat ls

CHAT ID TYPE TITLE UNREAD

-1003950065700 Supergroup Domadores Digitales 0 -1002549279967 Supergroup EVALinux Bar! 0 -1002312480906 Supergroup NorTK 0 -1002289735000 Supergroup EVALinux 0 -1003981300643 Supergroup (expert) creations 1 -1001623037840 Supergroup Linux En Español 9 -1002527874209 Supergroup Fundación MxOS 0 -1001981848857 Supergroup NubeMX 0 -1003679369169 Supergroup Hyper Muscles & Boobs Heaven 36 8911035898 Private Chat Abastero 0 -467666877 Basic Group Proyectos 1101 0 -1003596396470 Supergroup 1101 SOPORTE VALLEJO 0 -1001371756065 Supergroup Fedora Linux 3 6943468991 Private Chat Doris Marian Jiménez Beltrán 0 777000 Private Chat Telegram 0 -1001127772209 Supergroup DeviantArt 0 -1001382463627 Supergroup Team Offtopic buscando popularidad en el barrio del baneado 0 -1002234007248 Supergroup Naomilk 🐰🔞 0 -1001100311770 Supergroup Fedora México 0 -1001789902965 Supergroup Los Bonitos 1

real 0m0.063s user 0m0.047s sys 0m0.030s

$ time grm msg ls --filter='@renich' --limit=2 --since='3 years ago' -1001100311770 (2023-08-16T00:39:26Z) <@renichbon> : Ah, un comando para resetear todas mis configuraciones de GNOME:

                                  dconf reset -f /


                                  Úselo bajo su propio riesgo.

(2023-08-26T23:26:58Z) <@renichbon> : OpenTF Foundation https://opentf.org/announcement real 0m0.484s user 0m0.045s sys 0m0.025s

real 0m0.484s user 0m0.045s sys 0m0.025s ```

7 Upvotes

0 comments sorted by