Open Github repository in browser

I created a simple script to open one of my Github repositories in the browser. It starts by fetching the repositories, and ask which one to open. Obviously, you would need to change Alarid to your GitHub username if you would like to use this script 😊

~~Also, if someone knows how to make a "loading state" to avoid having just an empty prompt while fetching, that would be awesome! It only takes a few seconds, but still...~~

UPDATE: thanks @johnlindquist for the tip on the loading state, here is the updated version:

// Menu: Open Github Repo
// Description: Open the repo page in the browser
const USERNAME = "Alarid"
let dots = 0
let placeholderIntervalId = setInterval(() => {
setPlaceholder(`Loading ${USERNAME} github repos`.padEnd(++dots, "."))
}, 100)
const response = await get(`https://api.github.com/users/${USERNAME}/repos`)
const repositories = response.data
clearInterval(placeholderIntervalId)
if (!repositories) exit(1)
const choice = await arg(
"Which project?",
repositories.map((repo) => ({
name: repo.name,
description: repo.description,
value: repo.html_url,
}))
)
exec(`open ${choice}`)