{"id":15715598,"url":"https://github.com/homebrew/homebrew-command-not-found","last_synced_at":"2025-05-15T17:07:50.536Z","repository":{"id":14463250,"uuid":"17175144","full_name":"Homebrew/homebrew-command-not-found","owner":"Homebrew","description":"🔍 Ubuntu’s command-not-found equivalent for Homebrew on macOS","archived":false,"fork":false,"pushed_at":"2025-05-10T00:15:21.000Z","size":11385,"stargazers_count":426,"open_issues_count":1,"forks_count":51,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-10T01:24:13.833Z","etag":null,"topics":["cmd","homebrew","tap"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Homebrew.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Homebrew","open_collective":"homebrew","patreon":"homebrew"}},"created_at":"2014-02-25T14:13:14.000Z","updated_at":"2025-05-10T00:15:24.000Z","dependencies_parsed_at":"2024-01-18T00:31:23.459Z","dependency_job_id":"52a55183-4b3e-42ba-ad94-77382b98ffc9","html_url":"https://github.com/Homebrew/homebrew-command-not-found","commit_stats":{"total_commits":2462,"total_committers":32,"mean_commits":76.9375,"dds":0.5211210398050365,"last_synced_commit":"10c1bc4308fc7daf12c6784bc5ae31cedb2f8def"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Homebrew%2Fhomebrew-command-not-found","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Homebrew%2Fhomebrew-command-not-found/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Homebrew%2Fhomebrew-command-not-found/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Homebrew%2Fhomebrew-command-not-found/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Homebrew","download_url":"https://codeload.github.com/Homebrew/homebrew-command-not-found/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384988,"owners_count":22062422,"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":["cmd","homebrew","tap"],"created_at":"2024-10-03T21:42:06.252Z","updated_at":"2025-05-15T17:07:45.528Z","avatar_url":"https://github.com/Homebrew.png","language":"Ruby","funding_links":["https://github.com/sponsors/Homebrew","https://opencollective.com/homebrew","https://patreon.com/homebrew"],"categories":[],"sub_categories":[],"readme":"# Homebrew Command Not Found\n\nThis project reproduces Ubuntu’s `command-not-found` for Homebrew users on\nmacOS.\n\nOn Ubuntu, when you try to use a command that doesn’t exist locally but is\navailable through a package, Bash will suggest you a command to install it.\nUsing this script, you can replicate this feature on macOS:\n\n```bash\n# on Ubuntu\n$ when\nThe program 'when' is currently not installed.  You can install it by typing:\nsudo apt-get install when\n\n# on macOS with Homebrew\n$ when\nThe program 'when' is currently not installed. You can install it by typing:\n  brew install when\n```\n\nOver 5000 formulae are supported, representing more than 17000 different commands\n(100% of the main Homebrew repo).\n\n## Install\n\nFirst, tap this repository:\n\n```bash\nbrew tap homebrew/command-not-found\n```\n\n* **Bash and Zsh**: Add the following line to your `~/.bash_profile` (bash) or `~/.zshrc` (zsh):\n\n    ```bash\n    HB_CNF_HANDLER=\"$(brew --repository)/Library/Taps/homebrew/homebrew-command-not-found/handler.sh\"\n    if [ -f \"$HB_CNF_HANDLER\" ]; then\n\tsource \"$HB_CNF_HANDLER\";\n    fi\n    ```\n\n* **Fish**: Add the following line to your `~/.config/fish/config.fish`:\n\n    ```fish\n    set -l __hb_cnf_handler (brew --repository)\"/Library/Taps/homebrew/homebrew-command-not-found/handler.fish\"\n    if test -f $__hb_cnf_handler\n       source $__hb_cnf_handler\n    end\n    ```\n\n## Requirements\n\nThis tool requires one of the following:\n\n* [Zsh](https://www.zsh.org) (the default on macOS Catalina and above)\n* [Bash](https://www.gnu.org/software/bash/) (version 4 and higher)\n* [Fish](https://fishshell.com)\n\n## How it works\n\nWhen you tap the repo you’ll get two more `brew` commands: `brew which-formula`\nand `brew which-update`. The first one uses a database file which gives you the\nformula you have to install in order to get a specific command. The file is\ngenerated by the second command by crawling all installed formulae and\ncollecting their binaries. Having this as a tap means you get an up-to-date\nbinaries database each time you run `brew update`.\n\nThe `handler.sh` script defines a `command_not_found_handle` function which is\nused by Bash when you try a command that doesn’t exist. The function calls\n`brew which-formula` on your command, and if it finds a match it’ll print it to\nyou. If not, you’ll get an error as expected.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomebrew%2Fhomebrew-command-not-found","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomebrew%2Fhomebrew-command-not-found","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomebrew%2Fhomebrew-command-not-found/lists"}