Telegram cli

v1.0.5

CLI tool for Telegram via MTProto. Send/read messages, manage groups, search conversations, download media, and automate Telegram workflows. Use when the tas...

0· 217·1 current·1 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for baontq23/telegram-cli.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Telegram cli" (baontq23/telegram-cli) from ClawHub.
Skill page: https://clawhub.ai/baontq23/telegram-cli
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install telegram-cli

ClawHub CLI

Package manager switcher

npx clawhub@latest install telegram-cli
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description match the SKILL.md: it documents the node-telegram-cli npm package and CLI commands for reading/sending messages, managing groups, and downloading media. No unrelated binaries, cloud credentials, or unexpected capabilities are requested.
Instruction Scope
The instructions stay within scope: they instruct installing the npm package, running an interactive login (phone + OTP), and using CLI commands (read/write) with a required --json flag for automation. Notes of interest: session persistence is documented and downloaded media are stored in ~/.telegram-cli/downloads/. The SKILL.md does not instruct reading unrelated system files or exfiltrating data to external endpoints.
Install Mechanism
No install spec in the skill bundle (instruction-only). The SKILL.md recommends installing from npm (npm install -g node-telegram-cli) and references the package and GitHub repo — a standard, traceable public registry installation path.
Credentials
The skill declares no required environment variables or external credentials beyond the Telegram account login (phone + OTP). It states credentials are stored in the OS keychain, which is proportional for a user-level client.
Persistence & Privilege
The skill does not request always:true and is user-invocable. It documents persistent session behavior (session stays logged in until ntg logout) and a local download directory; these are ordinary for a CLI that manages an account, but users should be aware of the persistent session and where files are saved.
Assessment
This skill appears consistent with being a helper for the node-telegram-cli npm package, but before installing consider: (1) you will need to provide your Telegram phone number and OTP — this grants the CLI access to your account, so only use it if you trust the package and owner; (2) verify the npm package and GitHub repo are genuine and actively maintained (check publisher, recent commits, and issues); (3) downloaded media are saved to ~/.telegram-cli/downloads/ — review and clean that directory if needed; (4) the tool can send messages and manage groups, so be careful when automating actions (limit automation scope and confirm commands before running); (5) the CLI stores session data in the OS keychain — ensure you are comfortable with that storage and revoke sessions from Telegram if you suspect misuse. If you need higher assurance, inspect the npm package source locally before installing or run it in an isolated environment.

Like a lobster shell, security has layers — review code before you run it.

latestvk97dzdrsd4xt2fmhscnmppqc8x83e07q
217downloads
0stars
6versions
Updated 1mo ago
v1.0.5
MIT-0

Source & Trust

  1. Repository: https://github.com/baontq23/node-telegram-cli
  2. npm: https://www.npmjs.com/package/node-telegram-cli (published with provenance)
  3. Credentials are stored securely via OS Keychain (macOS Keychain / Windows Credential Manager / Linux Secret Service), not in plaintext files

Installation

  1. Requires Node.js >= 20
  2. Install globally: npm install -g node-telegram-cli
  3. Verify: ntg --version
  4. Run ntg login once — interactive, requires phone number + OTP code from Telegram

Critical Rule: Always Use JSON Mode

  1. Add --json flag to every command for machine-readable output
  2. --json is a global flag — place it before or after the subcommand
  3. Example: ntg --json inbox, ntg --json search @user "keyword"

Peer Format

  1. @username — most reliable, e.g. @johndoe
  2. Phone number — for contacts without username, e.g. +84901234567
  3. me — your own Saved Messages
  4. Chat title — group/channel name in quotes, e.g. "My Group"

Read Commands (No Side Effects)

  1. ntg --json inbox — list recent conversations
  2. ntg --json inbox --unread — only unread conversations
  3. ntg --json inbox --private — only private 1-on-1 chats
  4. ntg --json inbox --unread --private — combine filters
  5. ntg --json inbox --chat <peer> --limit <n> — messages from a specific chat
  6. ntg --json search <peer> "keyword" — search in a specific chat
  7. ntg --json global-search "keyword" — search across all chats
  8. ntg --json chat-info <chat> — show group/channel info

Write Commands (Has Side Effects)

  1. ntg msg <peer> "text" — send a text message
  2. ntg msg <peer> "text" --silent — send silently (no notification sound)
  3. ntg fwd <user> <msgId> — forward a message by ID
  4. ntg mark-read <peer> — mark all messages as read
  5. ntg delete-msg <msgId> — delete a message
  6. ntg send-photo <peer> <file> — send a photo
  7. ntg send-video <peer> <file> — send a video
  8. ntg send-file <peer> <file> — send a text file as plain messages
  9. ntg download <msgId> --chat <peer> — download media from a message
  10. ntg download <msgId> --chat <peer> --type <type> — specify media type (photo, video, audio, doc)
  11. ntg view <msgId> --chat <peer> — download and open with system viewer
  12. ntg clean-downloads — delete all downloaded media files

Group Management

  1. ntg create-group "Topic" @user1 @user2 — create a new group
  2. ntg chat-add <chat> <user> — add a user to a group
  3. ntg chat-kick <chat> <user> — remove a user from a group
  4. ntg chat-rename <chat> "New Name" — rename a group
  5. ntg chat-set-photo <chat> <file> — set group photo

Contact Management

  1. ntg add-contact <phone> <firstName> <lastName> — add a contact
  2. ntg rename-contact <user> <firstName> <lastName> — rename a contact

JSON Output Schemas

Inbox (conversation list)

  1. name — contact/chat display name
  2. peer — identifier to use as <peer> argument
  3. peerType — "username" | "phone" | "id"
  4. type — "user" | "group" | "channel"
  5. unreadCount — number of unread messages
  6. lastMessage — text/caption (empty string if media-only)
  7. lastMessageId — use with ntg download <id> for media
  8. mediaType — "photo" | "video" | "document" | "audio" | "voice" | "sticker" | "location" | "contact" | "poll" | null
  9. date — ISO 8601 timestamp

Chat messages (inbox --chat)

  1. id — message ID
  2. date — ISO 8601 timestamp
  3. sender — sender display name
  4. text — message text/caption
  5. mediaType — same values as above
  6. isOutgoing — true if sent by you

Error Handling

  1. Exit code 0 = success
  2. Exit code 1 = error (not logged in, peer not found, etc.)
  3. If not logged in, commands fail with: "Not logged in. Run ntg login first."

Important Notes

  1. Do NOT use ntg chat <peer> — it is interactive, blocks stdin, not suitable for automation
  2. Session persists until ntg logout is called — no re-login needed between commands
  3. Downloaded files are saved to ~/.telegram-cli/downloads/
  4. Always specify --chat <peer> when downloading media to identify the source chat

Comments

Loading comments...