Documentation
¶
Overview ¶
Package importer migrates an existing OpenClaw configuration into memcode's gateway config. OpenClaw is the large incumbent multi-channel gateway; letting a user bring their channels over with one command is how you win a switch without making them reconfigure everything. It reads OpenClaw's plain-JSON openclaw.json (parsed with encoding/json, the same way OpenClaw and Hermes read it), maps each supported channel's credentials to memcode's .env keys and its allow-list to our channels.<name>.allow_from, and reports (never silently drops) anything it can't carry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseEnv ¶
ParseEnv reads a .env file's KEY=VALUE lines into a map, ignoring blanks, comments, and an optional "export " prefix. Used to lift tokens out of a Hermes ~/.hermes/.env for import.
func ProviderKeys ¶
ProviderKeys returns the subset of env holding a recognized provider API key with a non-empty value — what a migration should copy into memcode's global .env so the agent keeps talking to the same models. Channel bot tokens are NOT here; those come from the channel importer.
Types ¶
type Result ¶
Result is what an import produced: the non-secret settings to merge into gateway.yaml, the secrets to write to the global .env, and human-readable notes about anything that couldn't be carried automatically.
func FromHermes ¶
FromHermes maps a Hermes config.yaml plus its .env (parsed to env) into memcode's gateway config. Hermes and memcode share the same credential variable names, so tokens carry over directly; allowed_users becomes channels.<name>.allow_from.