🍺 BREW Explorer

← all formulae

has

brew install has v1.5.2 MIT

Checks presence of various command-line tools and their versions on the path

2
30-day installs · #13357
12
90-day · #11472
209
365-day · #7250
812
★ GitHub stars · updated 6mo ago

GitHub topics

bash check cli commands hacktoberfest hacktoberfest2021 linux macos shell terminal

Links

Raw metadata
{
  "aliases": [],
  "alternatives": [],
  "build_dependencies": [],
  "categories": [],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Checks presence of various command-line tools and their versions on the path",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:38:33+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "has",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-02-26T04:00:46Z",
  "github_readme_excerpt": "# has\n\n`has` checks presence of various command line tools on the PATH and reports their installed version.\n\n[![Build Status](https://github.com/kdabir/has/actions/workflows/main.yml/badge.svg)](https://github.com/kdabir/has/actions/workflows/main.yml)\n\n[![demo](demo.svg)](demo.svg)\n\n## Quick Start \ud83d\udeb4\n\nJust [install](#installing-) the `has` script, (there is no dependency apart from `bash` itself). From the command line, pass the list of commands you want to check as arguments to `has`, for example:\n\n```console\n$ has node npm java git gradle\n\u2713 node 22.17.0\n\u2713 npm 11.5.1\n\u2713 java 21.0.7\n\u2713 git 2.50.1\n\u2713 gradle 8.14.2\n```\n\nIf everything is good `has` exits with status code `0`. The exit status code reflects number of commands **not found** on your path.\n\n```console\n$ has node go javac\n\u2713 node 22.17.0\n\u2713 go 1.24.5\n\u2718 javac\n```\n\nAnd echo the status:\n\n```console\n$ echo $?\n1\n```\n\n## Use `has` in scripts\n\n`has` can be used in shell scripts to check presence of tool in very readable way\n\n```bash\nif has node\n    then echo you have what it takes \ud83c\udf89\nfi\n```\n\n**Pro Tip**: the `has` in above command can be replaced with the entire curl command for to ensure portability of script \u2192 `if curl -sL https://git.io/_has | bash -s node then ...`\n\n\n## Installing \ud83d\ude80\n\n`has` is a single bash script that does it all. You can [download](https://raw.githubusercontent.com/kdabir/has/master/has) the script and make it available on your `$PATH`. However, to make it even simpler, just follow *one* of these methods.\n\n### Homebrew (MacOS) \ud83c\udf7a\n\nJust run the following: \n\n```bash\nbrew install kdabir/tap/has\n```\n\n### Cloning the Repo\n\nJust execute the following command in a terminal: it clones `has` repo and installs it into your path.\n\n```bash\ngit clone https://github.com/kdabir/has.git \u0026\u0026 cd has \u0026\u0026 sudo make install\n```\n\nFor a non-root installation:\n\n```bash\ngit clone https://github.com/kdabir/has.git\ncd has\nmake PREFIX=$HOME/.local install\n```\n\nTo update just do a `git fetch` or `make update` followed by the appro",
  "github_repo": "kdabir/has",
  "github_stars": 812,
  "github_topics": [
    "bash",
    "check",
    "cli",
    "commands",
    "hacktoberfest",
    "hacktoberfest2021",
    "linux",
    "macos",
    "shell",
    "terminal"
  ],
  "homepage": "https://github.com/kdabir/has",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 2,
  "installs_365d": 209,
  "installs_90d": 12,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "MIT",
  "llm_generated_at": null,
  "llm_model": null,
  "name": "has",
  "oldnames": [],
  "one_liner": null,
  "optional_dependencies": [],
  "rank_30d": 13357,
  "rank_365d": 7250,
  "rank_90d": 11472,
  "raw_hash": "02d64b9f39f0711c",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/h/has.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [],
  "version_head": "HEAD",
  "version_stable": "1.5.2",
  "versioned_formulae": [],
  "why_use_this": null
}