How to build and run a Xcode project from the CLI

Hello, I'm a beginner and have started learning Swift. I want to create a toy CLI project that needs to read the arguments you pass to it, but I'm unable to figure out how I can run this project from the CLI so I can actually pass arguments to my program. Any idea?

Hm okay I was able make Xcode pass arguments to my program at:
Product -> Scheme -> Edit Scheme (shortcut: cmd + ;) -> Arguments -> Arguments Passed On Launch.

But how can I do this from the CLI then?

I asked a similar question some time ago, see Building non-UI programs, e.g., command-line tools, servers, etc

Thank you!