The Command Line Tools include the Swift compiler without needing Xcode installed. Open up a terminal and type “swift” to enter the REPL or “swiftc” to compile a Swift File. SPM is included too.
If they’re not already installed, running one of those commands will prompt you to install them.