{"id":13902967,"url":"https://github.com/frzam/hail","last_synced_at":"2025-04-06T13:31:23.932Z","repository":{"id":64303101,"uuid":"351537862","full_name":"frzam/hail","owner":"frzam","description":"Cross-platform script management CLI written in go.","archived":false,"fork":false,"pushed_at":"2021-08-11T16:12:40.000Z","size":1712,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T00:34:04.393Z","etag":null,"topics":["cli","cross-platform","golang","linux"],"latest_commit_sha":null,"homepage":"https://frzam.github.io/hail/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frzam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-25T18:31:23.000Z","updated_at":"2024-08-01T19:52:01.000Z","dependencies_parsed_at":"2023-01-15T10:01:05.206Z","dependency_job_id":null,"html_url":"https://github.com/frzam/hail","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frzam%2Fhail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frzam%2Fhail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frzam%2Fhail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frzam%2Fhail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frzam","download_url":"https://codeload.github.com/frzam/hail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247488455,"owners_count":20946948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cross-platform","golang","linux"],"created_at":"2024-08-06T22:01:31.543Z","updated_at":"2025-04-06T13:31:23.210Z","avatar_url":"https://github.com/frzam.png","language":"Go","funding_links":[],"categories":["cli"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/frzam/hail/master/.github/logo.jpg\" /\u003e\n    \u003cp\u003e\u003cb\u003eCross-Platform Scripts Management CLI written in go\u003c/b\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/frzam/hail)](https://goreportcard.com/report/github.com/frzam/hail)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=frzam_hail\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=frzam_hail)\n![example workflow](https://github.com/frzam/hail/actions/workflows/release.yml/badge.svg)\n [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![GO Version]( https://img.shields.io/github/go-mod/go-version/frzam/hail\n)]( https://img.shields.io/github/go-mod/go-version/frzam/hail\n)\n [![CII](https://bestpractices.coreinfrastructure.org/badge_static/72)](https://bestpractices.coreinfrastructure.org/en/projects/5082)\n\n* [About](#about)\n* [Features](#features)\n* [Installation](#installation)\n    * [Linux Or Unix](#linux-or-unix)\n    * [Windows](#windows)\n*  [Usage](#usage)\n*  [License](#license)\n\n## About\n\nToday we spend lots of time in terminal and there are lots of command and scripts that we have to remember and if we forget then we have to dig into history to look. **hail** lets you save all those useful and frequently used commands or scripts with some alias so you can use the alias to print or directly run the command in terminal.\n\n**hail** has built in *fuzzy search* so you don't even have to remember complete alias name, you can simply write few alphabets of alias and you will be presented with matching alias. \n\n**hail** also lets you run scripts(python, bash, perl, sh, bat etc) directly from hail provided script starts with **shebang**. Please refer [usage](#usage) section for more details. This project is influenced by [pier](https://github.com/pier-cli/pier) and thank you [Nida](https://www.instagram.com/nida_fatima_khaan) for this beautiful logo.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/frzam/hail/master/.github/about.gif\" /\u003e\n\u003c/p\u003e\n\n\n```\n\u003e hail -h\nhail is a cross-platform script management tool\n\nUsage:\n  hail [flags]\n  hail [command]\n\nAvailable Commands:\n  add         add is used to add a new command in collection\n  completion  generate the autocompletion script for the specified shell\n  config      it is used to list or update configurations\n  copy        copy/cp is  used to copy one command/script to a new alias\n  delete      delete/rm removes command from hail basis alias\n  edit        edit previously added command or script in text editor\n  get         get retrieves command basis the alias\n  help        Help about any command\n  init        init initializes an empty .hailconfig file with title as provided\n  list        list/ls prints all the alias and commands\n  move        move/mv used to move command with old alias to new alias\n  run         it is used to directly run a command from alias\n  update      updates already present command\n  version     version prints the current version of hail\n\nFlags:\n  -h, --help   help for hail\n\nUse \"hail [command] --help\" for more information about a command.\n```\n\n```\n\u003e hail ls\n+--------------------+----------------------------------------------------+----------------------+\n| ALIAS              | COMMAND                                            | DESCRIPTION          |\n+--------------------+----------------------------------------------------+----------------------+\n| list-git-repo      | find ~ -name \".git\" 2\u003e /dev/null | sed 's/\\/.git/\\ |                      |\n|                    | //g' | awk '{print \"-------------------------\\n\\03 |                      |\n|                    | 3[1;32mGit Repo:\\033[0m \" $1; system(\"git --git-di |                      |\n|                    | r=\"$1\".git --work-tree=\"$1\" status\")}'             |                      |\n|                    |                                                    |                      |\n+--------------------+----------------------------------------------------+----------------------+\n| log-with-exception | find . -name '*.log' -mtime -2 -exec grep -Hc Exce |                      |\n|                    | ption {} \\; | grep -v :0$                          |                      |\n|                    |                                                    |                      |\n+--------------------+----------------------------------------------------+----------------------+\n| pv                 | apiVersion: v1                                     | Persistence volume i |\n|                    | kind: PersistentVolume                             | n ocp                |\n|                    | metadata:                                          |                      |\n|                    |   name: pv00001                                    |                      |\n|                    | spec:                                              |                      |\n|                    |   capacity:                                        |                      |\n|                    |     storage: 10Gi                                  |                      |\n|                    |   accessModes:                                     |                      |\n|                    |     - ReadWriteOnce                                |                      |\n|                    |   persistentVolumeReclaimPolicy: Retain            |                      |\n|                    |   nfs:                                             |                      |\n|                    |     path: /mnt/path                                |                      |\n|                    |     server:                                        |                      |\n|                    |                                                    |                      |\n+--------------------+----------------------------------------------------+----------------------+\n| scan-ports         | for i in {1..65535}; do (echo \u003c /dev/tcp/127.0.0.1 |                      |\n|                    | /$i) \u0026\u003e/dev/null \u0026\u0026 printf \"\\n[+] Open Port at\\n:  |                      |\n|                    | \\t%d\\n\" \"$i\" || printf \".\"; done                   |                      |\n|                    |                                                    |                      |\n+--------------------+----------------------------------------------------+----------------------+\n| server-sh          | `#!/bin/bash                                       |                      |\n|                    |     echo|read|{(read t;g=$(echo $t|cut -d' ' -f2)  |                      |\n|                    |     while read|grep :;do :;done;[[ -e .$g \u0026\u0026! $g = |                      |\n|                    |  *..* ]]||exit                                     |                      |\n|                    |     printf \"HTTP/1.1 200 OK\\nContent-Length: $(sta |                      |\n|                    | t -c%s .$g)\\n\\n\"                                   |                      |\n|                    |     cat .$g)|nc -l -p $1;}\u003e/dev/fd/0;$0 $1         |                      |\n|                    |                                                    |                      |\n+--------------------+----------------------------------------------------+----------------------+\n| was-bin            | cd /opt/IBM/BPM/v8.6/profiles/managerProfile/bin   |                      |\n|                    |                                                    |                      |\n+--------------------+----------------------------------------------------+----------------------+\n| create-password    | tr -dc 'a-zA-Z0-9~!@#$%^\u0026*_()+}{?\u003e\u003c/\";.,[]=-' \u003c /d | generate a password  |\n|                    | ev/urandom | fold -w 32 | head -n 1                |                      |\n|                    |                                                    |                      |\n+--------------------+----------------------------------------------------+----------------------+\n| disk-usage-by-type | find . -type f -empty -prune -o -type f -printf \"% |                      |\n|                    | s\\t\" -exec file --brief --mime-type '{}' \\; | awk  |                      |\n|                    | 'BEGIN {printf(\"%12s\\t%12s\\n\",\"bytes\",\"type\")} {ty |                      |\n|                    | pe=$2; a[type]+=$1} END {for (i in a) printf(\"%12u |                      |\n|                    | \\t%12s\\n\", a[i], i)|\"sort -nr\"}'                   |                      |\n|                    |                                                    |                      |\n+--------------------+----------------------------------------------------+----------------------+\n```\n\n## Features\n* Cross-Platform \n* Auto Completion scripts are available (Bash, fish, zsh and powershell)\n* Inbuilt fuzzy searching\n* Store commands as well as scripts\n* Single and small binary to install. (Thanks to go!)\n* Run commands or scripts directly from hail\n* Portable toml file *.hailconfig*\n* Format of scripts or command is also preserved eg *yaml* \n\n## Installation\n### Linux or Unix\n```python\n# Download the latest version of hail from releases https://github.com/frzam/hail/releases/ and unzip the file\n\u003e wget -c https://github.com/frzam/hail/releases/download/v0.1.16/hail_0.1.16_Linux_x86_64.tar.gz -O - | tar -xz\n\n\n# Give execute permission to hail and move the binary into bin folder so it is accessible everywhere.\n\u003e chmod +x hail | mv hail /usr/local/bin/\n\n# Test if hail is working properly.\n\u003e hail version\n\n# Initialize hailconfig, it will create .hailconfig file under $HOME. If you want to \n# create .hailconfig anywhere else then set env HAILCONFIG to that path.\n\u003e hail init \u003ctitle\u003e -i bash\n```\n#### Set up tab auto completion for bash.\nAuto completion scripts are also available for fish and zsh.\n\n```python\n# Generate bash script in a file\n\u003e hail completion bash \u003e ~/.hail\n\n# Open ~/.bashrc in editor\n\u003e vi ~/.bashrc\n\n# Add below line in .bashrc\n\u003e source ~/.hail\n\n# Refresh .bashrc by doing\n\u003e source ~/.bashrc\n```\n### Windows\n```python\n# Download the latest binary from releases https://github.com/frzam/hail/releases/ \n\n# Unzip the hail__Windows_x86_64.tar.gz file into *hail.exe*\n\n# Place hail.exe into the PATH\n\n# Test if hail is working properly. Open Command Prompt, Powershell or Git bash and Run.\n\u003e hail version\n\n# Initialize hailconfig, it will create .hailconfig file under $USERPROFILE.\n# If you want to create .hailconfig anywhere else then set env HAILCONFIG to that path\n\u003e hail init -t \u003ctitle\u003e -i bash\n\n# Generate powershell completion script\n\u003e hail completion powershell\n```\n## Usage\n```python\n# Initialize a .hailconfig file with default interpreter set to bash\n\u003e hail init -t my-config -i bash\n\n# Add a command and description with alias 'create-password'. Add Command in \n# default editor tr -dc 'a-zA-Z0-9~!@#$%^\u0026*_()+}{?\u003e\u003c/\";.,[]=-' \u003c /dev/urandom | fold -w 32 | head -n 1\n\u003e hail add -a create-password -d \"create a password\" \n\n# Get a command with alias 'create-password'\n\u003e hail get create-password\n\n# Edit a command with alias 'create-password'\n\u003e hail edit create-password\n\n# Run a command with alias 'create-password'\n\u003e hail run create-password\n\n# Delete an entry with alias 'create-password'\n\u003e hail rm create-password\n\n# List all aliases with commands and descriptions.\n\u003e hail ls\n\n# For more info on any sub command. \n\u003e hail \u003csub-command\u003e -h\n```\n### Run \nWe can directly run scripts which contains shebang ```#!``` and interpreter as first line.\nFor example:\n```python\n#!/usr/bin/env python\nuser_input=12345\n_rev=0\nwhile(user_input\u003e0):\n  dig=user_input%10\n  _rev=_rev*10+dig\n  user_input=user_input//10\nprint(\"The reversed number is :\",_rev)\n\n```\n```bash\n#!/bin/bash\necho \"hello world\"\n```\nhail creates a temp file and takes interpreter(In this case python or bash) from the first line and runs the file with given interpreter, later removes the file. If shebang is not present in the script then the default interpreter is taken from *.hailconfig*\n\nTo set default interpreter use\n\n```\u003e  hail config -n interpreter -v \u003cinterpreter-name\u003e```\n\n\u003e Note: Run is still in beta stage. Please feel free to reach out to me in case of any doubt at farzamcse@gmail.com and contributions are very welcome :)\n\n\n# License\nhail is provided under [Apache 2.0](https://github.com/frzam/hail/blob/master/LICENSE) license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrzam%2Fhail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrzam%2Fhail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrzam%2Fhail/lists"}