#Does OpenClaw support Python
1 messages · Page 1 of 1 (latest)
Does OpenClaw support Python
You can put .py files in the OpenClaw workspace — OpenClaw doesn’t have a “supported file types” list. The confusion is usually about what OpenClaw can automatically execute/load as automation.
1) Hooks are TypeScript/Node, not Python
If you’re trying to make something run automatically via “hooks”, OpenClaw’s hooks system expects a hook folder like:
<workspace>/hooks/<hook-name>/HOOK.md<workspace>/hooks/<hook-name>/handler.ts
So a .py file in workspace/hookers won’t be discovered/run (also: the documented folder name is hooks, not hookers).
Docs:
- Hooks overview + structure: https://docs.openclaw.ai/automation/hooks
- Workspace layout: https://docs.openclaw.ai/concepts/agent-workspace
2) If you want to use Python anyway: run it from a hook (or via system.run)
Python isn’t a first-class hook runtime, but you can still:
- write a TS hook that spawns
python3 your_script.py, or
- have the agent run Python via
system.run(often through a node), assuming exec approvals/tool policy allow it.
3) For “store logs to MongoDB Atlas”
Two common approaches:
- Use the built-in
command-loggerhook (logs to a file), then run a separate shipper to push into Mongo. - Write a custom hook (TS) that sends events to an HTTP endpoint (your service) that writes to MongoDB Atlas.
If you tell me which event you want to log (every inbound message? only /new//reset? errors?), I can point you to the exact hook event (message:received, command:new, etc.) and the cleanest implementation path.