Skip to main content

ClawHive platform adapter plugin for Hermes Agent

Project description

ClawHive Hermes Plugin

This plugin lets a Hermes runtime register as a ClawHive runtime node, sync Hermes profiles into ClawHive, receive ClawHive user messages through the Hermes platform adapter connection, and write Hermes replies back through the ClawHive message API. It is shaped for the Hermes directory plugin loader: plugin.yaml plus a root __init__.py that exposes register(ctx).

Install Locally

Copy this directory into a Hermes plugin path:

mkdir -p ~/.hermes/plugins/clawhive
cp -R hermes-plugin/* ~/.hermes/plugins/clawhive/

Install From a Local Wheel

The plugin is packaged as a Python distribution because Hermes plugins are Python modules. Build and install it locally before publishing to PyPI:

cd hermes-plugin
python -m build
python -m pip install dist/clawhive_hermes_plugin-0.1.2-py3-none-any.whl

Hermes can discover the package when the wheel is installed into the same Python environment that runs Hermes, through the hermes_agent.plugins entry point:

python - <<'PY'
import importlib.metadata as md
print(md.entry_points().select(group="hermes_agent.plugins")["clawhive"])
PY

For end-user installs where the package may be installed outside the Hermes virtual environment, use the packaged installer to create a normal Hermes directory plugin:

clawhive-hermes install
hermes plugins enable clawhive

Re-run with --force to replace an existing ~/.hermes/plugins/clawhive directory.

Authorize Locally

Enable the plugin in Hermes, then run the ClawHive authorization command:

hermes clawhive authorize

This starts the same ClawHive device-code authorization flow used by the OpenClaw plugin: Hermes prints a QR code and fallback code, the user scans it in the already signed-in ClawHive app and explicitly approves the displayed node, and the command stores the returned plugin token in the Hermes .env file. The approval also pairs the scanning phone to this node. Restart the Hermes gateway after authorization so the platform adapter can call plugin-register and sync agents.

Status can be checked with:

hermes clawhive status

To move Hermes to another ClawHive account, first preview and then confirm the unlink:

hermes clawhive unlink
hermes clawhive unlink --yes

Hermes and OpenClaw share the phone's single ClawHive device record. If OpenClaw remains linked, Hermes can be authorized again only with the same account. Unlink every runtime that still uses the phone before authorizing Hermes with a different account. When Hermes is the last linked runtime, unlink releases the phone for either the original or a different account. The command preserves project URL, anon key, node name, plugin version, and unrelated Hermes settings while removing the revoked runtime identity.

Required Runtime Environment

Managed-cloud installs use the built-in ClawHive Supabase URL and anon key. For local or self-hosted Supabase, override them before authorization:

export CLAWHIVE_SUPABASE_MODE="local"
export CLAWHIVE_PROJECT_URL="https://<project>.supabase.co"
export CLAWHIVE_SUPABASE_ANON_KEY="<anon key>"

Normally hermes clawhive authorize writes the resolved project URL, anon key, and plugin token to $HERMES_HOME/.env; set them manually only for local testing or automation.

Optional values:

export CLAWHIVE_NODE_NAME="Hermes Desktop"
export CLAWHIVE_PLUGIN_VERSION="0.1.2"
export CLAWHIVE_USER_ID="<user uuid>"
export CLAWHIVE_PLUGIN_NODE_ID="<existing node uuid>"

Agent Registration

ClawHive follows the Hermes platform plugin flow. Hermes loads plugin.yaml, calls register(ctx), and creates ClawHivePlatformAdapter through ctx.register_platform(...). When the adapter connects, it registers the Hermes runtime node with ClawHive and syncs serviceable Hermes profiles as ClawHive agents.

Hermes profiles are discovered through Hermes profile APIs. With gateway profile multiplexing enabled, the adapter syncs all serviceable profiles. Without multiplexing, it syncs the active/default profile only.

Message Routing

ClawHivePlatformAdapter.send(chat_id, text) writes an agent message with:

chat_id = <session_id>:<agent_id>

If Hermes supplies session metadata separately, pass session_id and agent_id as keyword arguments instead of encoding them into chat_id.

Inbound messages are received by the platform adapter's connect() flow through the ClawHive Realtime bridge. The adapter converts user messages into Hermes MessageEvent values and dispatches them through self.handle_message(event).

poll_session(session_id) is a local debug/fallback helper. It is not the product message receive path.

Local Verification

From the repository root:

python3 -m pytest hermes-plugin/tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clawhive_hermes_plugin-0.1.2.tar.gz (51.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clawhive_hermes_plugin-0.1.2-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file clawhive_hermes_plugin-0.1.2.tar.gz.

File metadata

  • Download URL: clawhive_hermes_plugin-0.1.2.tar.gz
  • Upload date:
  • Size: 51.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for clawhive_hermes_plugin-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a36eac1187231dcb3e85b607fe9bd50c9281db16bca427a09ab0dd768791cfdc
MD5 2de72159910f4ec23da840b321e4da4b
BLAKE2b-256 1acf8789af6af455527cacb04126963007a08a84c7e05d4cbe1b079abd4b4f75

See more details on using hashes here.

File details

Details for the file clawhive_hermes_plugin-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for clawhive_hermes_plugin-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a0b94007c0b19a95e29d8d5450869b2c534e7b9451c6f7c9b2418adf9a65b0a
MD5 3786543fa97a94f83dc6da031735e7b6
BLAKE2b-256 19419903dc0039377170a845a1d91e3ba25bc5572fb254d493c236b0cdd9615b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page