Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

Enhance CLI error handling by adding detailed messages for invalid inputs and improving user feedback during command execution.

vholik10760c59a704
diff --git a/packages/cli/src/commands/info.ts b/packages/cli/src/commands/info.ts
new file mode 100644
index 000000000..24873b9fa
--- /dev/null
+++ b/packages/cli/src/commands/info.ts
@@ -0,0 +1,25 @@
+import { getConfig } from "@/src/utils/get-config";
+import { getProjectInfo } from "@/src/utils/get-project-info";
+import { handleError } from "@/src/utils/handle-error";
+import { logger } from "@/src/utils/logger";
+import { Command } from "commander";
+
+export const info = new Command()
+ .name("info")
+ .description("get information about your project")
+ .option(
+ "-c, --cwd <cwd>",
+ "the working directory. defaults to the current directory.",
+ process.cwd()
+ )
+ .action(async (opts) => {
+ try {
+ logger.info("> project info");
+ console.log(await getProjectInfo(opts.cwd));
+ logger.break();
+ logger.info("> blocks.json");
+ console.log(await getConfig(opts.cwd));
+ } catch (error) {
+ handleError(error);
+ }
+ });