https://github.com/chef/mixlib-shellout
mixin library for subprocess management, output collection
https://github.com/chef/mixlib-shellout
Keywords from Contributors
chef configuration-management discovery ohai cfgmgt deployment rubygems rack background-jobs sidekiq
Last synced: about 9 hours ago
JSON representation
Repository metadata
mixin library for subprocess management, output collection
- Host: GitHub
- URL: https://github.com/chef/mixlib-shellout
- Owner: chef
- License: apache-2.0
- Created: 2011-12-01T19:55:41.000Z (almost 15 years ago)
- Default Branch: main
- Last Pushed: 2026-08-28T20:12:37.000Z (27 days ago)
- Last Synced: 2026-09-02T06:35:07.712Z (23 days ago)
- Language: Ruby
- Homepage:
- Size: 1.11 MB
- Stars: 133
- Watchers: 61
- Forks: 73
- Open Issues: 12
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
- Copyright: COPYRIGHT.md
- Copilot: .github/copilot-instructions.md
README.md
Mixlib::ShellOut
Provides a simplified interface to shelling out while still collecting both standard out and standard error and providing full control over environment, working directory, uid, gid, etc.
Example
Simple Shellout
Invoke find(1) to search for .rb files:
require 'mixlib/shellout'
find = Mixlib::ShellOut.new("find . -name '*.rb'")
find.run_command
If all went well, the results are on stdout
puts find.stdout
find(1) prints diagnostic info to STDERR:
puts "error messages" + find.stderr
Raise an exception if it didn't exit with 0
find.error!
Advanced Shellout
In addition to the command to run there are other options that can be set to change the shellout behavior. The complete list of options can be found here: https://github.com/chef/mixlib-shellout/blob/master/lib/mixlib/shellout.rb
Run a command as the www user with no extra ENV settings from /tmp with a 1s timeout
cmd = Mixlib::ShellOut.new("apachectl", "start", :user => 'www', :environment => nil, :cwd => '/tmp', :timeout => 1)
cmd.run_command # etc.
STDIN Example
Invoke crontab to edit user cron:
# :input only supports simple strings
crontab_lines = [ "* * * * * /bin/true", "* * * * * touch /tmp/here" ]
crontab = Mixlib::ShellOut.new("crontab -l -u #{@new_resource.user}", :input => crontab_lines.join("\n"))
crontab.run_command
Windows Impersonation Example
Invoke "whoami.exe" to demonstrate running a command as another user:
whoami = Mixlib::ShellOut.new("whoami.exe", :user => "username", :domain => "DOMAIN", :password => "password")
whoami.run_command
Invoke "whoami.exe" with elevated privileges:
whoami = Mixlib::ShellOut.new("whoami.exe", :user => "username", :domain => "DOMAIN", :password => "password", :elevated => true)
whoami.run_command
NOTE: The user 'admin' must have the 'Log on as a batch job' permission and the user chef is running as must have the 'Replace a process level token' and 'Adjust Memory Quotas for a process' permissions.
Platform Support
Mixlib::ShellOut does a standard fork/exec on Unix, and uses the Win32 API on Windows. There is not currently support for JRuby.
See Also
Process.spawnin Ruby 1.9+- https://github.com/rtomayko/posix-spawn
Contributing
For information on contributing to this project see https://github.com/chef/chef/blob/master/CONTRIBUTING.md
License
- License:: Apache License, Version 2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright
See COPYRIGHT.md.
Owner metadata
- Name: Progress Chef
- Login: chef
- Email: ops@chef.io
- Kind: organization
- Description:
- Website: https://www.chef.io/
- Location: United States of America
- Twitter: chef
- Company:
- Icon url: https://avatars.githubusercontent.com/u/29740?v=4
- Repositories: 245
- Last ynced at: 2023-04-10T00:51:04.360Z
- Profile URL: https://github.com/chef
GitHub Events
Total
- Create event: 25
- Delete event: 2
- Fork event: 4
- Issue comment event: 68
- Issues event: 1
- Member event: 1
- Pull request event: 32
- Pull request review comment event: 10
- Pull request review event: 45
- Push event: 68
- Watch event: 5
Last Year
- Create event: 3
- Issue comment event: 4
- Pull request event: 3
- Pull request review comment event: 1
- Pull request review event: 9
- Push event: 13
- Watch event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 587
Total Committers: 66
Avg Commits per committer: 8.894
Development Distribution Score (DDS): 0.845
Commits in past year: 22
Committers in past year: 10
Avg Commits per committer in past year: 2.2
Development Distribution Score (DDS) in past year: 0.545
| Name | Commits | |
|---|---|---|
| Chef Expeditor | c****i@c****o | 91 |
| Ho-Sheng Hsiao | h****o@g****m | 81 |
| Tim Smith | t****h@c****o | 78 |
| Lamont Granquist | l****t@s****g | 45 |
| Daniel DeLeo | d****n@o****m | 42 |
| sersut | s****r@o****m | 21 |
| Matt Wrock | m****t@m****m | 19 |
| Moser, Kevin | K****r@n****m | 18 |
| Jay Mundrawala | j****a@g****m | 15 |
| rishichawda | r****a | 14 |
| Thomas Heinen | t****n@g****m | 11 |
| Bryan McLellan | b****m@l****g | 10 |
| Imanol-Mikel Barba Sabariego | i****l@i****t | 9 |
| Seth Chisamore | s****o@o****m | 9 |
| adamedx | a****d@o****m | 7 |
| kaustubh-d | k****h@c****m | 7 |
| Kartik Null Cating-Subramanian | k****n@c****o | 7 |
| Kapil Chouhan | k****n@m****m | 6 |
| Thom May | t****m@c****o | 5 |
| Chef Expeditor | e****r@c****o | 5 |
| John McCrae | j****e@p****m | 5 |
| dcrosby | d****y@m****m | 5 |
| Ryan Cragun | me@r****c | 4 |
| Phil Dibowitz | p****l@i****m | 4 |
| John McCrae | j****e@c****o | 4 |
| Thomas Powell | t****l@p****m | 3 |
| Nitz | n****z@g****m | 3 |
| Steven Murawski | s****i@g****m | 3 |
| Akshay Karle | a****e@g****m | 3 |
| jtimberman | j****a@o****m | 2 |
| and 36 more... | ||
Committer domains:
- opscode.com: 7
- chef.io: 5
- msystechnologies.com: 5
- progress.com: 5
- getchef.com: 2
- scriptkiddie.org: 1
- mattwrock.com: 1
- nordstrom.com: 1
- loftninjas.org: 1
- imanolbarba.net: 1
- clogeny.com: 1
- meta.com: 1
- ryan.ec: 1
- ipom.com: 1
- chf.io: 1
- secondmarket.com: 1
- visioncritical.com: 1
- gerf.org: 1
- devopsy.com: 1
- gilbertsanchez.com: 1
- tylercipriani.com: 1
- zenspider.com: 1
- peterhiggins.org: 1
- bluereef.com.au: 1
- fb.com: 1
- osuosl.org: 1
- coderanger.net: 1
- martinisoftware.com: 1
- terceiro.xyz: 1
- socrata.com: 1
- johnkeiser.com: 1
- magoazul.com: 1
Issue and Pull Request metadata
Last synced: about 9 hours ago
Total issues: 27
Total pull requests: 143
Average time to close issues: about 1 year
Average time to close pull requests: about 2 months
Total issue authors: 21
Total pull request authors: 33
Average comments per issue: 1.3
Average comments per pull request: 1.17
Merged pull request: 112
Bot issues: 4
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 13
Past year average time to close issues: N/A
Past year average time to close pull requests: about 2 months
Past year issue authors: 1
Past year pull request authors: 8
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.69
Past year merged pull request: 9
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- dependabot-preview[bot] (4)
- coderanger (3)
- lamont-granquist (2)
- Ankitr19 (1)
- gshively11 (1)
- skylerto (1)
- dg42xyz (1)
- zealws (1)
- jaymzh (1)
- pbobov (1)
- vanessazou (1)
- Doltair (1)
- taqtiqa-mark (1)
- clintoncwolfe (1)
- yanivmn (1)
Top Pull Request Authors
- tas50 (37)
- lamont-granquist (17)
- dafyddcrosby (13)
- rishichawda (11)
- thheinen (9)
- johnmccrae (8)
- jaymzh (6)
- sean-sype-simmons (3)
- kapilchouhan99 (3)
- cgunasree08 (3)
- tpowell-progress (3)
- HeyItsGilbert (2)
- clintoncwolfe (2)
- poorndm (2)
- skeshari12 (2)
Top Issue Labels
- Type: Bug (10)
- Status: Untriaged (6)
- Triage: Feature Request (3)
- Type: Enhancement (2)
- Platform: Windows (1)
- Type: Tech Debt (1)
Top Pull Request Labels
- Expeditor: Bump Version Minor (9)
- Expeditor: Skip All (8)
- oss-standards (5)
- Status: Waiting on Contributor (5)
- Expeditor: Skip Changelog (4)
- Type: Bug (2)
- Platform: Windows (2)
- ai-assisted (2)
- Expeditor: Skip Version Bump (1)
- Aspect: Testing (1)
- Aspect: Documentation (1)
- Triage: Needs Information (1)
Package metadata
- Total packages: 14
-
Total downloads:
- rubygems: 188,133,539 total
- Total docker downloads: 926,365,160
- Total dependent packages: 148 (may contain duplicates)
- Total dependent repositories: 9,837 (may contain duplicates)
- Total versions: 314
- Total maintainers: 5
gem.coop: mixlib-shellout
Run external commands on Unix or Windows
- Homepage: https://github.com/chef/mixlib-shellout
- Documentation: http://www.rubydoc.info/gems/mixlib-shellout/
- Licenses: Apache-2.0
- Latest release: 3.4.10 (published 8 months ago)
- Last Synced: 2026-09-24T17:11:07.784Z (about 9 hours ago)
- Versions: 116
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 94,089,128 Total
- Docker Downloads: 463,182,580
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.131%
- Docker downloads count: 0.23%
- Downloads: 0.296%
- Maintainers (5)
rubygems.org: mixlib-shellout
Run external commands on Unix or Windows
- Homepage: https://github.com/chef/mixlib-shellout
- Documentation: http://www.rubydoc.info/gems/mixlib-shellout/
- Licenses: Apache-2.0
- Latest release: 3.4.10 (published 8 months ago)
- Last Synced: 2026-09-23T17:03:02.552Z (1 day ago)
- Versions: 116
- Dependent Packages: 148
- Dependent Repositories: 9,837
- Downloads: 94,044,411 Total
- Docker Downloads: 463,182,580
-
Rankings:
- Dependent packages count: 0.232%
- Docker downloads count: 0.283%
- Dependent repos count: 0.336%
- Downloads: 0.344%
- Average: 1.512%
- Forks count: 3.048%
- Stargazers count: 4.827%
- Maintainers (5)
proxy.golang.org: github.com/chef/mixlib-shellout
- Homepage:
- Documentation: https://pkg.go.dev/github.com/chef/mixlib-shellout#section-documentation
- Licenses: apache-2.0
- Latest release: v3.4.14+incompatible (published 27 days ago)
- Last Synced: 2026-09-23T01:55:47.812Z (2 days ago)
- Versions: 70
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 2.935%
- Stargazers count: 4.193%
- Average: 6.877%
- Dependent packages count: 9.576%
- Dependent repos count: 10.802%
ubuntu-23.10: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Status: removed
- Licenses: apache-2.0
- Latest release: 3.2.5-2 (published 7 months ago)
- Last Synced: 2026-09-13T21:26:15.504Z (11 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
gentoo-portage: dev-ruby/mixlib-shellout
Run external commands on Unix or Windows
- Homepage: https://github.com/chef/mixlib-shellout
- Documentation: https://packages.gentoo.org/packages/dev-ruby/mixlib-shellout
- Licenses: Apache-2.0
- Latest release: 3.4.13 (published 2 months ago)
- Last Synced: 2026-07-28T01:17:17.188Z (about 2 months ago)
- Versions: 2
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.0.9-2 (published 7 months ago)
- Last Synced: 2026-08-10T00:03:08.962Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.10: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.2.5-2 (published 8 months ago)
- Last Synced: 2026-08-02T12:10:20.654Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
pkgsrc-netbsd-x86_64-10.1-all: devel/ruby-mixlib-shellout
Mixin library for subprocess management
- Homepage: https://github.com/chef/mixlib-shellout
- Documentation: https://pkgsrc.se/devel/ruby-mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.4.10 (published 6 months ago)
- Last Synced: 2026-05-27T06:46:30.373Z (4 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.2.5-2 (published 8 months ago)
- Last Synced: 2026-07-25T15:03:41.478Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.04: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.2.5-2 (published 8 months ago)
- Last Synced: 2026-03-06T16:49:19.223Z (7 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-22.04: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.2.5-2 (published 7 months ago)
- Last Synced: 2026-07-31T04:02:52.711Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Documentation: https://packages.debian.org/bullseye/ruby-mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.0.9-2 (published 8 months ago)
- Last Synced: 2026-03-14T07:16:30.196Z (6 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Documentation: https://packages.debian.org/bookworm/ruby-mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.2.5-2 (published 7 months ago)
- Last Synced: 2026-03-13T23:45:10.525Z (7 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Documentation: https://packages.debian.org/trixie/ruby-mixlib-shellout
- Licenses: apache-2.0
- Latest release: 3.2.5-2 (published 7 months ago)
- Last Synced: 2026-03-14T18:10:35.041Z (6 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- chefstyle = 1.6.2 development
- pry >= 0 development
- pry-byebug >= 0 development
- rake >= 0 development
- rb-readline >= 0 development
- rspec ~> 3.0 development
- chef-utils < 16.7.23
- ffi-win32-extensions ~> 1.0.4
- win32-process ~> 0.9
- wmi-lite ~> 1.0.7
- ffi-win32-extensions ~> 1.0.3
- win32-process ~> 0.9
- wmi-lite ~> 1.0
- chef-utils >= 0
- wechuli/allcheckspassed v1 composite
- actionshub/dco main composite
- actionshub/get-pr-commits main composite
- actions/checkout v6 composite
- fernandrone/linelint master composite
- r7kamura/rubocop-problem-matchers-action v1 composite
- ruby/setup-ruby v1 composite
- streetsidesoftware/cspell-action v8.4.0 composite
Score: 29.998068585511554