Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计提醒

code-runner代码运行者

Agent Skill

code-runner 用于辅助 Python 项目开发、测试和数据处理,适合在 OpenClaw 中需要阅读 Python 代码、运行测试或整理脚本流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

52,604

周安装

2,128

GitHub Stars

公开资料未说明

下载量

16,513
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-runner(代码运行者)
来源仓库:https://github.com/formulahendry/code-runner
安装命令:
openclaw skills install code-runner
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install code-runner

简介

支持 30+ 编程语言的在线代码执行环境,便于快速验证片段。

  • 适合在开发过程中测试算法逻辑或调试小型脚本。
  • 无需本地配置即可运行 JavaScript、Python、Java 等主流语言。
  • 注意部分语言可能需要额外依赖包才能正常运行。
  • 建议限制执行时间和资源使用以防止意外消耗。code-runner 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
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 to execute code, test algorithms, verify output, run scripts, or check code behavior. Supports both interpreted and compiled languages.

Code Runner Skill

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

When to Use This Skill

Use this skill when:

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

Supported Languages

The following languages are supported (requires the interpreter/compiler to be installed):

LanguageCommandFile Extension
JavaScriptnode.js
TypeScriptts-node.ts
Pythonpython.py
Javajava (compile & run).java
Cgcc (compile & run).c
C++g++ (compile & run).cpp
Gogo run.go
Rustrustc (compile & run).rs
Rubyruby.rb
PHPphp.php
Perlperl.pl
Lualua.lua
RRscript.r
Swiftswift.swift
Kotlinkotlin.kts
Scalascala.scala
Groovygroovy.groovy
Dartdart.dart
Juliajulia.jl
Haskellrunhaskell.hs
Clojureclojure.clj
F#dotnet fsi.fsx
C#dotnet script.csx
PowerShellpwsh.ps1
Bashbash.sh
Batchcmd /c.bat
CoffeeScriptcoffee.coffee
Crystalcrystal.cr
Elixirelixir.exs
Nimnim compile --run.nim
OCamlocaml.ml
Racketracket.rkt
Schemescheme.scm
Lispsbcl --script.lisp

See references/LANGUAGES.md for detailed language configuration.

How to Run Code

Step 1: Identify the Language

Determine the programming language from:

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

Step 2: Execute Using the Runner Script

⚠️ Important for AI Agents: Use stdin to avoid escaping issues with quotes, backslashes, and special characters.

Recommended Method (stdin):

echo "<code>" | node scripts/run-code.cjs <languageId>

Alternative Method (CLI argument - for simple code only):

node scripts/run-code.cjs <languageId> "<code>"

Example - JavaScript:

echo "console.log('Hello, World!')" | node scripts/run-code.cjs javascript

Example - Python:

echo "print('Hello, World!')" | node scripts/run-code.cjs python

Example - Java (multi-line):

echo "public class Test {
    public static void main(String[] args) {
        System.out.println(\"Hello from Java!\");
    }
}" | node scripts/run-code.cjs java

Example - Multi-line code from variable:

# In bash
CODE='import math
print("Pi:", math.pi)
print("Result:", math.factorial(5))'
echo "$CODE" | node scripts/run-code.cjs python

# In PowerShell (inline here-string)
@"
import math
print("Pi:", math.pi)
print("Result:", math.factorial(5))
"@ | node scripts/run-code.cjs python

Step 3: Return Results

  • Show the output (stdout) to the user
  • If there are errors (stderr), explain what went wrong
  • Suggest fixes for common errors

Platform Notes

Windows

  • Use cmd /c for batch scripts
  • PowerShell scripts require pwsh or powershell
  • Path separators use backslash \

macOS / Linux

  • Bash scripts work natively
  • Swift available on macOS
  • Use #!/usr/bin/env shebang for portable scripts

Error Handling

Common issues and solutions:

  1. Command not found: The language interpreter is not installed or not in PATH

- Suggest installing the required runtime - Provide installation instructions

  1. Syntax errors: Code has syntax issues

- Show the error message - Point to the line number if available

  1. Runtime errors: Code runs but fails during execution

- Display the stack trace - Explain the error type

  1. Timeout: Code takes too long (default: 30 seconds)

- Warn about infinite loops - Suggest optimizations

Security Considerations

⚠️ Important: Running arbitrary code can be dangerous. Always:

  1. Review the code before execution
  2. Be cautious with code that:

- Accesses the file system - Makes network requests - Executes system commands - Modifies environment variables

  1. Consider running in a sandboxed environment for untrusted code

Examples

Example 1: Run a JavaScript calculation

echo "console.log(Array.from({length: 10}, (_, i) => i * i))" | node scripts/run-code.cjs javascript

Output: [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

Example 2: Run Python with imports

echo "import math; print(math.factorial(10))" | node scripts/run-code.cjs python

Output: 3628800

Example 3: Test a Go function

echo 'package main; import "fmt"; func main() { fmt.Println("Hello from Go!") }' | node scripts/run-code.cjs go

Output: Hello from Go!

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

76.32%
按下载量换算12,603

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills