A terminal-based Telegram client built with Rust using the grammers library.
- 📱 MTProto protocol implementation (official Telegram API)
- 🖥️ Terminal User Interface (TUI) with ratatui
- 💾 SQLite session storage
- 🔐 Two-factor authentication support (WIP)
- 📜 Chat listing and message viewing
- ✉️ Message sending
Before using this client, you need to obtain API credentials from Telegram:
- Visit https://my.telegram.org/auth
- Log in with your phone number
- Go to "API development tools"
- Create a new application
- Note your API ID and API Hash
Make sure you have Rust installed. Visit https://rustup.rs/ or run:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh# Clone the repository
git clone <repository-url>
cd telecli
# Build the project
cargo build --release
# Binary will be at: target/release/telecliDownload pre-built binaries from the Releases page:
- Linux:
telecli-<version>-x86_64-unknown-linux-gnu.tar.gz(64-bit) - Linux ARM64:
telecli-<version>-aarch64-unknown-linux-gnu.tar.gz - macOS Intel:
telecli-<version>-x86_64-apple-darwin.tar.gz - macOS Apple Silicon:
telecli-<version>-aarch64-apple-darwin.tar.gz - Windows:
telecli-<version>-x86_64-pc-windows-msvc.zip
cargo install teleclicargo build --releaseThe project includes a helper script for cross-compilation:
# Install cross (required for cross-compilation)
cargo install cross
# Build for all supported targets
./scripts/build-release.sh
# Build for a specific target
./scripts/build-release.sh x86_64-unknown-linux-gnuSupported targets:
x86_64-unknown-linux-gnu- Linux 64-bitaarch64-unknown-linux-gnu- Linux ARM64x86_64-apple-darwin- macOS Intelaarch64-apple-darwin- macOS Apple Siliconx86_64-pc-windows-gnu- Windows 64-bit
Built binaries will be placed in the releases/ directory.
On first run, the application will create a configuration file at:
- Linux:
~/.config/telecli/config.toml - macOS:
~/Library/Application Support/telecli/config.toml - Windows:
%APPDATA%\telecli\config.toml
Edit the configuration file with your API credentials:
api_id = 123456 # Your API ID from my.telegram.org
api_hash = "your_api_hash_here"
session_path = null # null uses default location# Run the TUI interface
cargo run
# Run with verbose logging
RUST_LOG=debug cargo runq- Quit↑/k- Navigate up in chat list↓/j- Navigate down in chat listr- Refresh chats- Type to input messages (WIP)
telecli/
├── src/
│ ├── main.rs # Application entry point
│ ├── cli.rs # CLI argument parsing
│ ├── config.rs # Configuration management
│ ├── error.rs # Error types
│ ├── telegram.rs # Telegram client wrapper
│ └── tui.rs # Terminal UI implementation
├── Cargo.toml # Dependencies and project metadata
└── README.md # This file
- grammers-client - High-level Telegram MTProto client
- grammers-session - Session storage (SQLite)
- tokio - Async runtime
- ratatui - Terminal UI framework
- crossterm - Cross-platform terminal manipulation
- clap - Command-line argument parsing
# Run in debug mode
cargo run
# Run with logging
RUST_LOG=telecli=debug cargo run
# Build release
cargo build --release
# Run tests
cargo testThis is a work-in-progress project. Current limitations include:
- Two-factor authentication flow needs improvement
- Message input/sending in TUI is incomplete
- No media file support yet
- Limited error handling for edge cases
MIT License