There’s a bash script here that uses the Datamuse API, and a Python script using the CMU Pronouncing Dictionary. The Python script has fairly mixed results.
git clone https://github.com/tigger04/rhyme-cli.git rhyme-cli
cd rhyme-cli
python3 -m virtualenv .
python3 -m pip install -r requirements.txt
- jq
- curl
rhyme [word]
# or
rhyme.py [word]