← Back to Skills Marketplace
arkerro

Feishu Chat Importer

by arkerro · GitHub ↗ · v1.0.0 · MIT-0
win32linuxdarwin ✓ Security Clean
62
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install feishu-chat-importer
Description
Convert Feishu chat history exports into OpenClaw episodic memory format. Parses feishu_chat_YYYYMMDD.json files, normalizes messages, and writes daily episo...
README (SKILL.md)

Feishu Chat History Importer

Import Feishu chat history exports into OpenClaw episodic memory. Converts feishu JSON exports into daily episodic summaries that the Dreaming system can process and display in Imported Insights and Memory Palace views.

Quick Start

# Dry run — preview what would be imported
python3 skills/feishu-chat-importer/scripts/batch.py --dir memory/Chat-history --dry-run

# Import all Feishu chats
python3 skills/feishu-chat-importer/scripts/batch.py --dir memory/Chat-history

# Import only chats since a date
python3 skills/feishu-chat-importer/scripts/batch.py --dir memory/Chat-history --since 2026-03-01

# Verbose — show every message
python3 skills/feishu-chat-importer/scripts/batch.py --dir memory/Chat-history --dry-run --verbose

How It Works

  1. Read feishu_chat_YYYYMMDD.json files from the source directory
  2. Group messages by date (from create_time / millisecond timestamp)
  3. Normalize each message to {role, content, timestamp}
    • sender.sender_type = "user" → role = user
    • sender.sender_type = "app" → role = assistant (Feishu bot = AI)
  4. Write daily episodic summaries to memory/episodic/YYYY-MM-DD.md
  5. Dreaming processes episodic files → appears in Imported Insights + Memory Palace

Output Format

Writes to memory/episodic/YYYY-MM-DD.md:

## Feishu Chat: \x3Cchat_id> (2026-03-19)
- Messages: \x3Ccount>
- Participants: user_id, app_id

### user (首长):
message content here...

### assistant (飞书机器人):
message content here...

Key Concepts

  • Daily grouping: All messages from the same YYYYMMDD file land in the same episodic file
  • Deduplication: Chat IDs tracked — re-running never creates duplicates
  • Role mapping: User messages → user, App/bot messages → assistant
  • Content extraction: Handles text and post msg_type automatically
  • OPENCLAW_WORKSPACE: Set this env var to point imports to the right agent workspace

Source Format

Expects Feishu export files named feishu_chat_YYYYMMDD.json with this structure:

[
  {
    "message_id": "om_xxx",
    "chat_id": "oc_xxx",
    "create_time": "1773899372102",
    "msg_type": "text|post",
    "sender": {
      "id": "ou_xxx",
      "sender_type": "user|app"
    },
    "body": {
      "content": "{\"text\":\"message text\"}"  // text type
      // or
      "content": "{\"title\":\"\",\"content\":[[{\"tag\":\"text\",\"text\":\"...\"}]]}"  // post type
    }
  }
]
Usage Guidance
This skill appears to do exactly what it claims (parse feishu_chat_YYYYMMDD.json files and write daily episodic markdown). Before installing or running it: 1) Run a dry-run first (the CLI supports --dry-run) and point --dir to a safe test folder. 2) Ensure the correct Python executable is available: the metadata requires python3 but batch.py invokes 'python' — on systems without a 'python' symlink this may fail; either install a 'python' binary or edit batch.py to call 'python3'. 3) Set OPENCLAW_WORKSPACE explicitly to the intended workspace before importing so files are written where you expect (the skill currently references this env var but doesn't declare it). 4) Inspect or back up your workspace/memory/episodic directory if you have existing data — the skill appends to files and uses a simple marker to deduplicate. 5) Because the skill reads arbitrary JSON files from a directory you provide and writes to your workspace, avoid pointing it at sensitive system directories. The scripts contain no network calls or credential handling, but if you need higher assurance, review the included Python files yourself (they are short and human-readable).
Capability Assessment
Purpose & Capability
Name/description align with the included scripts: both parse Feishu export JSON files and write daily episodic markdown into the agent workspace. Required binary (python3) is reasonable. Minor mismatch: the batch driver launches the parser via subprocess using the 'python' command, while the metadata requires 'python3' — this may fail on systems where 'python' is not present or points to Python 2.
Instruction Scope
SKILL.md and the scripts only read Feishu JSON files from a user-specified directory, normalize/group messages, and write markdown files into the workspace memory/episodic directory. There are no instructions to read unrelated system files, network endpoints, or external services.
Install Mechanism
No install spec; the skill is instruction + local Python scripts. This is low-risk compared to remote installers or archive downloads since code is bundled with the skill. The scripts are plain Python, not obfuscated.
Credentials
SKILL.md and the batch script reference the OPENCLAW_WORKSPACE environment variable to locate the target workspace, but the skill's declared requirements list no required env vars. That mismatch means important behavior (where files get written) depends on an undeclared env var. The skill writes files to the user's workspace directory (filesystem access) which is necessary for its purpose but worth noting.
Persistence & Privilege
always is false, the skill does not request permanent or elevated platform privileges, and it does not modify other skills or system-wide settings. It writes episodic files only under the workspace path.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-chat-importer
  3. After installation, invoke the skill by name or use /feishu-chat-importer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of feishu-chat-importer. - Converts Feishu chat history exports into OpenClaw episodic memory format. - Parses feishu_chat_YYYYMMDD.json files, normalizes messages, and groups them by date. - Writes daily episodic summaries to memory/episodic/ for use in Imported Insights and Memory Palace. - Supports dry run, date filtering, and verbose import options. - Maps user and app messages to user and assistant roles accordingly. - Ensures deduplication and proper content extraction for both text and post message types.
Metadata
Slug feishu-chat-importer
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Feishu Chat Importer?

Convert Feishu chat history exports into OpenClaw episodic memory format. Parses feishu_chat_YYYYMMDD.json files, normalizes messages, and writes daily episo... It is an AI Agent Skill for Claude Code / OpenClaw, with 62 downloads so far.

How do I install Feishu Chat Importer?

Run "/install feishu-chat-importer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Feishu Chat Importer free?

Yes, Feishu Chat Importer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Feishu Chat Importer support?

Feishu Chat Importer is cross-platform and runs anywhere OpenClaw / Claude Code is available (win32, linux, darwin).

Who created Feishu Chat Importer?

It is built and maintained by arkerro (@arkerro); the current version is v1.0.0.

💬 Comments