Add SteamWar CLI module

- add Clikt-based `sw` entrypoint and subcommands
- include database, user, dev, and profiler commands
- wire CLI build and CI install/release steps
This commit is contained in:
2026-05-09 16:46:59 +02:00
parent 8ade5180cb
commit 1451750bcb
15 changed files with 581 additions and 0 deletions
@@ -0,0 +1,22 @@
package de.steamwar.commands.database
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.CliktError
import com.github.ajalt.clikt.core.Context
import com.github.ajalt.clikt.core.findOrSetObject
import com.github.ajalt.clikt.parameters.options.flag
import com.github.ajalt.clikt.parameters.options.option
import de.steamwar.db.Database
class DatabaseCommand: CliktCommand(name = "db") {
val useProduction by option().flag()
val db by findOrSetObject { Database }
override fun help(context: Context): String = "Run database commands"
override fun run() {
if (!useProduction && db.database == "production") {
throw CliktError("You should not use the production database!")
}
}
}