@rdh36/pc-name-cli
Version:
CLI to manage PC hostname
20 lines (19 loc) • 604 B
JavaScript
import { Command } from "commander";
import os from "os";
import chalk from "chalk";
import figlet from "figlet";
const program = new Command();
program
.version("1.0.0")
.description(chalk.green("Simple CLI to look name of the PC and change it"))
.addHelpText("beforeAll", figlet.textSync("PC Name CLI"));
program
.command("show")
.description("Show the current name of the PC")
.action(() => {
const name = os.hostname();
console.log(chalk.green(`The current name of the PC is ${name}`));
});
//update the name of the PC
program.parse(process.argv);