← Back to Skills Marketplace
panchenbo

Code Runner Local

by panchenbo · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
318
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install code-runner-local
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 appears to do what it claims, but it executes code on the host — treat it like running programs locally. Before installing/using: 1) Do not run untrusted code. Review snippets before execution or run the skill inside an isolated sandbox/container or VM. 2) Ensure interpreters/compilers you expect are installed and kept up to date. 3) Be aware temp files and compiled binaries are written to the system temp directory (shared with other processes); sensitive data in code could be recoverable. 4) The included script uses child_process.exec and spawns compilers/interpreters (normal for this tool) and sets a 30s default timeout; long-running or resource-heavy code may be killed or may consume host resources — consider stricter time/resource limits if needed. 5) Implementation notes for reviewers: the script contains a minor bug where outputFile uses Date.now without invoking it (Date.now instead of Date.now()), which may lead to odd filenames; cleanup attempts are limited to files created by the script and may not cover all side-effects of executed code. If you need safer execution of untrusted code, run the skill only inside a dedicated sandbox with network and filesystem restrictions.
Capability Analysis
Type: OpenClaw Skill Name: code-runner-local Version: 1.0.0 The skill provides a broad capability to execute arbitrary code in over 30 programming languages, including shell scripts (bash, powershell, cmd), using child_process.exec in scripts/run-code.cjs. While this aligns with its stated purpose as a 'Code Runner', the inherent risk of arbitrary command execution without built-in sandboxing makes it a high-risk tool. Although SKILL.md includes security warnings, the script provides a direct path for potential system compromise or data exfiltration if the AI agent is manipulated into running malicious snippets.
Capability Assessment
Purpose & Capability
The name/description (run code in many languages) matches the included script and instructions. The skill only relies on local interpreters/compilers (described in LANGUAGES.md) and does not request unrelated services or credentials.
Instruction Scope
The SKILL.md correctly instructs the agent to send code via stdin or CLI args to the included Node script, and describes expected outputs and security cautions. The instructions and code explicitly write temporary files to the system temp directory and spawn compilers/interpreters, which is expected for this purpose. Note: the runtime script will execute whatever code is provided (including filesystem/network/system commands) — that is inherent to the skill and is a security risk for untrusted input. Also the script has a minor bug/oddity (see user guidance) and does not implement strong sandboxing or resource isolation.
Install Mechanism
There is no external install spec and the package is instruction-only with a single local Node script; no remote downloads or archives are fetched during install. This is low-risk from an installation standpoint.
Credentials
The skill does not request environment variables, credentials, or config paths. It uses process.platform and standard Node APIs only; no secret access is required or requested.
Persistence & Privilege
The skill is user-invocable and not always-enabled. It does not try to persist credentials or modify other skills. It creates temporary files in the system temp directory during execution, which is expected but means the executed code runs with the agent's host privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install code-runner-local
  3. After installation, invoke the skill by name or use /code-runner-local
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of the Code Runner skill. - Run code snippets in over 30 programming languages, including JavaScript, Python, Java, C/C++, Go, Rust, and more. - Supports both interpreted and compiled languages via command line. - Provides guidelines for identifying language, executing code, and handling output/errors. - Includes detailed instructions and examples for running code in different environments (Windows, macOS, Linux). - Emphasizes security with recommendations for running untrusted code. - Offers troubleshooting tips for common issues like missing interpreters or code errors.
Metadata
Slug code-runner-local
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Code Runner Local?

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 318 downloads so far.

How do I install Code Runner Local?

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

Is Code Runner Local free?

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

Which platforms does Code Runner Local support?

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

Who created Code Runner Local?

It is built and maintained by panchenbo (@panchenbo); the current version is v1.0.0.

💬 Comments