#execute-command #yaml-config #fun #cli #command-line-tool #hierarchical #script

bin+lib humor

A tool to execute commands based on YAML configuration files

4 releases

0.0.3 Aug 12, 2024
0.0.2 Aug 12, 2024
0.0.1 Aug 12, 2024
0.0.0 Aug 11, 2022

#1762 in Command line utilities

Download history 4/week @ 2024-07-23 4/week @ 2024-07-30 199/week @ 2024-08-06 157/week @ 2024-08-13 19/week @ 2024-09-10 13/week @ 2024-09-17 5/week @ 2024-09-24 4/week @ 2024-10-01

106 downloads per month

MIT/Apache

15KB
320 lines

Humor

Humor is a practical command line tool that supports hierarchical reading of YAML configuration files to execute script instructions.

Humor's idea is to provide developers with a simple tool to manage commonly used commands.

Roadmap

  • Hierarchical configuration
  • Execute commands

Example

Humor can read the default configuration file from ~/.humors, or start reading commands from humor.yaml in the current directory. Humor supports hierarchical reading to meet the call requirements of instructions for different domains, and supports short queries to find the instructions you need.

As in the following example, if you want to execute python -m unittest testall.py, the following commands are equivalent:

humor testall
humor python testall
humor python test testall

Because both Rust and Python have a Humor command called build, the following calls are correct:

humor python build
humor python dev build

humor rust build
humor rust prelude build

Example humor.yaml:

import:
  - /somepath/test.yaml
  - /somepath/dev.yaml

commands:
  rust:
    prelude:
      check: cargo fmt && cargo check
      build: cargo build

Example test.yaml

commands:
  python:
    test:
      testall: python -m unittest testall.py
      testmodule: python -m unittest testmodule.py

Example dev.yaml

commands:
  python:
    dev:
      build: python -m build --wheel
      install: pip install ./dist/somepackage-py3-0.0.1.wheel

Dependencies

~3–14MB
~119K SLoC