While usually I save my passwords on a text file and I just copy them before use in some infrastructures I need to enter the same password repeatedly. I find it a chore to switch to the Visual Studio Code, search the password, select and copy them each time I need to use the password so I figured out this script which I added to the Dock in my MacBook Pro. Now every time I need to fetch the password I just need to go to the dock and click on the script and the password is as good as copied into memory. This has considerably saved me a lot of time while working.
Just dont forget to make the .command files executable by using the chmod a+x
#!/bin/bash echo 'password' | pbcopy exit