{"id":51601446,"url":"https://github.com/zitsen/atim","last_synced_at":"2026-07-11T22:32:12.544Z","repository":{"id":359067274,"uuid":"1243338472","full_name":"zitsen/atim","owner":"zitsen","description":"AI Agent through IM (Telegram, Feishu/Lark etc.)","archived":false,"fork":false,"pushed_at":"2026-06-08T02:51:29.000Z","size":609,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T04:18:28.811Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zitsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-19T08:50:54.000Z","updated_at":"2026-06-08T02:51:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zitsen/atim","commit_stats":null,"previous_names":["zitsen/atim"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/zitsen/atim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitsen%2Fatim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitsen%2Fatim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitsen%2Fatim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitsen%2Fatim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zitsen","download_url":"https://codeload.github.com/zitsen/atim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zitsen%2Fatim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35377012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-11T22:32:12.048Z","updated_at":"2026-07-11T22:32:12.538Z","avatar_url":"https://github.com/zitsen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Atim\n\n**AI Agent through IM** (Atim, pronounced like \"Atom\") — Talk to Claude Code (and soon other AI coding agents) through Telegram or Feishu.\n\n```\nTelegram / Feishu  ↔  tmux  ↔  Claude Code\n```\n\nAtim bridges an IM chat directly to a tmux window running an AI coding agent. Type in Feishu or Telegram — it reaches the agent's terminal. The agent responds — you see it in the same chat.\n\n## Quick Install\n\nDownload and install to ~/.local/bin with `installer.sh` with `curl`:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/zitsen/atim/main/install.sh | bash\n```\n\nOr with `wget`:\n\n```bash\nwget -qO- https://raw.githubusercontent.com/zitsen/atim/main/install.sh | bash\n```\n\nInstall to a custom path:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/zitsen/atim/main/install.sh | bash -s -- -b /usr/local/bin\n```\n\nThe installer downloads a statically-linked musl binary from the latest GitHub release.\n\n## Features\n\n- **Multi-IM**: Feishu/Lark (beta) + Telegram (stable)\n- **Multi-agent**: Claude Code, Copilot CLI, Codex CLI — auto-detected by pane inspection\n- **Topic isolation**: Each Telegram topic groups → a dedicated tmux window\n- **Interactive UIs**: Inline keyboards for directory browsing, window picking, session selection\n- **Voice messages**: Whisper transcription via OpenAI API\n- **Efficient monitoring**: Byte-offset tracking of Claude Code JSONL session logs\n- **Flood control**: Per-chat rate limiting with content-aware message merging\n\n## Architecture\n\n```\n  ┌──────────────┐     ┌──────────────────────────┐     ┌──────────────┐\n  │  Telegram    │     │     Atim Server          │     │   Feishu     │\n  │  Bot API     │ \u003c-\u003e │                          │ \u003c-\u003e │   Bot API    │\n  └──────────────┘     │  ┌──────┐  ┌───────────┐ │     └──────────────┘\n                       │  │ Queue│  │  Monitor  │ │\n                       │  └──┬───┘  └─────┬─────┘ │\n                       │     │            │       │\n                       │  ┌──┴────────────┴───┐   │\n                       │  │    State + Tmux   │   │\n                       │  └────────┬──────────┘   │\n                       └───────────┼──────────────┘\n                                   │\n                          ┌────────┴────────┐\n                          │  tmux session   │\n                          │  ┌────────────┐ │\n                          │  │ Claude Code│ │\n                          │  │ / Copilot  │ │\n                          │  │ / Codex    │ │\n                          │  └────────────┘ │\n                          └─────────────────┘\n```\n\n## Quick Start\n\n\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eConfigure Feishu Bot\u003c/strong\u003e\u003c/summary\u003e\nOpen the [Feishu Launcher](https://open.feishu.cn/page/launcher) to create a bot in one click:\n\n![Feishu Launcher](assets/feishu-launcher.png)\n\nEnter any name (e.g. \"AtimBot\"), optionally upload an avatar, and click **Create**. After creation, you'll see your App ID and App Secret:\n\n![App Credentials](assets/feishu-app-credentials.png)\n\nFor bot management, you can find your app in the [console](https://open.feishu.cn/app):\n\n![App List](assets/feishu-apps-list.png)\n\nSet `~/.atim/.env` with App ID and Secret:\n\n```bash\nATIM_IM_BACKEND=feishu\nATIM_FEISHU_APP_ID=cli_xxxx\nATIM_FEISHU_APP_SECRET=xxxx\n```\n\nThen run `atim`.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eConfigure Telegram Bot\u003c/strong\u003e\u003c/summary\u003e\nFirst create Telegram bot via [@BotFather](https://t.me/botfather).\n\nGet your User ID from [@userinfobot](https://t.me/userinfobot).\n\nSet `~/.atim/.env`:\n\n```bash\nATIM_IM_BACKEND=telegram\nATIM_TELEGRAM_TOKEN=\"123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11\"\nATIM_ALLOWED_USERS=\"123456789\"\n```\n\nThen run `atim`.\n\u003c/details\u003e\n\n### Prerequisites\n\n| Requirement | Notes                                   |\n| ----------- | --------------------------------------- |\n| **tmux**    | Atim manages agent windows through tmux |\n| **zoxide**  | Optional. For fast directory search     |\n\n## Configuration\n\nAtim reads configuration from `~/.atim/config.toml` (with environment variables as overrides).\nOn first run, a legacy `~/.atim/.env` file is automatically migrated to `config.toml`.\n\n### config.toml\n\n```toml\n[im]\nbackend = \"feishu\"   # \"feishu\" or \"telegram\"\n\n[im.feishu]\napp_id = \"cli_xxxxxxxxxxxxxx\"\napp_secret = \"xxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\n[im.telegram]\ntoken = \"123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11\"\nallowed_users = \"123456789\"   # comma-separated, empty = allow all\n\n[agent]\ncommand = \"claude\"\n\n[tmux]\nsession = \"atim\"\n\n[monitor]\npoll_interval = \"2.0\"\n\n[display]\nshow_user_messages = \"true\"\nshow_tool_calls = \"true\"\nshow_hidden_dirs = false\n\n[openai]\napi_key = \"...\"\nbase_url = \"https://api.openai.com/v1\"\n```\n\n### Environment variable overrides\n\nAny setting in `config.toml` can be overridden by the corresponding environment variable.\nSee the table below for the variable names:\n\n| Variable                 | Default   | Description                                           |\n| ------------------------ | --------- | ----------------------------------------------------- |\n| `ATIM_DIR`               | `~/.atim` | Data directory                                        |\n| `ATIM_TMUX_SESSION`      | `atim`    | Target tmux session                                   |\n| `ATIM_AGENT_COMMAND`     | `claude`  | Agent CLI command                                     |\n| `ATIM_IM_BACKEND`        | —         | IM backend to use (`feishu` or `telegram`)            |\n| `ATIM_FEISHU_APP_ID`     | —         | Feishu App ID                                         |\n| `ATIM_FEISHU_APP_SECRET` | —         | Feishu App Secret                                     |\n| `ATIM_TELEGRAM_TOKEN`    | —         | Telegram Bot API token                                |\n| `ATIM_ALLOWED_USERS`     | —         | Comma-separated Telegram user IDs (empty = allow all) |\n| `ATIM_OPENAI_API_KEY`    | —         | For voice message transcription                       |\n\n## Usage\n\n1. **Add the bot to a Feishu group chat** (or create a Telegram group with Topics enabled).\n2. **Send a message** in the chat — Atim creates a tmux window and starts the agent.\n3. **Chat with the agent** — every message goes to the agent's terminal.\n4. **Close/archive the group** when done — the binding is cleaned up.\n\n### Slash Commands\n\nSend these in the IM chat to control the agent session:\n\n| Command                | Description                                                      |\n| ---------------------- | ---------------------------------------------------------------- |\n| `/ss` or `/screenshot` | Capture a screenshot of the tmux terminal                        |\n| `/usage`               | Show Claude Code usage/quota info                                |\n| `/switch \u003cagent\u003e`      | Switch to a different agent (`claude`, `copilot`, `codex`)       |\n| `/esc` or `/dismiss`   | Send Escape key to dismiss modals/help screens                   |\n| `/enter`               | Send Enter key to confirm modals/selections                      |\n| `!\u003ccommand\u003e`           | Run a shell command in the agent's tmux window and stream output |\n\nDuring directory browsing, text input acts as a `zoxide` query to jump to matching directories.\n\n### Session Hook (recommended)\n\nInstall the SessionStart hook for reliable session tracking:\n\n```bash\natim hook --install\n```\n\nThis registers each Claude Code session UUID so Atim knows which JSONL logs to watch.\n\n### Service Management\n\nAtim can be managed as a systemd service:\n\n```bash\n# Install the service unit\natim service --install\n\n# Start/stop/restart/status (user-level by default)\natim service --start\natim service --stop\natim service --restart\natim service --status\n\n# System-level service (requires root)\natim service --system --install\natim service --system --start\n```\n\n## Project Structure\n\n| Crate          | Purpose                                                         |\n| -------------- | --------------------------------------------------------------- |\n| `atim-core`    | Config, error types, IM trait, message types, agent abstraction |\n| `atim-im`      | Telegram + Feishu adapter implementations                       |\n| `atim-tmux`    | tmux window lifecycle and terminal I/O                          |\n| `atim-parser`  | JSONL log and terminal output parsing                           |\n| `atim-monitor` | Session log polling with byte-offset tracking                   |\n| `atim-queue`   | Per-user async message queues with flood control                |\n| `atim-state`   | Thread binding and window state persistence                     |\n| `atim-bin`     | Entry point — server + CLI                                      |\n\n## Extending\n\nAtim is designed for extensibility:\n\n- **New IM backend**: implement the `ImAdapter` trait — see `crates/atim-im/src/` for examples\n- **New agent**: implement the `AgentParser` trait — see `crates/atim-core/src/agent/` for examples\n\n## Acknowledgments\n\n- **[ccbot](https://github.com/six-ddc/ccbot)** — Original Telegram-to-Claude-Code bridge that inspired this project\n- **[openlark](https://github.com/openlark)** — Feishu/Lark IM integration SDK\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzitsen%2Fatim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzitsen%2Fatim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzitsen%2Fatim/lists"}