2024-10-02 17:38:27 +00:00
|
|
|
import { Builtins, Cli } from "clipanion"
|
2024-10-01 14:19:27 +00:00
|
|
|
import figlet from "figlet"
|
|
|
|
import chalk from "chalk"
|
|
|
|
|
|
|
|
import { LoginCommand } from "./src/cmd/login.ts"
|
|
|
|
import { LogoutCommand } from "./src/cmd/logout.ts"
|
|
|
|
import { ListServerCommand } from "./src/cmd/list.ts"
|
2024-10-01 15:33:18 +00:00
|
|
|
import { StatusCommand } from "./src/cmd/status.ts"
|
|
|
|
import { InfoCommand } from "./src/cmd/info.ts"
|
2024-10-02 03:18:36 +00:00
|
|
|
import { ProcessCommand } from "./src/cmd/process-info.ts"
|
2024-10-02 15:12:52 +00:00
|
|
|
import { DeployCommand } from "./src/cmd/deploy.ts"
|
2024-10-02 17:38:27 +00:00
|
|
|
import { SyncCommand } from "./src/cmd/sync.ts"
|
|
|
|
import { ReloadCommand } from "./src/cmd/reload.ts"
|
2024-10-01 14:19:27 +00:00
|
|
|
|
|
|
|
const [node, app, ...args] = process.argv
|
|
|
|
|
2024-10-01 15:33:18 +00:00
|
|
|
const ENABLE_STARTUP_ASCII_ART = false
|
|
|
|
|
|
|
|
if (process.env["ENABLE_STARTUP_ASCII_ART"] || ENABLE_STARTUP_ASCII_ART) {
|
|
|
|
console.log(
|
|
|
|
chalk.yellow(figlet.textSync("RoadSign CLI", { horizontalLayout: "default", verticalLayout: "default" }))
|
|
|
|
)
|
|
|
|
}
|
2024-10-01 14:19:27 +00:00
|
|
|
|
|
|
|
const cli = new Cli({
|
|
|
|
binaryLabel: `RoadSign CLI`,
|
|
|
|
binaryName: `${node} ${app}`,
|
|
|
|
binaryVersion: `1.0.0`
|
|
|
|
})
|
|
|
|
|
2024-10-02 17:38:27 +00:00
|
|
|
cli.register(Builtins.VersionCommand)
|
|
|
|
cli.register(Builtins.HelpCommand)
|
2024-10-01 14:19:27 +00:00
|
|
|
cli.register(LoginCommand)
|
|
|
|
cli.register(LogoutCommand)
|
|
|
|
cli.register(ListServerCommand)
|
2024-10-01 15:33:18 +00:00
|
|
|
cli.register(StatusCommand)
|
|
|
|
cli.register(InfoCommand)
|
2024-10-02 03:18:36 +00:00
|
|
|
cli.register(ProcessCommand)
|
2024-10-02 15:12:52 +00:00
|
|
|
cli.register(DeployCommand)
|
2024-10-02 17:38:27 +00:00
|
|
|
cli.register(SyncCommand)
|
|
|
|
cli.register(ReloadCommand)
|
2024-10-01 14:19:27 +00:00
|
|
|
cli.runExit(args)
|