Declarative Telegram group management. Define your group's topics, permissions, and description in TOML — then plan and apply changes like Terraform.
Uses Telegram Client API (MTProto) via grammers, not Bot API — can read forum topics, full permissions, and more.
- Get
api_idandapi_hashfrom https://my.telegram.org - Copy
telegram.example.tomltotelegram.tomland fill in credentials - First run will prompt for phone number + code (+ 2FA if enabled). Session persists in
tgctl.session.
# Validate config syntax
tgctl validate
# Import existing group state
tgctl import --chat -1003744795236 --name my-community
# Show what would change
tgctl plan
# Apply changes
tgctl apply
tgctl apply --auto-approve
# List custom emoji from a pack (for icon_emoji_id)
tgctl emoji list --pack <pack_short_name>
# Search custom emoji by emoticon
tgctl emoji search --query "📢"[provider]
api_id = 12345
api_hash = "your_api_hash"
[group."my-community"]
chat = "-1003744795236"
title = "My Community"
description = "A community for discussing things."
[group."my-community".permissions]
send_messages = true
send_media = true
send_stickers = true
send_gifs = true
send_polls = true
embed_links = true
invite_users = true
pin_messages = false
change_info = false
[[group."my-community".topic]]
title = "General"
closed = false
[[group."my-community".topic]]
title = "Announcements"
icon_emoji_id = 5368324170671202286
closed = false- Group title and description
- Default member permissions
- Forum topics (create/edit/close, matched by title)
- Custom emoji icons on topics (
icon_emoji_id)
Topics not in config are flagged for deletion in plan but not removed unless explicitly deleted.
cargo build --release