{"id":20269898,"url":"https://github.com/teliosdev/command-runner","last_synced_at":"2026-06-03T22:31:07.169Z","repository":{"id":9051572,"uuid":"10817404","full_name":"teliosdev/command-runner","owner":"teliosdev","description":"Run commands.","archived":false,"fork":false,"pushed_at":"2015-02-21T05:52:23.000Z","size":357,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-26T23:50:25.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rdoc.info/github/redjazz96/command-runner","language":"Ruby","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/teliosdev.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}},"created_at":"2013-06-20T10:20:08.000Z","updated_at":"2020-08-25T01:58:09.000Z","dependencies_parsed_at":"2022-07-09T23:00:42.686Z","dependency_job_id":null,"html_url":"https://github.com/teliosdev/command-runner","commit_stats":null,"previous_names":["redjazz96/command-runner","medcat/command-runner"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/teliosdev/command-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teliosdev%2Fcommand-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teliosdev%2Fcommand-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teliosdev%2Fcommand-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teliosdev%2Fcommand-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teliosdev","download_url":"https://codeload.github.com/teliosdev/command-runner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teliosdev%2Fcommand-runner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33883102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-14T12:27:56.851Z","updated_at":"2026-06-03T22:31:07.150Z","avatar_url":"https://github.com/teliosdev.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Command Runner\n[![Build Status](https://travis-ci.org/medcat/command-runner.png?branch=master)](https://travis-ci.org/medcat/command-runner) [![Code Climate](https://codeclimate.com/github/medcat/command-runner.png)](https://codeclimate.com/github/medcat/command-runner) [![Gem Version](https://badge.fury.io/rb/command-runner.svg)](http://badge.fury.io/rb/command-runner)\n\nRuns commands.\n\n```Ruby\nrequire 'command/runner'\n\nline = Command::Runner.new(\"echo\", \"hello\")\nmessage = line.pass # =\u003e #\u003cCommand::Runner::Message:...\u003e\nmessage.exit_code   # =\u003e 0\nmessage.stdout      # =\u003e \"hello\\n\"\nmessage.time        # =\u003e 0.00091773\nmessage.process_id  # =\u003e 9622\nmessage.line        # =\u003e \"echo hello\"\n```\n\nwith interpolations...\n\n```Ruby\nline = Command::Runner.new(\"echo\", \"{interpolation}\")\nmessage = line.pass(:interpolation =\u003e \"watermelons\")\nmessage.stdout # =\u003e \"watermelons\\n\"\nmessage.line   # =\u003e \"echo watermelons\"\n```\n\nthat escapes bad stuff...\n\n```Ruby\nmessage = line.pass(:interpolation =\u003e \"`uname -a`\")\nmessage.stdout # =\u003e \"`uname -a`\\n\"\nmessage.line   # =\u003e \"echo \\\\`uname\\\\ -a\\\\`\"\n```\n\nunless you don't want it to.\n\n```Ruby\nline = Command::Runner.new(\"echo\", \"{{interpolation}}\")\nline.force_unsafe!\nmessage = line.pass(:interpolation =\u003e \"`uname -a`\")\nmessage.stdout # =\u003e \"Linux Hyperion 3.8.0-25-generic #37-Ubuntu SMP Thu Jun 6 20:47:07 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux\\n\"\nmessage.line   # =\u003e \"echo `uname -a`\"\n```\n\nIt can also use different methods to run commands...\n\n```Ruby\nline = Command::Runner.new(\"echo\", \"something\")\nline.backend = Command::Runner::Backends::Spawn.new\nline.pass\n```\n\nbut defaults to the best one.\n\nIf you run a command that doesn't exist on the machine...\n\n```Ruby\nline = Command::Runner.new(\"some-non-existant-command\", \"\")\n\nline.pass.no_command? # =\u003e true\n```\n\nit'll tell you.\n\nIt calls the given block...\n\n```Ruby\nline = Command::Runner.new(\"echo\", \"{something}\")\n\nline.pass(something: \"hello\") do |message|\n  message.stdout\nend # =\u003e \"hello\\n\"\n```\n\nand return the value.\n\n## Compatibility\nIt works on\n\n- 2.1.0\n- 2.0.0\n- 1.9.3\n- JRuby (2.0 Mode)\n- JRuby (1.9 Mode)\n\n\nunless the travis build fails.\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/medcat/command-runner/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteliosdev%2Fcommand-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteliosdev%2Fcommand-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteliosdev%2Fcommand-runner/lists"}