Z is a simple and useful task runner.
- Simple
- Easy
- Intuitive
- Useful
- Nested tasks
- Default task
- Alias
- Shorthand
- And more...
Via gobinaries
curl -sSL gobinaries.com/zakuro9715/z | sh
By go install
go install github.com/zakuro9715/z
Z is strongly inspired by Robo
- Easy to use
- Simple configuration
- Easy to install
- No nested tasks
- Not enough features
- No default task
- Easy to use
- Run anyware
- Make is not task runner
- Makefile is difficult
- No nested tasks
- Easy to use
- Simple configuration
- No extra tool is required in nodejs project.
- Not suitable for other than nodejs project
- No nested tasks
- script must be one-liner
Task (go-task/task)
- Many features
- Good documentation
- No nested tasks
- Too many features
z tasks... args...
Run with specified shell (default: sh)
tasks:
hello:
run:
- echo hello1
- echo hello2
$ z hello
# It runs
sh -c "echo hello1"
sh -c "echo hello2"
run
can be omitted
tasks:
hello: echo hello
tasks:
hello.world: echo hello world
$ z hello world
hello world
$ z hello.world
hello world
Args will be passed. You can use it as $@
. If args.passthrough == true, args will be embedded in each commands
$ cat z.yaml
tasks:
hello: echo hello $@
hiho:
run:
- echo hi
- echo ho
args:
passthrough: true
$ z hello world
# It runs
sh -c "echo hello" "sh" "world"
$ z hiho world
# It runs
sh -c "echo hi world"
sh -c "echo ho world"
You can use default task
default: hello.world
tasks:
hello:
tasks:
world: echo hello world
$ z
hello world
Just use z as command. Config will be inherited.
# myconfig.yaml
tasks:
hello.world: echo hello world
helloworld: z hello world # same as `z --config=myconfig.yaml hello world`
$z --config=myconfig.yaml helloworld
hello world
Of course, you can use another config
tasks:
hello:
tasks:
a: z --config=a.yaml hello
b: z --config=b.yaml hello
env:
- KEY=VALUE
tasks:
echo: echo $KEY
$ z echo
VALUE
var:
seq: seq 3
tasks:
count: {{seq}} | cat # seq 10
$ z count
1
2
3
You can specify additional PATH
tasks:
hello:
path: ./bin
run: command-in-bin-dir
See also Examples Test
tasks:
compile:
run:
- clang $@
desc: Compile
hooks:
pre: echo Compiling
post: echo Compiled
tasks:
main:
run:
- z -c examples/cc.yaml compile main.c
shell: bash # Shell to run commands
default: hello.world # Default task. hello.world -> z hello world
disable_help: false # If true, don't show z's help and --help flag is handled same as other flags
env:
MESSAGE: message # It used if environment variable does not exist.
var:
value: value
tasks: # Task list
hello: # Task name
desc: Say hello # Task description
run: # Commands to run
- echo hello $@ #
args:
required: true # Required one more arguments
default: you # Default argument
hooks: # hooks
pre: echo saying hello # pre hook
post: echo said hello # post hook
tasks: # Sub task list
script:
run: examples/hello.sh # Run script
script.with_path:
path: examples # Add path
run: hello.sh
python:
shell: python
run: print('hello python')
hello.world: # Sub task shorthand (Task will be 'z hello world')
run:
- z hello -- world # after -- is args (not subtask name)
args:
passthrough: true # passthrough arguments. So `z hello.world arg` will be `z hello -- world arg`
echo: echo $@ # Shorthand command ('run' can be omitted').
echo.twice: # Multi commands can be used
- echo $@
- echo $@
echo.env.message: echo $MESSAGE # use env
echo.env.message2:
env: MESSAGE=message2 # task local default env
run: echo $MESSAGE
echo.var.value: echo {{value}} # use var
helloworld: z hello.world $@ # Alias to other task
default: npm.script
tasks:
npm.script: npm run