jpskill.com
📦 その他 コミュニティ

telegram-cli

Telegramアカウントを認証し、会話履歴の確認やメッセージ取得をコマンドラインから実行できる、情報収集や自動化に役立つSkill。

📜 元の英語説明(参考)

Use `tele` to authenticate, list dialogs, and fetch messages from Telegram.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Telegramアカウントを認証し、会話履歴の確認やメッセージ取得をコマンドラインから実行できる、情報収集や自動化に役立つSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o telegram-cli.zip https://jpskill.com/download/10043.zip && unzip -o telegram-cli.zip && rm telegram-cli.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/10043.zip -OutFile "$d\telegram-cli.zip"; Expand-Archive "$d\telegram-cli.zip" -DestinationPath $d -Force; ri "$d\telegram-cli.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して telegram-cli.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → telegram-cli フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Telegram CLI 利用ガイド

概要

tele を使用して、ターミナルから直接 Telegram の認証、ダイアログの一覧表示、メッセージの取得を行います。

セットアップ

  • uv が必要です。
  • インストール/アップグレード (セッションごとに一度): uv tool install --upgrade git+https://github.com/AFutureD/tele-cli
  • インストール確認: tele -V
  • ターミナルセッションごと: tele -h を一度実行し、tele -f json me で認証を確認します (必要に応じてログイン)。

注意事項

  • セッションで初めてコマンドを実行する前に、tele -h を一度呼び出してください。
  • 常に JSON 出力を使用してください: 常に -f jsontele に渡してください (例: tele -f json me)。
  • 各セッションで、認証されていないコマンドを実行する前に認証を確認してください: tele -f json me を実行します。
  • tele auth ... の下のコマンドは、既存の認証済みセッションを必要としません。

クイックスタート

  1. ヘルプを一度読む: tele -h
  2. ログイン (インタラクティブなプロンプト): tele auth login
  3. 自分の身元を確認する: tele -f json me
  4. ダイアログを一覧表示し、dialog_id を見つける: tele -f json dialog list
  5. ダイアログから最近のメッセージを取得する:
    • tele -f json message list <dialog_id> -n 20

セッション管理

グローバルオプション:

  • --config <path>: 代替コンフィグファイル (デフォルト: ~/.config/tele/config.toml)
  • --session <name>: 名前で特定のセッションファイルを使用する ( tele auth list で一覧表示)

ログイン/ログアウト:

  • tele auth login (ローカルセッションを作成します。電話番号、コード、およびオプションの 2FA パスワードを求められます)
  • tele auth login --switch (ログインし、新しいセッションをアクティブにします)
  • tele auth logout (選択されたセッションからログアウトします)

セッションの一覧表示と切り替え:

  • tele auth list
  • tele auth switch --uid <user_id>
  • tele auth switch --username <username> ( @alice または alice を受け入れます)
  • tele auth switch --session <session_name>

セッションがディスク上に存在する場所 (macOS/Linux のデフォルト):

  • セッションフォルダ: ~/.config/tele/sessions/
  • 現在アクティブなセッションのシンボリックリンク: ~/.config/tele/sessions/Current.session

ダイアログリスト

すべてのダイアログ (ユーザー、グループ、チャンネル) を一覧表示します。

  • tele -f json dialog list

注:

  • -f text の場合、出力は次のテンプレートに従います。
    • [TYPE.UI.STATE] [UNREAD COUNT] [DIALOG_ID] NAME
    • TYPE: U ユーザー、 G グループ、 C チャンネル
    • UI: P ピン留め、 A アーカイブ、 - 通常
    • STATE: M ミュート、 - ミュートされていない
  • -f json の場合、各ダイアログには、nameentity ( id 付き)、unread_count、および最新の message などのキーが含まれます。

メッセージリスト

ダイアログからメッセージを取得します。

  • tele -f json message list <dialog_id>

共通オプション:

  • 件数制限: -n <num> (例: tele -f json message list <dialog_id> -n 20)
  • ページネーション: --offset_id <message_id> (既知のメッセージ ID の周辺/より古いものを取得します。offset_id は除外されます)
  • 出力順序: --order asc|desc
  • 時間フィルター:
    • --from "<自然言語または日付>"
    • --to "<自然言語または日付>"
    • --range "<自然言語範囲>" ( --from/--to をオーバーライド、特殊: "this week")

例:

  • tele -f json message list 1375282077 -n 10
  • tele -f json message list 1375282077 --range "last week"
  • tele -f json message list 1375282077 --from "2025-02-05" --to "yesterday"

メッセージ送信

ユーザー、グループ、またはチャンネルにテキストメッセージを送信します。

  • 基本: tele message send <receiver> "<message>"
  • ピア ID を強制する: tele message send -t peer_id "<peer_id>" "<message>"

受信者の形式:

  • ユーザー名: alice または @alice
  • 電話番号: "+15551234567"
  • ダイアログ名: "My Group"
  • 数値ピア ID: "-1001234567890" (チャンネルで一般的)

受信者の解決方法:

  • --entity/-t peer_id を使用すると、<receiver> は数値ピア ID として扱われます (名前のマッチングはありません)。
  • --entity を使用しない場合、最初に Telegram/Telethon の解決 (ユーザー名/電話番号/ID) を試みます。それが失敗した場合、ダイアログをスキャンし、次の条件で最初の一致を選択します。
    • ダイアログ名に <receiver> が含まれている (大文字と小文字を区別しない)、または
    • ダイアログ ID / エンティティ ID が <receiver> と等しい (文字列比較)。

例:

  • tele message send alice "hi"
  • tele message send "+15551234567" "hi"
  • tele message send "My Group" "hi"
  • tele message send -t peer_id "-1001234567890" "hi"

注:

  • シェル/CLI が負のピア ID をオプションとして扱わないように、引用符で囲むか (または -- を使用)。
  • コマンドは成功時に出力を表示しません。メッセージを一覧表示して確認してください: tele -f json message list <dialog_id> -n 5

追加情報

  • コンフィグファイル: tele はデフォルトで ~/.config/tele/config.toml を読み込み、初回実行時に作成します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Telegram CLI Usage Guide

Overview

Use tele to authenticate, list dialogs, and fetch messages from Telegram directly from the terminal.

Setup

  • Requires uv.
  • Install/upgrade (one-time per session): uv tool install --upgrade git+https://github.com/AFutureD/tele-cli
  • Verify install: tele -V
  • Per terminal session: run tele -h once, then confirm auth with tele -f json me (log in if needed).

Notice

  • Call tele -h once before running any command for the first time in the session.
  • Always use JSON output: always pass -f json to tele (example: tele -f json me).
  • In each session, confirm authentication before running non-auth commands: run tele -f json me.
  • Commands under tele auth ... do not require an existing authenticated session.

Quick Start

  1. Read help once: tele -h
  2. Log in (interactive prompts): tele auth login
  3. Confirm who you are: tele -f json me
  4. List dialogs and find a dialog_id: tele -f json dialog list
  5. Fetch recent messages from a dialog:
    • tele -f json message list <dialog_id> -n 20

Session Management

Global options:

  • --config <path>: alternate config file (default: ~/.config/tele/config.toml)
  • --session <name>: use a specific session file by name (listed by tele auth list)

Login / logout:

  • tele auth login (creates a local session; prompts for phone, code, and optional 2FA password)
  • tele auth login --switch (log in and make the new session active)
  • tele auth logout (logs out of the selected session)

List and switch sessions:

  • tele auth list
  • tele auth switch --uid <user_id>
  • tele auth switch --username <username> (accepts @alice or alice)
  • tele auth switch --session <session_name>

Where sessions live on disk (macOS/Linux default):

  • Sessions folder: ~/.config/tele/sessions/
  • Current activated session symlink: ~/.config/tele/sessions/Current.session

Dialog List

List all dialogs (users, groups, channels):

  • tele -f json dialog list

Notes:

  • For -f text, the output follows the template:
    • [TYPE.UI.STATE] [UNREAD COUNT] [DIALOG_ID] NAME
    • TYPE: U user, G group, C channel
    • UI: P pinned, A archived, - normal
    • STATE: M muted, - not muted
  • For -f json, each dialog includes keys like name, entity (with id), unread_count, and the latest message.

Message List

Fetch messages from a dialog:

  • tele -f json message list <dialog_id>

Common options:

  • Limit count: -n <num> (example: tele -f json message list <dialog_id> -n 20)
  • Pagination: --offset_id <message_id> (fetch around/older than a known message id; offset_id is excluded)
  • Output order: --order asc|desc
  • Time filters:
    • --from "<natural language or date>"
    • --to "<natural language or date>"
    • --range "<natural language range>" (overrides --from/--to, special: "this week")

Examples:

  • tele -f json message list 1375282077 -n 10
  • tele -f json message list 1375282077 --range "last week"
  • tele -f json message list 1375282077 --from "2025-02-05" --to "yesterday"

Send Message

Send a text message to a user, group, or channel:

  • Basic: tele message send <receiver> "<message>"
  • Force peer id: tele message send -t peer_id "<peer_id>" "<message>"

Receiver formats:

  • Username: alice or @alice
  • Phone: "+15551234567"
  • Dialog name: "My Group"
  • Numeric peer id: "-1001234567890" (common for channels)

How the receiver is resolved:

  • With --entity/-t peer_id, <receiver> is treated as a numeric peer id (no name matching).
  • Without --entity, it first tries Telegram/Telethon resolution (username/phone/id). If that fails, it scans your dialogs and picks the first match by:
    • dialog name contains <receiver> (case-insensitive), or
    • dialog id / entity id equals <receiver> (string compare).

Examples:

  • tele message send alice "hi"
  • tele message send "+15551234567" "hi"
  • tele message send "My Group" "hi"
  • tele message send -t peer_id "-1001234567890" "hi"

Notes:

  • Quote negative peer ids (or use --) so the shell/CLI does not treat them as options.
  • The command prints no output on success; verify by listing messages: tele -f json message list <dialog_id> -n 5.

Additional Informations

  • Config file: tele reads ~/.config/tele/config.toml by default and will create it on first run;