{
  "markdown": "# Gemini Telegram Extension\n\nThis extension provides a set of tools to interact with the Telegram Bot API directly from the Gemini CLI.\n\n## Features\n\n- Send messages\n- Read messages\n- Get bot information\n- Get chat information\n- Edit messages\n- Delete messages\n- Send photos\n- Send documents\n- Get chat administrators\n- Answer callback queries\n\n## Installation\n\nTo install the extension, run the following command in your Gemini CLI:\n\n```bash\n/extension install https://github.com/VSKurkin/gemini-cli-telegram-extension.git\n```\n\n**Note:** Your Gemini CLI must be configured to allow installing third-party extensions.\n\n## Configuration\n\nThis extension requires a Telegram Bot API token. You can provide it in one of two ways:\n\n1.  **Environment Variable (Recommended):**\n    Set the `TELEGRAM_BOT_TOKEN` environment variable in your system. This is the most secure and flexible method.\n\n    -   **Linux/macOS:**\n        ```bash\n        export TELEGRAM_BOT_TOKEN=\"your-bot-token\"\n        ```\n    -   **Windows:**\n        ```powershell\n        $env:TELEGRAM_BOT_TOKEN=\"your-bot-token\"\n        ```\n\n2.  **`.env` File:**\n    Create a file named `.env` in the directory where you run the `gemini` command. Add the following line to it:\n    ```\n    TELEGRAM_BOT_TOKEN=\"your-bot-token\"\n    ```\n\n## Usage\n\nTo use the tools provided by this extension, you need to make a tool call in your prompt. The Gemini CLI will execute the tool call and return the result.\n\n**Example 1: Send a message**\n\nTo send a message, make a tool call to `telegram:send_message` with the `chat_id` and `text` parameters.\n\n> telegram:send_message(chat_id=\"your-chat-id\", text=\"Hello from Gemini!\")\n\n**Example 2: Read new messages**\n\nTo read new messages, make a tool call to `telegram:read`.\n\n> telegram:read()\n\n**Example 3: Send a photo**\n\nTo send a photo, make a tool call to `telegram:send_photo`.\n\n> telegram:send_photo(chat_id=\"your-chat-id\", photo_path=\"/path/to/your/photo.jpg\")\n\n## Available Tools\n\nThis section provides a detailed description of each tool and its parameters.\n\n### `telegram:send_message`\n\nSends a text message.\n\n| Parameter | Type   | Description            |\n| :-------- | :----- | :--------------------- |\n| `chat_id` | string | Chat ID.               |\n| `text`    | string | The text of the message. |\n\n### `telegram:read`\n\nReads new messages.\n\n| Parameter | Type    | Description                       |\n| :-------- | :------ | :-------------------------------- |\n| `timeout` | integer | Timeout for waiting for updates.  |\n| `chat_id` | string  | Chat ID to filter messages from.  |\n| `offset`  | integer | Offset for get_updates.           |\n\n### `telegram:get_me`\n\nGets information about the bot. (No parameters)\n\n### `telegram:get_chat`\n\nGets information about a chat.\n\n| Parameter | Type   | Description |\n| :-------- | :----- | :---------- |\n| `chat_id` | string | Chat ID.    |\n\n### `telegram:edit_message_text`\n\nEdits a text message.\n\n| Parameter    | Type    | Description                   |\n| :----------- | :------ | :---------------------------- |\n| `chat_id`    | string  | Chat ID.                      |\n| `message_id` | integer | Message ID.                   |\n| `text`       | string  | The new text of the message. |\n\n### `telegram:delete_message`\n\nDeletes a message.\n\n| Parameter    | Type    | Description |\n| :----------- | :------ | :---------- |\n| `chat_id`    | string  | Chat ID.    |\n| `message_id` | integer | Message ID. |\n\n### `telegram:send_photo`\n\nSends a photo.\n\n| Parameter    | Type   | Description              |\n| :----------- | :----- | :----------------------- |\n| `chat_id`    | string | Chat ID.                 |\n| `photo_path` | string | Path to the photo file.  |\n| `caption`    | string | Caption for the photo.   |\n\n### `telegram:send_document`\n\nSends a document.\n\n| Parameter       | Type   | Description                |\n| :-------------- | :----- | :------------------------- |\n| `chat_id`       | string | Chat ID.                   |\n| `document_path` | string | Path to the document file. |\n| `caption`       | string | Caption for the document.  |\n\n### `telegram:get_chat_administrators`\n\nGets a list of chat administrators.\n\n| Parameter | Type   | Description |\n| :-------- | :----- | :---------- |\n| `chat_id` | string | Chat ID.    |\n\n### `telegram:answer_callback_query`\n\nAnswers a callback query.\n\n| Parameter           | Type   | Description              |\n| :------------------ | :----- | :----------------------- |\n| `callback_query_id` | string | Callback query ID.       |\n| `text`              | string | Text of the notification.|\n\n## Development\n\nTo set up the development environment, follow these steps:\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/VSKurkin/gemini-cli-telegram-extension.git\n    cd gemini-cli-telegram-extension\n    ```\n\n2.  **Create a virtual environment:**\n    ```bash\n    python -m venv .venv\n    source .venv/bin/activate\n    ```\n\n3.  **Install dependencies:**\n    ```bash\n    pip install -r requirements.txt\n    pip install ruff # Or add it to a requirements-dev.txt\n    ```\n\n### Running Tests\n\nTo run the tests, execute the following command from the root of the repository:\n\n```bash\npython -m unittest discover tests\n```\n\n### Linting\n\nTo lint the code, use `ruff`:\n\n```bash\nruff check .\n```\n\nTo format the code, use `ruff`:\n\n```bash\nruff format .\n```",
  "bytes": 5373,
  "sha": "7afff022a5f1d73da0f092d3a17ee163d013ce547bb91932f274c23babb97acd",
  "repo_slug": "vskurkin/gemini-cli-telegram-extension",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_vskurkin_gemini_cli_telegram_extension_59770574/readme"
}