I made telegram-sync-cli, a Telegram command line for you and your agents. It keeps a local cache of your chats and gives you the full Telegram API.
It logs into your own Telegram account through MTProto, not a bot, with your API ID and hash from my.telegram.org. Then tg keeps chats, contacts, users and messages in a local SQLite database. A read-only daemon keeps the cache in sync. Sending goes through the CLI, never through the daemon.
What I like most is how small the questions become. "Where did someone mention Lisbon?" is tg messages search --query lisbon, a full-text search over the cache. For anything stranger there is read-only SQL with tg sql, and tg api <method> calls any Telegram API method directly.
Output is JSON by default, errors follow a stable schema, and there is a skill integration, so an agent can use it without guessing. It reads from the cache first, --fresh asks Telegram directly, and it tracks rate limits to help you stay within them.
It is still early. You need Bun and your own API credentials, media and export aren't there yet, and the roadmap lists known sync gaps.
It's free and MIT licensed, built with Bun, TypeScript and mtcute. Code and docs: https://github.com/neoromantic/telegram-sync-cli
The chats in the screenshot are made up.
I wrote this post with help from an AI assistant. The tool is mine, and I checked every fact.
Top comments (0)