Skip to content

aleck31/Kiro2Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

85 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Kiro2Chat

English | ไธญๆ–‡

Bridge kiro-cli to chat platforms (Telegram, Lark/Feishu, Discord, Web) via ACP protocol.

Features

  • ๐Ÿ”— ACP Protocol โ€” Communicates with kiro-cli via JSON-RPC 2.0 over stdio
  • ๐ŸŒ Web Chat โ€” Browser chat UI: streaming, inline permission card, message history, click-to-zoom images
  • ๐Ÿ“ฑ Telegram Bot โ€” Streaming, tool call display, inline-keyboard permission approval, image I/O
  • ๐Ÿ’ฌ Lark/Feishu Bot โ€” Topic-based sessions, @bot trigger, image I/O, feishu/lark domain switch
  • ๐ŸŽฎ Discord Bot โ€” @bot trigger, image I/O, 2000-char auto-split
  • ๐Ÿ–ฅ Admin Dashboard โ€” NiceGUI admin panel: adapter start/stop, live session stats, tabbed Settings (ACP / Workspaces / Adapters)
  • ๐Ÿ” Cross-platform session sharing โ€” Same workspace shares one kiro session across TG/Lark/Discord/Web
  • ๐Ÿ”€ Multi-workspace โ€” per_chat (each user picks via /workspace) or fixed (all chats share one)
  • ๐Ÿ” Permission Approval โ€” Inline keyboards (TG), inline card (Web), or text y/n/t fallback
  • ๐Ÿ›ก๏ธ Authorization โ€” Per-adapter allowlist gated by a Require authorization switch; new users onboard via one-time /claim <token>
  • โฐ Heartbeat tasks โ€” Schedule kiro prompts (interval or cron) and push the answer to any adapter; broadcast or targeted delivery
  • ๐Ÿค– Agent & Model switching โ€” /agent and /model commands across all adapters
  • โšก On-demand startup โ€” kiro-cli starts when the first message arrives, idle sessions are reaped automatically
  • ๐Ÿ–ผ๏ธ Image support โ€” Send images for visual analysis (JPEG, PNG, GIF, WebP); click thumbnails to preview full-size
  • ๐Ÿงฐ Adapter enable/disable โ€” Flip each bot on/off from the dashboard without touching credentials
  • ๐Ÿ›‘ Cancel & Reset โ€” /cancel interrupts a turn, /reset starts a fresh session

Screenshots

Admin Dashboard โ€” adapter status, live session stats, per-adapter controls

Web Chat โ€” streaming replies, tool call indicators, Markdown rendering, click-to-zoom images

Settings โ€” tabbed config (ACP / Workspaces / Adapters / Heartbeat), per-tab save

Telegram Bot โ€” tool calls, inline-keyboard permission, Markdown rendering

Architecture

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  Telegram โ”‚ โ”‚  Lark/  โ”‚ โ”‚ Discord โ”‚ โ”‚   Web   โ”‚
    โ”‚  Adapter  โ”‚ โ”‚ Feishu  โ”‚ โ”‚ Adapter โ”‚ โ”‚  Chat   โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚      Bridge       โ”‚  session management, permission routing
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚     ACPClient     โ”‚  JSON-RPC 2.0 over stdio
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚     kiro-cli      โ”‚  acp subprocess
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Quick Start

# Prerequisites: kiro-cli installed and logged in
git clone https://github.com/aleck31/Kiro2Chat.git
cd Kiro2Chat
uv sync

# Run in foreground (dev / debug)
uv run kiro2chat run

# Or deploy as a systemd user service
kiro2chat install             # generate unit file, enable service
kiro2chat start               # start daemon
kiro2chat status              # show status
kiro2chat stop                # stop daemon

Open http://127.0.0.1:7860 for the admin dashboard. Configure tokens at /settings.

For platform-specific bot setup (BotFather, Lark/Feishu developer console, Discord developer portal) and production operation tips, see docs/DEPLOYMENT.md.

Commands

All adapters support the following commands:

Command Description
/model View/switch model
/agent View/switch agent mode
/workspace List workspaces, marking the active one
/workspace <name> Switch to a workspace
/context Show context usage
/cancel Cancel current operation
/reset Reset session
/claim <token> Redeem a claim token to join the allowlist
/help Show help

Discord & Lark: @bot to trigger in group chats, DM for direct conversation.

Configuration

All configuration is managed via ~/.config/kiro2chat/config.toml, or through the Web Admin Dashboard at /settings.

[telegram]
tg_bot_token = "your-token"
tg_enabled = true                   # disable to keep creds but not auto-start

[lark]
lark_app_id = "cli_xxx"
lark_app_secret = "xxx"
lark_domain = "feishu"              # feishu | lark
lark_enabled = true

[discord]
discord_bot_token = "your-token"
discord_enabled = true

[web]
web_host = "127.0.0.1"
web_port = 7860

[acp]
kiro_cli_path = "kiro-cli"
workspace_mode = "per_chat"         # per_chat | fixed
fixed_workspace = "default"         # only used when workspace_mode = "fixed"
idle_timeout = 1200                 # seconds before idle session reap; 0 disables
response_timeout = 3600             # max wait per prompt

[workspaces.default]
path = "~/.local/share/kiro2chat/workspaces/default"
# session_id = "..."                # managed by kiro2chat, do not set manually

[workspaces.my-project]
path = "~/repos/my-project"

Session sharing

Sessions are keyed by workspace, not chat_id. Messages sent via Telegram, Lark, Discord, or Web that all target the same workspace land in the same kiro session โ€” giving cross-platform context continuity. Each prompt is tagged with [platform/user] so kiro can tell messages apart.

Project Structure

src/
โ”œโ”€โ”€ app.py              # Entry point, CLI
โ”œโ”€โ”€ config.py           # Configuration (dataclass with field factories)
โ”œโ”€โ”€ config_manager.py   # TOML config read/write
โ”œโ”€โ”€ log_context.py      # Logging context
โ”œโ”€โ”€ manager.py          # Adapter lifecycle manager
โ”œโ”€โ”€ server.py           # WebServer โ€” hosts NiceGUI, assembles pages, boots manager
โ”œโ”€โ”€ acp/
โ”‚   โ”œโ”€โ”€ client.py       # ACP JSON-RPC client (kiro-cli subprocess)
โ”‚   โ””โ”€โ”€ bridge.py       # Per-workspace session sharing, permission routing
โ”œโ”€โ”€ adapters/
โ”‚   โ”œโ”€โ”€ base.py         # Adapter interface + shared /command dispatcher
โ”‚   โ”œโ”€โ”€ telegram.py     # Telegram adapter (aiogram)
โ”‚   โ”œโ”€โ”€ lark.py         # Lark/Feishu adapter (lark-oapi WebSocket)
โ”‚   โ”œโ”€โ”€ discord.py      # Discord adapter (discord.py)
โ”‚   โ””โ”€โ”€ web.py          # Web Chat adapter โ€” send/receive, permission card
โ””โ”€โ”€ webui/
    โ”œโ”€โ”€ layout.py       # Shared top-nav page shell
    โ”œโ”€โ”€ dashboard.py    # /  โ€” adapter status, sessions, live stats
    โ”œโ”€โ”€ settings.py     # /settings โ€” tabbed config (ACP / Workspaces / Adapters)
    โ””โ”€โ”€ chat.py         # /chat โ€” chat page layout + rendering helpers

Tech Stack

Component Technology
ACP Transport JSON-RPC 2.0 over stdio
Web UI (Chat + Admin) NiceGUI
Telegram Bot aiogram 3
Lark/Feishu Bot lark-oapi (WebSocket)
Discord Bot discord.py 2
Config TOML (config.toml)
Package Manager uv + hatchling
Python โ‰ฅ 3.13

Related

  • open-kiro โ€” OpenAI-compatible API gateway for Kiro (the API proxy counterpart)

License

MIT

About

๐Ÿ‘ป Multi-platform chat bridge for Kiro Cli โ€” connect to Telegram, Lark/Feishu, Discord & Web via ACP protocol

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages