This project is a fork of the Homebrew.git project. If you have that one already cloned locally, you can use
git clone --reference /path/to/your/Homebrew.git/incarnation mirror_URL
to save bandwidth during cloning.
 
descriptionUbuntu’s command-not-found equivalent for Homebrew on macOS
homepage URLhttps://brew.sh/
repository URLhttps://github.com/Homebrew/homebrew-command-not-found.git
ownerroot@yurikoles.com
last changeMon, 3 Jun 2024 00:12:47 +0000 (3 00:12 +0000)
last refreshMon, 3 Jun 2024 08:18:59 +0000 (3 10:18 +0200)
content tags
add:
README.md

Homebrew Command Not Found

This project reproduces Ubuntu’s command-not-found for Homebrew users on macOS.

GitHub Actions

On Ubuntu, when you try to use a command that doesn’t exist locally but is available through a package, Bash will suggest you a command to install it. Using this script, you can replicate this feature on macOS:

# on Ubuntu
$ when
The program 'when' is currently not installed.  You can install it by typing:
sudo apt-get install when

# on macOS with Homebrew
$ when
The program 'when' is currently not installed. You can install it by typing:
  brew install when

Over 5000 formulae are supported, representing more than 17000 different commands (100% of the main Homebrew repo).

Install

First, tap this repository:

brew tap homebrew/command-not-found

Requirements

This tool requires one of the following:

How it works

When you tap the repo you’ll get two more brew commands: brew which-formula and brew which-update. The first one uses a database file which gives you the formula you have to install in order to get a specific command. The file is generated by the second command by crawling all installed formulae and collecting their binaries. Having this as a tap means you get an up-to-date binaries database each time you run brew update.

The handler.sh script defines a command_not_found_handle function which is used by Bash when you try a command that doesn’t exist. The function calls brew which-formula on your command, and if it finds a match it’ll print it to you. If not, you’ll get an error as expected.

shortlog
8 hours ago BrewTestBotAdd rustls-ffimaster
32 hours ago BrewTestBotAdd openfa
2 days ago BrewTestBotAdd haproxy@2.8, pedump
3 days ago BrewTestBotAdd span-lite
4 days ago BrewTestBotUpdate arcade-learning-environment
5 days ago BrewTestBotUpdate gcc@13
6 days ago BrewTestBotAdd apache-flink-cdc, llama.cpp, ocicl
7 days ago BrewTestBotUpdate luajit
8 days ago BrewTestBotAdd vedic
9 days ago BrewTestBotAdd cloudflare-cli4, jsontoolkit, libvirt-python
9 days ago Mike McQuaidMerge pull request #154 from Homebrew/sync-shared-config
9 days ago BrewTestBotdependabot.yml: update to match main configuration
9 days ago Mike McQuaidMerge pull request #153 from Homebrew/sync-shared-config
9 days ago BrewTestBot.rubocop.yml: update to match main configuration
9 days ago Mike McQuaidMerge pull request #152 from Homebrew/sync-shared-config
9 days ago BrewTestBot.rubocop.yml: update to match main configuration
...
tags
9 years ago v0.2.0
10 years ago v0.1.0
heads
8 hours ago master