Skip to content
forked from orhun/halp

A CLI tool to get help with CLI tools 🐙

License

Notifications You must be signed in to change notification settings

raffimolero/halp

A CLI tool to get help with CLI tools 🐙

GitHub Release Crate Release Coverage
Continuous Integration Continuous Deployment Docker Builds Documentation

halp demo

halp aims to help find the correct arguments for command-line tools by checking the predefined list of commonly used options/flags. Additionally, it provides a prompt for quick access to the manual page or cheat sheet of the given command.

If you deal with command-line tools often, it might take some time to figure out how to get help or check the version of a particular command (especially when shell completions are not available). In that case, you might try the most-known flags such as -h and -v but unfortunately not all the command-line tools follow these conventions (either due to conflicts with other flags or they just use another form). Instead of brute-forcing manually into getting help, you can run halp <command> and it will check the following arguments for you:

  • for help: -v, -V, --version
  • for version info: -h, --help, help, -H

If one of these arguments succeeds, it prints the output and exits. This way, you can get informed about the version and help in one single command. You can also customize this list with a configuration file or provide a list of arguments via command-line arguments.

On the other hand, if you really need help, you can use the plz subcommand which will prompt a selection for:

  1. show the man page (runs man(1))
  2. show the cheat sheet (via cheat.sh)

Example

Have you ever experienced this:

$ cli_tool -v
unknown flag -v
$ cli_tool -V
unknown flag -V
$ cli_tool -h
unknown flag -h
$ asdjw1jwhdajh1idojad # frustration
bash: asdjw1jwhdajh1idojad: command not found
$ cli_tool --help # f*cking finally!
Some CLI Tool Version 1.42.69
Usage:
  cli_tool <flags> <args> [--parameter1 value1 --parameter2 value2 ...]

Whereas, with halp:

$ halp cli_tool

(°ロ°)  checking 'cli_tool -v'
(×﹏×)      fail '-v' argument not found.
(°ロ°)  checking 'cli_tool -V'
(×﹏×)      fail '-V' argument not found.
(°ロ°)  checking 'cli_tool -h'
(×﹏×)      fail '-h' argument not found.
(°ロ°)  checking 'cli_tool --help'
\(^ヮ^)/ success '--help' argument found!

Some CLI Tool Version 1.42.69
Usage:
  cli_tool <flags> <args> [--parameter1 value1 --parameter2 value2 ...]

Installation

Packaging status

Packaging status

Cargo

halp can be installed from crates.io:

cargo install halp

The minimum supported Rust version is 1.64.0.

Arch Linux

halp can be installed from available AUR packages using an AUR helper. For example,

paru -S halp

If you prefer, you can clone the package and then build it with makepkg. For example,

git clone https://aur.archlinux.org/halp.git && cd halp && makepkg -si

Docker

Images

Docker builds are automated and images are available in the following registries:

Usage

The following commands can be used to get help for a binary inside the container:

docker run --rm -it "orhunp/halp:${TAG:-latest}" whoami
docker run --rm -it "orhunp/halp:${TAG:-latest}" plz whoami

Or you can provide a custom binary as follows (please note that you might get shared library errors):

docker run -v "bin:/app/bin:rw" --rm -it "orhunp/halp:${TAG:-latest}" -v ./bin

Building

Custom Docker images can be built from the Dockerfile:

docker build -t halp .

Binary releases

See the available binaries for different targets from the releases page. They are are automated via Continuous Deployment workflow

Release tarballs are signed with the following PGP key: 0xFB41AE0358378256

Build from source

  1. Clone the repository.
git clone https://github.com/orhun/halp && cd halp/
  1. Build.
CARGO_TARGET_DIR=target cargo build --release

Binary will be located at target/release/halp.

Usage

Configuration

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this program by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

A CLI tool to get help with CLI tools 🐙

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 94.3%
  • Shell 3.0%
  • Dockerfile 2.7%