{"id":15171333,"url":"https://github.com/toolkithub/rce-runner","last_synced_at":"2025-04-24T01:46:37.059Z","repository":{"id":251954291,"uuid":"838939425","full_name":"ToolKitHub/rce-runner","owner":"ToolKitHub","description":"A command line application that reads code as a json payload from stdin – compiles and runs the code – and writes the result as json to stdout.","archived":false,"fork":false,"pushed_at":"2024-12-18T17:58:44.000Z","size":70,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T01:46:02.939Z","etag":null,"topics":["command-line-application","command-line-tool","nix","rust-embed","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ToolKitHub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-06T16:31:03.000Z","updated_at":"2025-01-01T20:51:20.000Z","dependencies_parsed_at":"2024-08-06T20:20:13.975Z","dependency_job_id":"7c6df1d2-8216-4715-87ee-c1e196fa08f1","html_url":"https://github.com/ToolKitHub/rce-runner","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"24589db61342d77428af50b41221ca506c77d1f8"},"previous_names":["toolkithub/rce-runner"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToolKitHub%2Frce-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToolKitHub%2Frce-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToolKitHub%2Frce-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToolKitHub%2Frce-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ToolKitHub","download_url":"https://codeload.github.com/ToolKitHub/rce-runner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546044,"owners_count":21448255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-application","command-line-tool","nix","rust-embed","rust-lang"],"created_at":"2024-09-27T09:00:43.412Z","updated_at":"2025-04-24T01:46:37.029Z","avatar_url":"https://github.com/ToolKitHub.png","language":"Nix","readme":"# rce-runner\n\n\u003e [!IMPORTANT]\n\u003e The release binary is used by [rce-images](https://github.com/ToolKitHub/rce-images) to run code.\n\nThis is a command line application that reads code as a\njson payload from stdin – compiles and runs the code – and writes\nthe result as json to stdout.\n\n## Prerequisites\n\nrce-runner requires that the compiler / interpreter for the languages\nyou want to run is installed and is in PATH.\n\n## Supported languages\n\n- Assembly\n- Ats\n- Bash\n- C\n- Clojure\n- Cobol\n- CoffeeScript\n- Cpp\n- Crystal\n- Csharp\n- D\n- Elixir\n- Elm\n- Erlang\n- Fsharp\n- Go\n- Groovy\n- Haskell\n- Idris\n- Java\n- JavaScript\n- Julia\n- Kotlin\n- Lua\n- Mercury\n- Nim\n- Ocaml\n- Perl\n- Php\n- Python\n- Raku\n- Ruby\n- Rust\n- SaC\n- Scala\n- Swift\n- TypeScript\n\n## Input (stdin)\n\nThe input is required to be a json object containing the properties `language`\nand `files`. `language` must be a lowecase string matching one of the supported\nlanguages. `files` must be an array with at least one object containing the\nproperties `name` and `content`. `name` is the name of the file and can include\nforward slashes to create the file in a subdirectory relative to the base\ndirectory. All files are written into the same base directory under the OS's\ntemp dir.\n\nIn addition, one may optionally provide the `stdin` and `command` properties to\nprovide stdin data to the running code and to run the code with a custom command.\nSee examples below.\n\n## Output (stdout)\n\nThe output is a json object containing the properties `stdout`, `stderr` and\n`error`. `stdout` and `stderr` is captured from the output of the ran code.\n`error` is popuplated if there is a compiler / interpreter error.\nNote that the rce-runner will exit with a non-zero code if invalid input is\ngiven or if the files cannot be written to disk (permissions, disk space, etc).\nNo json will be written to stdout in those cases. Otherwise the exit code is 0.\n\n## Examples\n\n### Simple example\n\n#### Input\n\n```javascript\n{\n  \"language\": \"python\",\n  \"files\": [\n    {\n      \"name\": \"main.py\",\n      \"content\": \"print(42)\"\n    }\n  ]\n}\n```\n\n##### Output\n\n```javascript\n{\n  \"stdout\": \"42\\n\",\n  \"stderr\": \"\",\n  \"error\": \"\"\n}\n```\n\n### Read from stdin\n\n##### Input\n\n```javascript\n{\n  \"language\": \"python\",\n  \"stdin\": \"42\",\n  \"files\": [\n    {\n      \"name\": \"main.py\",\n      \"content\": \"print(input('Number from stdin: '))\"\n    }\n  ]\n}\n```\n\n##### Output\n\n```javascript\n{\n  \"stdout\": \"Number from stdin: 42\\n\",\n  \"stderr\": \"\",\n  \"error\": \"\"\n}\n```\n\n### Custom run command\n\n##### Input\n\n```javascript\n{\n  \"language\": \"bash\",\n  \"command\": \"bash main.sh 42\",\n  \"files\": [\n    {\n      \"name\": \"main.sh\",\n      \"content\": \"echo Number from arg: $1\"\n    }\n  ]\n}\n```\n\n##### Output\n\n```javascript\n{\n  \"stdout\": \"Number from arg: 42\\n\",\n  \"stderr\": \"\",\n  \"error\": \"\"\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoolkithub%2Frce-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoolkithub%2Frce-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoolkithub%2Frce-runner/lists"}