Joker is a commandline tool used to check your dev environment.
If you need a lot of tools and services in your dev environment, you might miss some operation before coding and testing. Then you'll spend some time to debug an odd error, finally you figured out that it's just because you forgot starting a service or exporting a PATH. That's aweful!
Joker provides several kinds of checking as:
- ports (is open or not?)
- env variables (is matched or not with the given expected value?)
- file paths (exists or not?)
- commands (is available or not?)
- command outputs (does command output match with the given expected value?)
- macOS and Linux supported, not Windows
- Bash shell only
Just go get
if you have a Go environment:
go get github.com/gingerhot/joker
or install a binary from Releases:
curl -sL $(curl -s https://api.github.com/repos/gingerhot/joker/releases/latest | grep "browser_download_url.*.gz" | grep $(uname -s | tr '[:upper:]' '[:lower:]') | cut -d '"' -f 4) | tar xz -C /tmp
sudo mv /tmp/joker /usr/local/bin/joker
You can check example.yaml to get how to config to check your dev env. It's straight forward and easy to play.
When you have such a yaml-format config file, then run:
joker example.yaml
if you named your config file as exact joker.yaml
, just run joker
and it will work perfectly.
Get more help by joker -h
.
Joker is handy, enjoy!
- Why I name it Joker?
Not special but I just watched the movie Joker, and it's more fun than to name it as dev-env-checker
.
- Why not add a
match
directive to undertake pattern matching asexpected
doing exact match in outputs check?
This can be achieved by some shell tricks along with the expected
keyword, for example:
outputs:
- name: Check Go version
cmd: go version | grep -q 'go1.13.6' && echo 'matched'
expected: matched
And hope this example can enlighten your tremendous creativity.
Bug reports and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The software is available as open source under the terms of the MIT License.