claude-feishu-channel

agent
Guvenlik Denetimi
Basarisiz
Health Uyari
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 10 GitHub stars
Code Basarisiz
  • Hardcoded secret — Potential hardcoded credential in config.example.toml
  • rm -rf — Recursive force deletion command in package.json
Permissions Gecti
  • Permissions — No dangerous permissions requested
Purpose
This agent acts as a bridge between a Feishu (Lark) group chat and a Claude Code session. It allows users to send messages in Feishu that Claude processes with full tool access, streaming the results back to the chat as interactive cards.

Security Assessment
Overall risk: High. The tool is designed to execute shell commands and edit files directly on the host machine based on chat inputs. While it uses a permission brokering system to post approval cards in Feishu before acting, granting full agent access to a chatroom carries inherent risks. Additionally, the automated security scan detected a potential hardcoded credential in the example configuration file. The source code also contains a recursive force deletion command (`rm -rf`) within its package.json scripts, which can be dangerous if triggered unintentionally.

Quality Assessment
The project is active and recently maintained, with the last push occurring today. It has gathered 10 GitHub stars, indicating a small but present level of community trust and usage. However, the repository lacks an open-source license. This means that, strictly speaking, all rights are reserved by the creator, and developers do not have clear legal permission to use, modify, or distribute the code without asking first.

Verdict
Use with caution. The tool is actively maintained and useful, but its high-risk nature (granting full shell access to a chat bot), missing license, and presence of hardcoded credentials and aggressive deletion commands require strict oversight.
SUMMARY

Bridge a Claude Code sessions to a Feishu (Lark) bot

README.md

CFC Logo

claude-feishu-channel

Bridge between Claude Code and Feishu / Lark group chat.
Send messages in Feishu → Claude processes with full tool access → results stream back as interactive cards.

npm version CI node version

Features

  • Full Claude Code agent — file editing, shell commands, search, planning
  • Permission brokering — tool calls post interactive approval cards in Feishu
  • Session persistence — survives process restarts, auto-resumes conversations
  • Queue & interrupt — messages queue during generation; ! prefix interrupts
  • Interactive cards — streaming status, tool activity, thinking blocks, permissions
  • Runtime config/config set to tune behavior without restart

Quick Start

Install

npm install -g claude-feishu-channel

Initialize config

cfc init
# Creates ~/.claude-feishu-channel/config.toml from template

Edit the config with your Feishu credentials:

vim ~/.claude-feishu-channel/config.toml

Run

cfc

The bot connects to Feishu via WebSocket and starts listening for messages.

CLI Options

cfc [options]            Start the service
cfc init                 Create config template at ~/.claude-feishu-channel/config.toml

Options:
  -c, --config <path>    Path to config.toml (overrides default location)
  -v, --version          Show version number
  -h, --help             Show help

Prerequisites

  • Node.js >= 20
  • Claude CLIclaude binary in $PATH (or set claude.cli_path in config)
  • Feishu bot app — created at open.feishu.cn

Commands

Command Description
/new Start a new session (clear context)
/stop Interrupt current generation
/status Show session state, model, token usage
/sessions List all known sessions
/resume <id> Resume a previous session
/cd <path> Change working directory (with confirm card)
/project <alias> Switch to a configured project alias
/mode <mode> Set permission mode: default, acceptEdits, plan, bypassPermissions
/model <name> Switch Claude model
/config show Display current configuration
/config set <key> <value> Change a config value at runtime
/config set <key> <value> --persist Change and write back to config.toml
/help Show available commands

Special inputs:

Input Effect
!<text> Interrupt current turn + run <text> as new turn
Plain text Queue as next turn (or start immediately if idle)

Configuration

See config.example.toml for all options with comments.

Sections

Section Keys Description
[feishu] app_id, app_secret, encrypt_key, verification_token Feishu bot credentials
[access] allowed_open_ids, unauthorized_behavior Who can talk to the bot
[claude] default_cwd, default_permission_mode, default_model, cli_path, permission_timeout_seconds, permission_warn_before_seconds Claude agent defaults
[render] inline_max_bytes, hide_thinking, show_turn_stats Card rendering options
[persistence] state_file, log_dir, session_ttl_days State and log paths
[logging] level Log level: trace, debug, info, warn, error
[projects] <alias> = "<path>" Project aliases for /project command

Runtime-settable keys

These keys can be changed via /config set without restart:

render.hide_thinking, render.show_turn_stats, render.inline_max_bytes,
logging.level, claude.default_model, claude.default_cwd,
claude.default_permission_mode, claude.permission_timeout_seconds,
claude.permission_warn_before_seconds

Architecture

Feishu WebSocket
      │
      ▼
FeishuGateway (event decryption, dedup, access control)
      │
      ├─ onMessage ──▶ parseInput (router)
      │                    │
      │                    ├─ /command ──▶ CommandDispatcher
      │                    │
      │                    └─ plain text ──▶ ClaudeSession.submit
      │                                        │
      │                                        ▼
      │                                  SDK query (claude-agent-sdk)
      │                                        │
      │                                        ├─ tool_use ──▶ PermissionBroker ──▶ Feishu card
      │                                        ├─ thinking ──▶ Feishu card (streaming)
      │                                        └─ text ──▶ Feishu answer card
      │
      └─ onCardAction ──▶ PermissionBroker.resolveByCard
                          QuestionBroker.resolveByCard
                          CommandDispatcher.resolveCdConfirm

Key components:

  • FeishuGateway — receives WebSocket events, verifies signatures, deduplicates, enforces access control
  • ClaudeSession — state machine (idle → generating → idle) with message queue, drives the SDK query loop
  • ClaudeSessionManagerchat_id → ClaudeSession map with persistence and crash recovery
  • FeishuPermissionBroker — posts permission cards, tracks pending approvals, handles timeouts
  • CommandDispatcher — handles slash commands (/new, /cd, /config set, etc.)

Development

# Clone and install
git clone https://github.com/Blackman99/claude-feishu-channel.git
cd claude-feishu-channel
pnpm install

# Run in dev mode
pnpm dev

# Run tests
pnpm test

# Type check
pnpm typecheck

# Build
pnpm build

Environment Variables

Variable Description
CLAUDE_FEISHU_CONFIG Override config file path (default: ~/.claude-feishu-channel/config.toml)
ANTHROPIC_BASE_URL Custom API endpoint for Claude SDK
ANTHROPIC_AUTH_TOKEN Auth token for custom endpoint

License

MIT

Yorumlar (0)

Sonuc bulunamadi