✨ feat(cli): add migrate openclaw command#13566
Conversation
…rkspace Add a new CLI command `lh migrate openclaw` that imports all files from the OpenClaw workspace (~/.openclaw/workspace) as agent documents into the LobeHub inbox agent. Supports --source, --agent-id, --slug, --dry-run, and --yes options. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Refactor `migrate` command from a single file to a directory structure (`migrate/index.ts` + `migrate/openclaw.ts`) to support future migration sources like ChatGPT, Claude, Codex, etc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7375d52b5f
ℹ️ 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".
Use proper TrpcClient type instead of casting to any. Extract resolveInboxAgentId helper with correct typing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@Innei @ONLY-yours - This PR adds a |
…default Instead of importing into the inbox, the default behavior now creates a dedicated "OpenClaw" agent and imports workspace files as its documents. Use --agent-id to import into an existing agent instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Support three modes: --agent-id (by ID), --slug (by slug, e.g. "inbox"), or default (create a new "OpenClaw" agent). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show a clickable link (e.g. https://app.lobehub.com/agent/<id>) at the end of the import so users can open the agent directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## canary #13566 +/- ##
========================================
Coverage 66.64% 66.64%
========================================
Files 1997 1997
Lines 165685 165699 +14
Branches 16846 16082 -764
========================================
+ Hits 110414 110424 +10
- Misses 55147 55151 +4
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Verify authentication before scanning files so users get a clear "Run 'lh login' first" message upfront instead of after confirmation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pace Parse IDENTITY.md (or SOUL.md) for Name, Creature/Vibe/Description, and Emoji fields to populate the new agent's title, description, and avatar instead of hardcoding "OpenClaw". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Display the agent avatar emoji and title throughout the migrate flow (confirmation, creation, importing). The agent ID only appears in the final URL. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Filter out IDE configs, VCS dirs, OS artifacts, dependency dirs, Python caches, build outputs, env files, and other common non-content items. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…& improve output - Replace hardcoded EXCLUDED_NAMES set with `ignore` package (gitignore syntax) - Respect workspace .gitignore if present, plus comprehensive default rules - Cover all common languages/tools: Python, Ruby, Rust, Go, Java, .NET, etc. - Improve final output: friendlier completion message with agent name + URL Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover profile parsing, file filtering (gitignore + default rules), dry-run, agent resolution (--agent-id, --slug, default create), confirmation flow, error handling, and output formatting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Skip avatar values like (待定), _(待定)_, TBD, N/A, etc. - Add ignore rules for database files (*.sqlite, *.db, *.mdb, etc.), images, media, fonts, lock files, and compiled binaries - Runtime binary detection: check first 8KB for null bytes and skip binary files that slip through the extension filter - Add tests for placeholder emoji filtering, binary skip, and db exclusion Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Thread an optional `createdAt` parameter through all layers: - Model: AgentDocumentModel.create/upsert accept optional createdAt, set both createdAt and updatedAt on documents + agent_documents rows - Service: UpsertDocumentParams includes createdAt - Router: agentDocument.upsertDocument accepts optional z.date() - CLI: migrate openclaw passes file mtime as createdAt to preserve original file timestamps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show 'npx -y @lobehub/cli login' alongside 'lh login' so users who haven't installed the CLI globally know how to authenticate. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add updatedAt alongside createdAt through all layers. When both are provided, updatedAt is used independently; when only createdAt is given, updatedAt falls back to createdAt. CLI now passes file birthtime as createdAt and mtime as updatedAt. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace process.env.HOME || '~' with os.homedir() so the default --source path resolves correctly on Windows and when HOME is unset - Move fs.readFileSync/statSync inside the try block so a single unreadable file doesn't abort the entire migration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# 🚀 release: 20260407 This release includes **148 commits**. Key updates are below. - **Response API tool execution is more capable and reliable** — Added hosted builtin tools + client-side function tools and improved tool-call streaming/completion behavior. [#13406](#13406) [#13414](#13414) [#13506](#13506) [#13555](#13555) - **Input and composition UX upgraded** — Added AI input auto-completion and multiple chat-input stability fixes. [#13458](#13458) [#13551](#13551) [#13481](#13481) - **Model/provider compatibility improved** — Better Gemini/Google tool schema handling and additional model updates. [#13429](#13429) [#13465](#13465) [#13613](#13613) - **Desktop and CLI reliability improved** — Gateway WebSocket support and desktop runtime upgrades. [#13608](#13608) [#13550](#13550) [#13557](#13557) - **Security hardening continued** — Fixed auth and sanitization risks and upgraded vulnerable dependencies. [#13535](#13535) [#13529](#13529) [#13479](#13479) ### Models & Providers - Added/updated support for `glm-5v-turbo`, GLM-5.1 updates, and qwen3.5-omni series. [#13487](#13487) [#13405](#13405) [#13422](#13422) - Added additional ImageGen providers/models (Wanxiang 2.7 and Keling from Qwen). [#13478](#13478) - Improved Gemini/Google tool schema and compatibility handling across runtime paths. [#13429](#13429) [#13465](#13465) [#13613](#13613) ### Response API & Runtime - Added hosted builtin tools in Response API and client-side function tool execution support. [#13406](#13406) [#13414](#13414) - Improved stream tool-call argument handling and `response.completed` output correctness. [#13506](#13506) [#13555](#13555) - Improved runtime error/context handling for intervention and provider edge cases. [#13420](#13420) [#13607](#13607) ### Desktop App - Bumped desktop dependencies and runtime integrations (`agent-browser`, `electron`). [#13550](#13550) [#13557](#13557) - Simplified desktop release channel setup by removing nightly release flow. [#13480](#13480) ### CLI - Added OpenClaw migration command. [#13566](#13566) - Added local device binding support for `lh agent run`. [#13277](#13277) - Added WebSocket gateway support and reconnect reliability improvements. [#13608](#13608) [#13418](#13418) ### Security - Removed risky `apiKey` fallback behavior in webapi auth path to prevent bypass risk. [#13535](#13535) - Sanitized HTML artifact rendering and iframe sandboxing to reduce XSS-to-RCE risk. [#13529](#13529) - Upgraded nodemailer to v8 to address SMTP command injection advisory. [#13479](#13479) ### Bug Fixes - Fixed image generation model default switch issues. [#13587](#13587) - Fixed subtopic re-fork message scope behavior and agent panel reset edge cases. [#13606](#13606) [#13556](#13556) - Fixed chat-input freeze on paste and mention plugin behavior. [#13551](#13551) [#13415](#13415) - Fixed auth/social sign-in and settings UX edge cases. [#13368](#13368) [#13392](#13392) [#13338](#13338) ### Credits Huge thanks to these contributors: @chriszf @hardy-one @Innei @lijian @neko @OctopusNote @rdmclin2 @rivertwilight @RylanCai @suyua9 @sxjeru @Tsuki @wangyk @WindSpiritSR @yizhuo @YuTengjing @hezhijie0327 @arvinxx
Summary
lh migrate openclawCLI command to import OpenClaw workspace files as agent documents into the LobeHub inbox agent~/.openclaw/workspace(configurable via--source), excluding.idea,node_modules,.git,.DS_Store,.openclaw, etc.agentDocument.upsertDocumentfor idempotent imports (safe to re-run)--dry-runto preview files,--agent-id/--slugfor custom target agent,--yesto skip confirmationUsage
Test plan
lh migrate openclaw --dry-runlists files correctlylh migrate openclawimports files as agent documents in inbox--sourcewith non-existent path shows error--yesskips confirmation prompt🤖 Generated with Claude Code