shell
Version, currently master branch1 version
- master branchlatestMay 7, 2017
github.com/dmytro/shell.cr
Small simplistic helper class for executing shell commands in Crystal.
9 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
shell:
github: dmytro/shell.cr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- Dmytro Kovalov <dmytro.kovalov@gmail.com>
Dependencies
Runtime Dependencies
- spec2~> 0.9github: waterlink/spec2.cr
README
# shell
Small simplistic helper class for executing shell commands in Crystal:
- run command,
- exit if it fails,
- return STDOUT of the command;
- optionally
- allow to ignore failure
- return STDERR of failed command.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
shell:
github: dmytro/shell.cr
```
## Usage
```crystal
require "shell"
```
Output of the shell command is available through `#stdout` and `#stderr`
methods, numeric value of the exit status returned by the function `#run`.
Simplest usage of the `#run` method:
```crystal
puts Shell.run("ls").stdout
```
If command fails `Shell` raises exception, but this behaviour can be
overridden by `fail_on_error` variable:
```crystal
puts Shell.run("command_with_non_zero_status", fail_on_error: false).stderr
```
## Contributing
1. Fork it ( https://github.com/dmytro/shell/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [dmytro](https://github.com/dmytro) Dmytro Kovalov - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- May 7, 2017
- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dmytro/shell.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 1