Openclawx code-runner
Executes code snippets by saving them to a temporary file and running them via bash commands (e.g., node, python, go run) to test logic or compute results.
install
source · Clone the upstream repo
git clone https://github.com/next-open-ai/openclawx
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/next-open-ai/openclawx "$T" && mkdir -p ~/.claude/skills && cp -r "$T/presets/workspaces/code-assistant/skills/code-runner" ~/.claude/skills/next-open-ai-openclawx-code-runner && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/next-open-ai/openclawx "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/presets/workspaces/code-assistant/skills/code-runner" ~/.openclaw/skills/next-open-ai-openclawx-code-runner && rm -rf "$T"
manifest:
presets/workspaces/code-assistant/skills/code-runner/SKILL.mdsource content
Code Runner Skill
Use this skill to quickly execute a piece of code to test logic, write a script for the user, or run built-in system tools.
Workflow
- Determine the language required (Node.js, Python, Shell, Go, etc.).
- Write the code snippet to a temporary file using the
tool (e.g., inwrite
)./tmp/test-script.js - Use the
tool to execute the script (e.g.,bash
).node /tmp/test-script.js - Capture the standard output and standard error.
- Provide the execution result to the user.
- Clean up the temporary file using
(bash
).rm /tmp/test-script.js
Example Usage
If the user asks "How do I reverse a string in JavaScript? Show me.", write a script with the solution, run it to verify it works, and show them both the code and the verified output.