PELEC is a desktop messaging workspace built with Electron, Vite, TypeScript, and Bun. It combines a native Telegram connector powered by TDLib with an Instagram experience that can run in native mode when session capability is available and otherwise falls back to the embedded web inbox.
The project is optimized for keyboard-first use. The renderer exposes a modal, Vim-like navigation model for switching networks, browsing chats, reading message history, replying, and triggering auth or refresh actions without leaving the keyboard.
- Runs Telegram through a native TDLib connector instead of a plain web wrapper
- Loads Instagram DMs through a native connector when possible, with embedded web fallback when native capability is unavailable
- Keeps per-network Electron partitions so Telegram and Instagram sessions stay isolated
- Supports Telegram chat browsing, message history, reply flows, forwarding, deletion, image sending, document resolution, and audio playback hooks
- Supports Instagram chat browsing, message history, and message sending in native mode
- Exposes desktop notifications and some Linux-specific clipboard integration for copied files
Development commands are Bun-based and work through Electron Forge. Packaging exists for multiple Electron Forge makers, but the repository is currently most complete for Linux:
- Linux AppImage creation is explicitly supported through
bun run appimage - The packaged Telegram native runtime bundles
libtdjson.sofor Linux x64 - If you develop on another platform, expect to verify the Telegram native runtime yourself before relying on packaged builds
- Electron Forge with the Vite plugin
- TypeScript for main, preload, and renderer processes
- Bun for dependency management and project scripts
- TDLib via
tdlandprebuilt-tdlibfor Telegram instagram-private-apifor Instagram native connector flows
- Bun
1.3.3or newer - A desktop Linux environment if you want the documented packaging flow
- Telegram API credentials if you do not want to rely on the repository defaults
Install Bun if needed:
curl -fsSL https://bun.sh/install | bashInstall dependencies from the project root:
bun installPELEC now reads a user config file on startup at:
- Linux:
$XDG_CONFIG_HOME/pelec/config.tomlor~/.config/pelec/config.toml - macOS:
~/Library/Application Support/pelec/config.toml - Windows:
%APPDATA%\\pelec\\config.toml
The file is created automatically on first launch. Current keys:
[telegram]
ghost_mode = false
[appearance]
window_padding = 12
window_border_radius = 0
font_family = "Ioskeley Mono, Iosevka Mono, Iosevka, JetBrains Mono, IBM Plex Mono, Fira Code, Consolas, monospace"
font_size = 14
background_opacity = 0.92
text_opacity = 1.0Notes:
- Restart the app after editing
config.toml ghost_mode = truekeeps Telegram chat reads in a best-effort “do not mark seen” mode by avoiding chat-open watcher callswindow_paddingis clamped to0..64window_border_radiusis clamped to0..64font_sizeis clamped to10..28background_opacityandtext_opacityare clamped to0..1
PELEC also reads environment variables from .env if present. The main variables are:
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hashNotes:
- The app currently falls back to bundled Telegram API values when these variables are missing
- For production or personal use, set your own Telegram credentials instead of relying on defaults
.envis loaded from the repository root in development and from nearby packaged locations when bundled
Start the development app:
bun run startClean generated artifacts and start again:
bun run rebuild:startLint the codebase:
bun run lintRun the renderer/unit test suite:
bun testPackage the Electron application with Electron Forge:
bun run packageRun the full Forge make pipeline:
bun run makeBuild a Linux AppImage from the latest packaged output:
bun run appimageForce a fresh Linux package before creating the AppImage:
bun run appimage:freshPublish through Electron Forge:
bun run publish- Uses TDLib in native mode
- Supports QR-based login
- Supports 2FA password completion when Telegram requires it
- Requires valid
TELEGRAM_API_IDandTELEGRAM_API_HASHfor a clean setup
- Tries to detect whether native DM capability is already available
- Falls back to embedded web login when native capability is not ready
- Can accept username/password for native login
- Can continue through 2FA or challenge-code flows
- Can reset native auth state from inside the app command set
PELEC is designed around a normal/insert mode split.
Common shortcuts:
j/k: move selectionh/l: move between panesEnter: activate the selected network or chati: enter insert modeEscape: return to normal mode or close transient UI/: focus the network filter:: open the command palettegg/G: jump to top or bottomCtrl+u/Ctrl+d: page movementa: start auth for the active networkr: refresh, or reply when focused on Telegram messagesd: delete the selected Telegram messageo: open the active network URL in the external browserAlt+1: switch to TelegramAlt+2: switch to InstagramCtrl+[orCmd+[on macOS: force normal mode globally
The command palette includes actions such as network switching, auth, connector refresh, Instagram auth reset, opening the active web URL, and sending a test notification.
src/
main.ts Thin Electron entrypoint
preload.ts Safe renderer bridge
renderer/ React entrypoint, legacy host, and renderer utilities/tests
main/ Main-process bootstrap, IPC, window, protocol, and helpers
main/connectors/ Telegram and Instagram connector implementations
shared/ Cross-process types
scripts/
run-forge.js Bun wrapper for Electron Forge
rebuild-start.js Clean rebuild helper
build-appimage.js Linux AppImage builder
forge.config.ts Electron Forge configuration
- Normal project workflows use Bun; system
npmis not required for day-to-day work - The repository includes an
npmshim because Electron Forge expects an npm-compatible version check during some flows - Telegram runtime modules are loaded from unpacked packaged resources or
node_modules, depending on whether the app is running bundled or in development - Linux desktop notifications rely on the local notification daemon; file-copy integration prefers
wl-copyon Wayland andxclipon X11 when available
MIT