diff --git a/.changeset/chatty-toes-relate.md b/.changeset/chatty-toes-relate.md new file mode 100644 index 00000000..2ede6e42 --- /dev/null +++ b/.changeset/chatty-toes-relate.md @@ -0,0 +1,5 @@ +--- +"@cartesi/cli": patch +--- + +adds --dry-run to run command diff --git a/apps/cli/src/commands/run.ts b/apps/cli/src/commands/run.ts index f3364147..db7c6105 100644 --- a/apps/cli/src/commands/run.ts +++ b/apps/cli/src/commands/run.ts @@ -54,6 +54,11 @@ export default class Run extends BaseCommand { description: "port to listen for incoming connections", default: 8080, }), + "dry-run": Flags.boolean({ + description: "show the docker compose configuration", + default: false, + hidden: true, + }), }; public async run(): Promise { @@ -169,6 +174,15 @@ export default class Run extends BaseCommand { process.on("SIGINT", () => {}); try { + if (flags["dry-run"]) { + // show the docker compose configuration + await execa("docker", [...compose_args, "config"], { + env, + stdio: "inherit", + }); + return; + } + // run compose environment await execa("docker", [...compose_args, "up", ...up_args], { env,