ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

node-telegram-cli

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

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/baontq23/telegram-cli
Or

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)

Metadata

Author@baontq23
Stars4473
Views1
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-baontq23-telegram-cli": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.