This is the entire app and you can run it with swift main.swift or compile it with swiftc main.swift and rename the resulting (merely 40 KB) executable to whatever you want to be in the menubar.

Source: macos – What is the minimally-viable GUI for command-line Swift scripts? – Stack Overflow