Skip to content

arkjedrz/zxc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zxc - directory-oriented command runner

zxc is a directory-oriented command runner. This means it is able to run commands defined by YAML files.

Features

  • YAML-based definition - human-readable and easy to write
  • Jinja-based template substitution - flexible
  • native look and feel

Example

Simple definition file:

greet:
  command: echo "Hello {{ name }}!"
  description: Greets specified person.
  arguments:
    name:
      flags: ["-n", "--name"]
      default: User
      description: |-
        Name to greet.

Refer to definition file documentation for more information.

Use following command to print Hello world!:

zxc greet --name world

demo

Comparison to other tools

There are other great tools solving similar issues. Use what suits You best!

just

Link to the project

just is similar due to being project-oriented.

  • zxc uses YAML files for definitions, which makes it easy to read and write.
  • just uses syntax inspired by make - arguably higher entry level.
  • zxc support local and external definition files, but working directory is expected to be same as definition file location.
  • just can be used outside of a directory containing justfile.
  • zxc is currently supporting one-liners, while just can run multiple commands.
  • zxc generates CLIs with native app feel.
  • just is a mature project.

navi

Link to the project

  • zxc is directory- or project-oriented.
  • navi is a cheatsheet for CLI usage - not attached to specific tool or project.
  • navi uses custom syntax - arguably higher entry level.

Installation

From source

cargo build --release
cargo install --path .

From packages

deb-based systems:

sudo dpkg -i zxc_<version>-1_amd64.deb

rpm-based systems:

sudo rpm -i  zxc-<version>-1.x86_64.rpm

Development

pip install pre-commit
cargo install cargo-deb cargo-generate-rpm cargo-aur

Pre-commit setup

Install and run hooks:

pre-commit install
pre-commit run -a

Build, test and install

cargo build --release
cargo test
cargo install --path .

Create packages

Application must be built and stripped:

cargo build --release
strip -s target/release/zxc

Create packages:

cargo deb
cargo generate-rpm
cargo aur