zsh command not found msfconsole Metasploit MacOS

Once you have installed Metasploit on your mac from the nightly builds

https://docs.metasploit.com/docs/using-metasploit/getting-started/nightly-installers.html

When you go to run the msfconsole command you may get the error command not found

That is because you need to add Metasploit to the paths file

The PATH file is a system-level variable that holds a list of directories. When you enter a command in the terminal, it’s shorthand for a program with the same name. The system looks in each of the PATH directories for the program corresponding to the command. When it finds a matching program, it runs it.

To edit the paths file type

sudo vi /etc/paths

Enter you password to elevate privileges

Note: each entry is separated by a new line

hit i or shift + : + i and hit enter depends on your version of vi

Add on separate lines

/opt/metasploit-framework/bin

/opt/metasploit-framework

/opt/metasploit-framework/framwork

how hit esc

then enter :wq! + enter

you will need to close and reopen the console now type

msfconsole

and

Metasploit will open