Skip to content

claw init --from should support same-runtime and cross-runtime imports #230

Description

@mostlydev

Summary

claw init --from currently reads an existing OpenClaw config, then emits a legacy flat OpenClaw scaffold. That is too narrow and non-intuitive: operators should be able to import an existing OpenClaw or Hermes instance into a claw-managed project, either preserving the same runtime or selecting another supported runtime.

This issue tracks the generic migration/import UX. It is not tied to any one deployment.

Current behavior

  • --from only looks for openclaw.json.
  • The import path hardcodes FROM openclaw:latest and CLAW_TYPE openclaw.
  • --type hermes is ignored when --from is present.
  • The generated scaffold is legacy flat layout, not the canonical agents/<name>/ layout used by normal claw init.
  • The importer detects enabled channels and primary model, but drops platform-specific routing such as Slack allowed channels.
  • Slack import emits only SLACK_BOT_TOKEN / SLACK_BOT_ID style env placeholders, but Hermes socket mode requires SLACK_APP_TOKEN too.
  • Provider refs from the source config are copied as-is, even when the selected target runtime cannot use that provider route.

Goal

Make runner migration a first-class claw workflow:

  • OpenClaw config -> claw-managed OpenClaw
  • OpenClaw config -> claw-managed Hermes
  • Hermes config -> claw-managed Hermes
  • Hermes config -> claw-managed OpenClaw, where mappings are supportable

Proposed direction

  • Treat --type as the target runtime even when --from is present, or introduce an explicit --target if that is clearer.
  • Detect or declare source runtime (openclaw, hermes) instead of assuming OpenClaw forever.
  • Emit canonical project layout by default, preserving legacy flat import only behind an explicit compatibility flag if needed.
  • Import identities, model slots, handles, platform env requirements, skills/contracts, and portable workspace/persona references where possible.
  • Extract secrets into .env.example placeholders rather than writing raw tokens into generated pod YAML.
  • Preserve platform routing intent in portable x-claw terms where the data model supports it; where it does not, emit explicit migration notes instead of silently dropping behavior.
  • For model providers that the target runtime cannot use directly, fail with a clear migration note or require an explicit replacement model/provider choice such as OpenRouter or Vercel via cllama.

Dependencies / related work

  • Hermes Slack parity should land first or alongside this work so Slack imports have a valid target surface.
  • Existing Rails-style DX issue feat: Rails-style DX — claw new, claw g, claw model #90 is related but not sufficient; this issue is about importing native runner state into claw-managed projects, not just new-project generators.

Non-goals

  • Do not implement channel://slack policy mapping unless the migration data model requires it and the scope is explicitly expanded.
  • Do not preserve secrets inline in generated tracked files.
  • Do not add deployment-specific references to docs, tests, or issue titles.

Acceptance criteria

  • claw init <dir> --from <openclaw-config> --type openclaw produces a valid claw-managed OpenClaw project.
  • claw init <dir> --from <openclaw-config> --type hermes produces a valid claw-managed Hermes project when the source features are supported.
  • Unsupported source features are reported as actionable migration notes.
  • Slack socket-mode imports include both bot and app token placeholders.
  • Provider/model mismatches are handled explicitly rather than copied into a broken scaffold.
  • Documentation explains same-runtime and cross-runtime import paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions