Skip to content

feat: add iFlow CLI support#1355

Open
winterhuan wants to merge 2 commits intothedotmack:mainfrom
winterhuan:main
Open

feat: add iFlow CLI support#1355
winterhuan wants to merge 2 commits intothedotmack:mainfrom
winterhuan:main

Conversation

@winterhuan
Copy link

@winterhuan winterhuan commented Mar 13, 2026

Summary

Add iFlow CLI integration for claude-mem, enabling persistent memory across sessions with automatic context injection and observation capture.

Installation

```bash
curl -fsSL https://raw.githubusercontent.com/thedotmack/claude-mem/main/iflow-cli/install.sh | bash
```

Architecture

与 Claude Code 版本共享:

  • Worker 服务 (`src/services/worker-service.ts`)
  • SQLite 数据存储
  • MCP server

Files

```
iflow-cli/
├── .iflow/
│ └── settings.json # Hooks + MCP 配置
├── install.sh # 一键安装脚本
└── README.md # 文档
```

Add complete integration for iFlow CLI, enabling persistent memory across
sessions with automatic context injection and observation capture.

Features:
- SessionStart hook: Start worker and inject relevant context
- PostToolUse hook: Capture tool operations as observations
- Stop hook: Generate session summaries
- SessionEnd hook: Save session state
- Skills: @mem-search and @mem-context

Fixes all P1 issues found by Codex Review:
- Fix API paths: /health -> /api/health, /api/observations -> /api/sessions/observations
- Fix request body field: session_id -> contentSessionId
- Fix Search API response handling for { content: [...] } structure
- Convert commands to skills format (SKILL.md)
- Add missing session-complete.js hook for SessionEnd
- Convert all Chinese comments and docs to English

Installation:
curl -fsSL https://raw.githubusercontent.com/thedotmack/claude-mem/main/iflow-cli/install.sh | bash

This follows the same pattern as the existing OpenClaw integration, sharing
the core worker service while adapting to iFlow CLI's hook system.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16f95e726e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +37 to +41
if command -v bun &> /dev/null; then
echo -e "${GREEN}✓ Bun: $(bun --version)${NC}"
else
echo -e "${YELLOW}⚠ Bun not installed (optional, needed for worker)${NC}"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require Bun before reporting install success

The dependency check treats Bun as optional, but install_iflow_integration writes hook commands that always execute bun-runner (for example the commands added in this same script), so environments without Bun will complete installation and then fail every hook invocation, effectively disabling memory capture. This should fail fast (or install Bun) instead of proceeding as a successful setup.

Useful? React with 👍 / 👎.

echo -e "${GREEN}✓ Worker already running on port ${WORKER_PORT}${NC}"
else
# Start worker (background)
nohup node plugin/scripts/worker-service.cjs start > /dev/null 2>&1 &

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Launch worker via bun-runner instead of node

In the auto-start path, the installer launches the worker with node plugin/scripts/worker-service.cjs start, but this worker script depends on Bun runtime modules, so the command exits immediately and the installer can never actually start the worker when it is not already running. Reusing the bun-runner invocation used by the hook configuration would make the startup step functional.

Useful? React with 👍 / 👎.

- Make Bun a hard requirement in check_dependencies() since all hooks
  use bun-runner which requires Bun runtime
- Check common Bun installation paths if not in PATH
- Start worker via bun-runner instead of node directly, matching hook
  invocation pattern (worker-service.cjs depends on Bun modules like
  bun:sqlite)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant