Focused Telegram is a terminal-based Telegram client focused on a small, deliberate workflow:
- choose which chats or folders you care about
- keep those chats in a clean whitelist
- read and send messages without leaving the terminal
- edit or delete your last sent message
- react to messages
- open links quickly
- download and open shared documents
This README is written as a user guide for someone using the app from scratch.
This app does not try to mirror every Telegram feature.
Instead, it gives you a focused command-line interface for:
- logging into Telegram with your own account
- choosing a whitelist of chats and folders
- browsing only those whitelisted chats
- composing messages from the keyboard
- editing or deleting your most recent outgoing message in the current chat
- opening links from messages
- downloading and opening document files from messages
- keeping a saved default download directory
You need:
- Node.js
- npm
- a Telegram account
- a Telegram API ID and API hash
Run:
npm installCreate a .env file in the project root with:
API_ID=your_telegram_api_id
API_HASH=your_telegram_api_hashYou get these values from Telegram's developer portal for your account/app. Get it from here
For development:
npm run devFor a compiled build:
npm run build
npm startWhen the app starts for the first time, it connects to Telegram and asks for login details in the terminal.
You will be prompted for:
- your phone number
- the login code sent by Telegram
- your 2FA password, if your account uses one
After successful login:
- the Telegram session is saved locally
- next launches reuse that saved session
- you will not need to log in again unless you log out
Session data is stored in the local session/ area used by the app.
After login, the app loads chats and folders and opens the setup screen if you do not yet have a whitelist.
The setup screen has two jobs:
- choose which chats/folders go into your whitelist
- choose the default directory where downloaded files should be saved
j/Down Arrow: move downk/Up Arrow: move upSpace: select or unselect the highlighted chat/folderp: edit the default download directoryEnter: save setup and continue into the main appq: quit
You can whitelist:
- individual chats
- groups
- channels
- folders
If you whitelist a folder, the chats explicitly included by that folder become visible in the main screen.
Press p in setup to edit the default download directory.
While editing the path:
- type normally to change the path
Backspacedeletes charactersEntersaves the pathEsccancels path editing
The chosen directory is stored in config.json and reused later for document downloads.
After setup, the app opens the main screen.
The screen is organized into three main areas:
This is the left pane.
It shows only the chats currently available through your whitelist.
Each chat line may show:
- an active indicator for the currently opened chat
- a new-message marker if the chat has fresh activity
This is the main reading area.
It shows messages from the currently active chat.
The selected message is highlighted, and some message types expose extra actions:
- documents show file info
- link messages show a link action
This is the message entry area below the message list.
It shows:
- normal compose mode
- edit mode when editing your last outgoing message
- wrapped multi-line draft text
The app has pane-based navigation.
The focus can be on:
- chats
- messages
- composer
Tab: switch between chats and messagesi: move into the composer if the chat allows sendingEsc: leave the composer and return to messages
When the focus is in the chats pane:
j/Down Arrow: move downk/Up Arrow: move upEnter: open the highlighted chat
Opening a chat:
- loads recent messages
- marks that chat as active
- refreshes send capability for that chat
When the focus is in the messages pane:
j/Down Arrow: move downk/Up Arrow: move up
The selected message matters because several actions operate on the highlighted message.
Press i to enter composer mode.
While in composer mode:
- type normally to write a message
- long drafts wrap instead of truncating
Backspacedeletes the last characterEntersends the messageEscexits the composer without sending
If you type the literal text \n, the app converts it into a real newline inside the draft.
That means:
- typing
hello\nworld
becomes:
hello
world
inside the composer before sending.
In the main screen:
- press
e
The app finds your most recent outgoing message in the active chat and places its contents into the composer.
While editing:
- the composer label changes to edit mode
Entersaves the editEsccancels edit mode
Important:
- this edits your last outgoing message in the current chat
- it does not edit arbitrary old messages
In the main screen:
- press
x
The app finds your most recent outgoing message in the current chat and deletes it.
After deletion:
- the message list refreshes
- a status message confirms the deletion
To react to the selected message:
- move focus to the messages pane
- highlight a message
- press
r
The quick reaction picker appears.
Then press:
1for👍2for❤️3for🔥4for✅
The picker closes after input.
The app already refreshes in the background, but you can also force a refresh manually.
Shift+R: refresh dialogs and reload the active chat
This is useful if you want an immediate sync without waiting for the background refresh cycle.
From the main screen:
- press
a
This opens the add-to-whitelist modal.
Only chats/folders that are not already whitelisted appear there.
j/Down Arrow: move downk/Up Arrow: move upSpace: select or unselect the highlighted item/: enter search modeEnter: add all selected itemsEsc: cancel
This modal supports search because the full list can be large.
To search:
- press
/ - type your search text
Backspaceedits the queryEnterorEscexits search mode
Search filters the available add list by:
- item name
- item type
- username when available
You can still keep multiple items selected while changing the search, because the app tracks selections by item ID, not by visible row.
From the chats pane:
- highlight a visible chat
- press
d
The app behaves intelligently:
- if the selected chat was directly whitelisted, that chat is removed
- if the selected chat only appears because of a whitelisted folder, the source folder is removed from the whitelist
So you do not need a separate folder-removal command.
If a message contains a link, the app exposes link-opening support.
When a link message is selected:
- a
Link:line appears below the panes - in some terminals, that line is clickable directly
oopens the selected link in your default browser
True mouse-click support depends on your terminal emulator.
Some terminals support clickable OSC 8 hyperlinks. Some do not.
So the reliable workflow is:
- move to the link message
- press
o
When a document-like message is selected, the app shows file information such as:
- file name
- file size
- whether it has already been downloaded
When a document message is selected:
- press
f
The file is saved under your configured download directory.
The actual path format is:
<download-directory>/<chat-name>/<message-id>-<file-name>
This keeps files organized by chat and avoids collisions.
When a document message is selected:
- press
o
If the file was already downloaded:
- the app opens it with the system default application
If it was not downloaded yet:
- the app downloads it first
- then opens it
The default download directory is chosen during setup with p.
That path is saved in config.json.
Some chats, groups, or channels may not allow posting.
When the active chat is read-only:
- the composer area indicates that sending is not allowed
- pressing
iwill not enter normal compose mode for sending - the status line explains why sending is blocked
To log out:
- press
l
A confirmation modal appears.
Then:
- press
yto confirm logout - press
norEscto cancel
Logging out:
- clears the saved Telegram session
- keeps your config file behavior intact
- exits the app
The next app start will require Telegram login again.
To quit the app immediately:
- press
q
This exits the program.
The app saves local state in a few places:
-
config.jsonStores:- whitelist entries
- default download directory
-
session/session.stringStores:- Telegram login session
-
your chosen download directory Stores:
- downloaded documents grouped by chat
A normal session often looks like this:
- Start the app with
npm run dev. - Log into Telegram if needed.
- In setup, select important chats/folders.
- Press
pand set your download directory. - Press
Enterto save setup. - In the main screen, use
j/kto choose a chat andEnterto open it. - Use
Tabto move into messages. - Press
ito compose, type your message, thenEnterto send. - If you made a mistake, press
eto edit your last sent message. - If needed, press
xto delete your last sent message. - If a message has a link, select it and press
o. - If a message has a document, press
fto download oroto open it. - Press
ato add more chats/folders to the whitelist later. - Inside the add modal, press
/to search and then usej/kto move. - Press
don a chat in the chat pane to remove either that chat or its source folder from the whitelist.
q: quitl: logoutShift+R: refresh chats and current messages
Tab: switch chats/messagesi: enter composerEsc: leave composer
j/Down Arrow: move downk/Up Arrow: move upEnter: open selected chatd: remove selected direct chat or its source folder from whitelist
j/Down Arrow: move downk/Up Arrow: move upr: react to selected messageo: open selected link or selected documentf: download selected document
- type: write draft
\n: insert a real newline into the draftBackspace: delete one characterEnter: send or save editEsc: exit composer
e: edit your last outgoing message in the active chatx: delete your last outgoing message in the active chat
j/Down Arrow: move downk/Up Arrow: move upSpace: select/unselect whitelist itemp: edit download directoryEnter: save setupq: quit
j/Down Arrow: move downk/Up Arrow: move upSpace: select/unselect item/: enter search modeEnter: add selected itemsEsc: cancel
The chat may be read-only, a broadcast channel, or a place where your account lacks permission.
Check the status line and read-only message shown by the app.
Your terminal may not support clickable terminal hyperlinks.
Use:
- move to the link message
- press
o
Check the saved downloadDirectory in config.json.
Files are stored under:
<downloadDirectory>/<chat-name>/<message-id>-<file-name>
Right now, the main built-in place to set it is setup with p.
If your config already exists, you can also edit config.json directly.
Useful commands:
npm run devnpm run build./node_modules/.bin/tsc --pretty false --noEmit