Lark Bridge connects Telegram or iMessage to an AI CLI so messages sent from your phone can be answered from your desktop workflow.
The current build is centered on OpenAI Codex CLI as the active AI backend.
- Receives messages from Telegram or iMessage
- Forwards them to the configured AI CLI
- Sends the AI response back to the same chat
- Provides basic control commands for pausing, stopping, retrying, and checking status
Codex CLI
via@openai/codex
Telegram
on Windows, macOS, and LinuxiMessage
on macOS only
- Node.js 16 or newer
- A working installation of the Codex CLI
- Telegram bot credentials if you use Telegram
- macOS with Messages.app signed in if you use iMessage
npm install -g lark-bridge
git clone https://github.com/AhmadTheTech/lark
cd lark
npm install
npm link
Run the interactive setup:
lark configure
You will choose:
-
The AI provider
-
The messaging platform
-
Platform-specific settings
-
Open Telegram and start a chat with
@BotFather -
Send
/newbot
and follow the prompts - Copy the bot token it returns
-
Find your Telegram user ID with
@userinfobot -
Enter the token and allowed user IDs during
lark configure
You can allow multiple users by entering comma-separated numeric IDs.
Lark uses AppleScript to interact with Messages.app.
Before starting:
- Sign in to iMessage on your Mac
- Allow Terminal to control Messages when prompted
- If needed, grant Contacts access as well
On iMessage, the bridge checks for new messages on a polling interval selected during setup.
lark start
For verbose logging:
lark start --debug
lark configure # Run interactive setup
lark start # Launch the bridge
lark status # Show saved configuration
lark reset # Remove saved configuration
Once the bot is running, these commands are available in Telegram:
/start
-
show bridge status
/help -
list commands
/status -
show uptime, provider, and message stats
/ai -
show the active AI provider
/ -
stop forwarding messages
/resume -
resume forwarding
/stop -
cancel the current AI request
/clear -
clear conversation context
/retry -
retry the last failed message
/ping -
check that the bridge is alive
/version -
display the installed Lark version
/shutdown -
stop the bridge process
You
-> Telegram or iMessage
-> Lark Bridge
-> Codex CLI
-> Lark Bridge
-> Telegram or iMessage
-> You
Lark stores its config under:
~/.lark/config
Use lark status
to inspect the saved values.
- If you found an issue, open an issue. - If you want to contribute, see contribution.md.
For license details, see LICENSE.