you'll need to install google's zx command line tool and be running node 16 or later
npm i -g zx
Save this script in its own directory somewhere like
mb-jars/
mb-jars.mjs
Then add an alias to your .zshrc
or .bashrc
or whatever
alias mb-jar="cd ~/projects/mb-jars && zx mb-jars.mjs"
Simply give it the version you want to run and it will download and run that jar
mb-jar 47.2
Will download and run the enterprise 47.2 jar on port 3472, and create a database for metabase v47
mb-jar 46.8 oss
Will download and run the oss 46.8 jar on port 3468, and create a database for metabase v46