← Back to Skills Marketplace
formulahendry

Code Runner

by formulahendry · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
1589
Downloads
0
Stars
10
Active Installs
1
Versions
Install in OpenClaw
/install code-runner
Description
Run code snippets in 30+ programming languages including JavaScript, Python, TypeScript, Java, C, C++, Go, Rust, Ruby, PHP, and more. Use when the user wants...
README (SKILL.md)

\r \r

Code Runner Skill\r

\r This skill enables you to run code snippets in multiple programming languages directly from the command line.\r \r

When to Use This Skill\r

\r Use this skill when:\r

  • The user wants to run or execute a code snippet\r
  • Testing algorithm implementations or logic\r
  • Verifying expected output of code\r
  • Running quick scripts or one-liners\r
  • Checking syntax or runtime behavior\r
  • Demonstrating code functionality\r \r

Supported Languages\r

\r The following languages are supported (requires the interpreter/compiler to be installed):\r \r | Language | Command | File Extension |\r |----------|---------|----------------|\r | JavaScript | node | .js |\r | TypeScript | ts-node | .ts |\r | Python | python | .py |\r | Java | java (compile & run) | .java |\r | C | gcc (compile & run) | .c |\r | C++ | g++ (compile & run) | .cpp |\r | Go | go run | .go |\r | Rust | rustc (compile & run) | .rs |\r | Ruby | ruby | .rb |\r | PHP | php | .php |\r | Perl | perl | .pl |\r | Lua | lua | .lua |\r | R | Rscript | .r |\r | Swift | swift | .swift |\r | Kotlin | kotlin | .kts |\r | Scala | scala | .scala |\r | Groovy | groovy | .groovy |\r | Dart | dart | .dart |\r | Julia | julia | .jl |\r | Haskell | runhaskell | .hs |\r | Clojure | clojure | .clj |\r | F# | dotnet fsi | .fsx |\r | C# | dotnet script | .csx |\r | PowerShell | pwsh | .ps1 |\r | Bash | bash | .sh |\r | Batch | cmd /c | .bat |\r | CoffeeScript | coffee | .coffee |\r | Crystal | crystal | .cr |\r | Elixir | elixir | .exs |\r | Nim | nim compile --run | .nim |\r | OCaml | ocaml | .ml |\r | Racket | racket | .rkt |\r | Scheme | scheme | .scm |\r | Lisp | sbcl --script | .lisp |\r \r See references/LANGUAGES.md for detailed language configuration.\r \r

How to Run Code\r

\r

Step 1: Identify the Language\r

\r Determine the programming language from:\r

  • User's explicit request (e.g., "run this Python code")\r
  • File extension if provided\r
  • Code syntax patterns\r \r

Step 2: Execute Using the Runner Script\r

\r ⚠️ Important for AI Agents: Use stdin to avoid escaping issues with quotes, backslashes, and special characters.\r \r Recommended Method (stdin):\r

echo "\x3Ccode>" | node scripts/run-code.cjs \x3ClanguageId>\r
```\r
\r
**Alternative Method (CLI argument - for simple code only):**\r
```bash\r
node scripts/run-code.cjs \x3ClanguageId> "\x3Ccode>"\r
```\r
\r
**Example - JavaScript:**\r
```bash\r
echo "console.log('Hello, World!')" | node scripts/run-code.cjs javascript\r
```\r
\r
**Example - Python:**\r
```bash\r
echo "print('Hello, World!')" | node scripts/run-code.cjs python\r
```\r
\r
**Example - Java (multi-line):**\r
```bash\r
echo "public class Test {\r
    public static void main(String[] args) {\r
        System.out.println(\"Hello from Java!\");\r
    }\r
}" | node scripts/run-code.cjs java\r
```\r
\r
**Example - Multi-line code from variable:**\r
```bash\r
# In bash\r
CODE='import math\r
print("Pi:", math.pi)\r
print("Result:", math.factorial(5))'\r
echo "$CODE" | node scripts/run-code.cjs python\r
\r
# In PowerShell (inline here-string)\r
@"\r
import math\r
print("Pi:", math.pi)\r
print("Result:", math.factorial(5))\r
"@ | node scripts/run-code.cjs python\r
```\r
\r
### Step 3: Return Results\r
\r
- Show the output (stdout) to the user\r
- If there are errors (stderr), explain what went wrong\r
- Suggest fixes for common errors\r
\r
## Platform Notes\r
\r
### Windows\r
- Use `cmd /c` for batch scripts\r
- PowerShell scripts require `pwsh` or `powershell`\r
- Path separators use backslash `\`\r
\r
### macOS / Linux\r
- Bash scripts work natively\r
- Swift available on macOS\r
- Use `#!/usr/bin/env` shebang for portable scripts\r
\r
## Error Handling\r
\r
Common issues and solutions:\r
\r
1. **Command not found**: The language interpreter is not installed or not in PATH\r
   - Suggest installing the required runtime\r
   - Provide installation instructions\r
\r
2. **Syntax errors**: Code has syntax issues\r
   - Show the error message\r
   - Point to the line number if available\r
\r
3. **Runtime errors**: Code runs but fails during execution\r
   - Display the stack trace\r
   - Explain the error type\r
\r
4. **Timeout**: Code takes too long (default: 30 seconds)\r
   - Warn about infinite loops\r
   - Suggest optimizations\r
\r
## Security Considerations\r
\r
⚠️ **Important**: Running arbitrary code can be dangerous. Always:\r
\r
1. Review the code before execution\r
2. Be cautious with code that:\r
   - Accesses the file system\r
   - Makes network requests\r
   - Executes system commands\r
   - Modifies environment variables\r
3. Consider running in a sandboxed environment for untrusted code\r
\r
## Examples\r
\r
### Example 1: Run a JavaScript calculation\r
```bash\r
echo "console.log(Array.from({length: 10}, (_, i) => i * i))" | node scripts/run-code.cjs javascript\r
```\r
Output: `[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]`\r
\r
### Example 2: Run Python with imports\r
```bash\r
echo "import math; print(math.factorial(10))" | node scripts/run-code.cjs python\r
```\r
Output: `3628800`\r
\r
### Example 3: Test a Go function\r
```bash\r
echo 'package main; import "fmt"; func main() { fmt.Println("Hello from Go!") }' | node scripts/run-code.cjs go\r
```\r
Output: `Hello from Go!`\r
Usage Guidance
This skill is internally consistent: it runs code by creating temp files and calling your local language runtimes, which is exactly what a 'code runner' should do. However, running arbitrary code executes with the same privileges as the agent — code can read files, access environment variables, make network requests, and run system commands. Before installing or using it: (1) only run code you trust or run the skill inside a sandbox/container with restricted network and file access; (2) review or test the runner script (scripts/run-code.cjs) — it has a minor bug (uses Date.now without invoking it when forming an output filename) that may affect compiled output naming; (3) ensure interpreters/compilers are present on the host and that the 30s default timeout is acceptable; (4) do not feed sensitive secrets into code executed by this skill. If you need higher assurance, request a full audit of the complete run-code.cjs file and a runbook for safe sandboxing.
Capability Analysis
Type: OpenClaw Skill Name: code-runner Version: 0.1.0 The 'code-runner' skill provides a mechanism to execute arbitrary code in over 30 programming languages by directly invoking system-level interpreters and compilers via `child_process.exec` in `scripts/run-code.cjs`. While the behavior is consistent with the stated purpose in `SKILL.md`, the skill lacks any sandboxing or isolation, allowing executed snippets full access to the host's file system, network, and environment variables. This high-risk capability, coupled with the potential for shell injection if the agent provides unsanitized input, poses a significant security risk to the host environment, although no evidence of intentional malice or hardcoded exfiltration was found.
Capability Assessment
Purpose & Capability
Name/description match the included script and documentation: the skill ships a runner script that writes code to temp files and invokes language runtimes/compilers. It does not request unrelated credentials, binaries, or config paths.
Instruction Scope
SKILL.md limits actions to executing code via the provided script and recommends using stdin; it explicitly warns about security risks (file access, network calls, system commands). The instructions do not instruct the agent to read unrelated files or credentials. However, because the skill's purpose is executing arbitrary code, the runtime can access any files/environment available to the agent — this is expected but important to note.
Install Mechanism
No install spec; the skill is instruction-only plus a local Node.js script. Nothing is downloaded from external URLs. The only artifact is scripts/run-code.cjs which will execute when invoked.
Credentials
The skill requires no environment variables or external credentials. It does, however, execute user-supplied code which can itself read environment variables or network endpoints — the SKILL.md calls this out. No unexpected secret access is requested by the skill itself.
Persistence & Privilege
The skill does not request always: true and is user-invocable only. It does not modify other skills or system-wide configuration. Autonomous invocation is allowed by default but not combined with other concerning privileges here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install code-runner
  3. After installation, invoke the skill by name or use /code-runner
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
- Initial release of the code-runner skill. - Run code snippets in 30+ programming languages including JavaScript, Python, Java, C, Go, Rust, Ruby, PHP, and more. - Supports both interpreted and compiled languages. - Securely execute code via stdin to avoid escaping issues. - Provides error handling, language detection tips, and platform-specific notes. - Includes usage examples and security guidance.
Metadata
Slug code-runner
Version 0.1.0
License MIT-0
All-time Installs 12
Active Installs 10
Total Versions 1
Frequently Asked Questions

What is Code Runner?

Run code snippets in 30+ programming languages including JavaScript, Python, TypeScript, Java, C, C++, Go, Rust, Ruby, PHP, and more. Use when the user wants... It is an AI Agent Skill for Claude Code / OpenClaw, with 1589 downloads so far.

How do I install Code Runner?

Run "/install code-runner" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Code Runner free?

Yes, Code Runner is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Code Runner support?

Code Runner is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Code Runner?

It is built and maintained by formulahendry (@formulahendry); the current version is v0.1.0.

💬 Comments