diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..cb83045 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/cli/index.ts b/cli/index.ts index 7bf29a8..0d2b755 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -5,12 +5,18 @@ 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" +import { StatusCommand } from "./src/cmd/status.ts" +import { InfoCommand } from "./src/cmd/info.ts" const [node, app, ...args] = process.argv -console.log( - chalk.yellow(figlet.textSync("RoadSign CLI", { horizontalLayout: "default", verticalLayout: "default" })) -) +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" })) + ) +} const cli = new Cli({ binaryLabel: `RoadSign CLI`, @@ -21,4 +27,6 @@ const cli = new Cli({ cli.register(LoginCommand) cli.register(LogoutCommand) cli.register(ListServerCommand) +cli.register(StatusCommand) +cli.register(InfoCommand) cli.runExit(args) \ No newline at end of file diff --git a/cli/src/cmd/info.ts b/cli/src/cmd/info.ts new file mode 100644 index 0000000..a603f54 --- /dev/null +++ b/cli/src/cmd/info.ts @@ -0,0 +1,128 @@ +import { Command, Option, type Usage } from "clipanion" +import { RsConfig } from "../utils/config.ts" +import { createAuthHeader } from "../utils/auth.ts" +import chalk from "chalk" +import ora from "ora" + +export class InfoCommand extends Command { + static paths = [[`info`], [`if`]] + static usage: Usage = { + category: `Networking`, + description: `Fetching the stats of RoadSign Server`, + details: `Fetching the configured things amount and other things of a connected server`, + examples: [["Fetch stats from labeled server", `info