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 24 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 (over 14 years ago)
- Default Branch: main
- Last Pushed: 2026-07-15T19:59:07.000Z (11 days ago)
- Last Synced: 2026-07-20T09:05:35.497Z (6 days ago)
- Language: Ruby
- Homepage:
- Size: 1.1 MB
- Stars: 133
- Watchers: 61
- Forks: 73
- Open Issues: 9
- 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
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
- Delete event: 2
- Member event: 1
- Pull request event: 32
- Fork event: 4
- Issues event: 1
- Watch event: 5
- Issue comment event: 68
- Push event: 68
- Pull request review comment event: 10
- Pull request review event: 45
- Create event: 25
Last Year
- Pull request event: 5
- Watch event: 1
- Issue comment event: 6
- Push event: 18
- Pull request review comment event: 1
- Pull request review event: 9
- Create event: 6
Committers metadata
Last synced: 2 days ago
Total Commits: 584
Total Committers: 66
Avg Commits per committer: 8.848
Development Distribution Score (DDS): 0.846
Commits in past year: 23
Committers in past year: 9
Avg Commits per committer in past year: 2.556
Development Distribution Score (DDS) in past year: 0.522
| Name | Commits | |
|---|---|---|
| Chef Expeditor | c****i@c****o | 90 |
| Ho-Sheng Hsiao | h****o@g****m | 81 |
| Tim Smith | t****h@c****o | 77 |
| 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 |
| 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 |
| Nimisha Sharad | n****d@m****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
- zenspider.com: 1
- peterhiggins.org: 1
- gerf.org: 1
- devopsy.com: 1
- gilbertsanchez.com: 1
- tylercipriani.com: 1
- coderanger.net: 1
- magoazul.com: 1
- bluereef.com.au: 1
- fb.com: 1
- osuosl.org: 1
- martinisoftware.com: 1
- terceiro.xyz: 1
- socrata.com: 1
- johnkeiser.com: 1
Issue and Pull Request metadata
Last synced: 10 days ago
Total issues: 27
Total pull requests: 138
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.21
Merged pull request: 110
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: 2 months
Past year issue authors: 1
Past year pull request authors: 7
Past year average comments per issue: 0.0
Past year average comments per pull request: 1.31
Past year merged pull request: 11
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 (33)
- lamont-granquist (17)
- dafyddcrosby (13)
- rishichawda (11)
- thheinen (9)
- johnmccrae (8)
- jaymzh (6)
- sean-sype-simmons (3)
- kapilchouhan99 (3)
- cgunasree08 (3)
- HeyItsGilbert (2)
- clintoncwolfe (2)
- poorndm (2)
- tpowell-progress (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)
- Status: Waiting on Contributor (5)
- oss-standards (5)
- Expeditor: Skip Changelog (4)
- Type: Bug (2)
- Platform: Windows (2)
- Expeditor: Skip Version Bump (1)
- Aspect: Testing (1)
- ai-assisted (1)
- Aspect: Documentation (1)
- Triage: Needs Information (1)
Package metadata
- Total packages: 14
-
Total downloads:
- rubygems: 184,784,569 total
- Total docker downloads: 926,365,160
- Total dependent packages: 148 (may contain duplicates)
- Total dependent repositories: 9,837 (may contain duplicates)
- Total versions: 312
- 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 6 months ago)
- Last Synced: 2026-07-15T22:31:36.024Z (11 days ago)
- Versions: 116
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 92,371,088 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 6 months ago)
- Last Synced: 2026-07-17T15:28:24.084Z (9 days ago)
- Versions: 116
- Dependent Packages: 148
- Dependent Repositories: 9,837
- Downloads: 92,413,481 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.13+incompatible (published 11 days ago)
- Last Synced: 2026-07-17T15:35:52.435Z (9 days ago)
- Versions: 69
- 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-20.04: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses:
- Latest release: 3.0.9-2 (published 5 months ago)
- Last Synced: 2026-03-13T14:23:59.812Z (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:
- Latest release: 3.2.5-2 (published 6 months ago)
- Last Synced: 2026-03-11T18:35:27.175Z (5 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.10: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses:
- Latest release: 3.2.5-2 (published 5 months ago)
- Last Synced: 2026-03-14T03:15:06.376Z (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-24.10: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses:
- Latest release: 3.2.5-2 (published 6 months ago)
- Last Synced: 2026-03-09T17:07:39.433Z (5 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:
- Latest release: 3.0.9-2 (published 6 months ago)
- Last Synced: 2026-03-14T07:16:30.196Z (4 months 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.3.9 (published 3 months ago)
- Last Synced: 2026-05-27T02:47:37.591Z (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 4 months ago)
- Last Synced: 2026-05-27T06:46:30.373Z (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-22.04: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses:
- Latest release: 3.2.5-2 (published 5 months ago)
- Last Synced: 2026-03-13T22:39:02.653Z (4 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:
- Latest release: 3.2.5-2 (published 5 months ago)
- Last Synced: 2026-03-13T23:45:10.525Z (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-24.04: ruby-mixlib-shellout
- Homepage: https://github.com/chef/mixlib-shellout
- Licenses:
- Latest release: 3.2.5-2 (published 6 months ago)
- Last Synced: 2026-03-06T16:49:19.223Z (5 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:
- Latest release: 3.2.5-2 (published 5 months ago)
- Last Synced: 2026-03-14T18:10:35.041Z (4 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
- ffi-win32-extensions ~> 1.0.3
- win32-process ~> 0.9
- wmi-lite ~> 1.0
- chef-utils >= 0
Score: 29.974152494148804