UNPKG

@npio/cli

Version:

A free visual website editor, powered with your own SolidJS components.

26 lines (22 loc) 751 B
import { useServerConfig } from "nitropage/server"; import type sade from "sade"; export const configCommands = function (prog: sade.Sade) { prog .command("config get") .describe("Output the server configuration") .option("--secrets, -s", "Do not obfuscate secrets") .action(async ({ secrets }: { secrets: string | boolean }) => { const config = structuredClone(useServerConfig()); if (!secrets) { config.auth.salt = "***"; config.auth.password = "***"; if (config.filesystem.drivers.s3) { config.filesystem.drivers.s3.accessKey = "***"; config.filesystem.drivers.s3.secretKey = "***"; } } console.dir(config, { depth: null, }); }); };