From 24bdb1083a1b700fe3c1cdd39648f22d45e27cce Mon Sep 17 00:00:00 2001 From: Austin Griffith Date: Sat, 24 Jan 2026 07:31:51 -0700 Subject: [PATCH] feat: add --project and --name CLI flags for setting project name Adds the ability to specify the project name via named flags in addition to the existing positional argument support: - `--project` / `-p` / `--name` flags to set the project name - Updates help message to document the new options This allows for more explicit CLI usage: npx create-eth --project my-dapp --solidity-framework foundry --- src/utils/parse-arguments-into-options.ts | 6 +++++- src/utils/show-help-message.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils/parse-arguments-into-options.ts b/src/utils/parse-arguments-into-options.ts index a7abc6971f..212cbcd1ea 100644 --- a/src/utils/parse-arguments-into-options.ts +++ b/src/utils/parse-arguments-into-options.ts @@ -25,6 +25,10 @@ export async function parseArgumentsIntoOptions( "--extension": String, "-e": "--extension", + "--project": String, + "-p": "--project", + "--name": "--project", + "--help": Boolean, "-h": "--help", }, @@ -39,7 +43,7 @@ export async function parseArgumentsIntoOptions( const help = args["--help"] ?? false; - let project: string | null = args._[0] ?? null; + let project: string | null = args["--project"] ?? args._[0] ?? null; // use the original extension arg const extensionName = args["--extension"]; diff --git a/src/utils/show-help-message.ts b/src/utils/show-help-message.ts index 441fabce13..e5864a9128 100644 --- a/src/utils/show-help-message.ts +++ b/src/utils/show-help-message.ts @@ -2,9 +2,10 @@ import chalk from "chalk"; export const showHelpMessage = () => { console.log(` ${chalk.bold.blue("Usage:")} - ${chalk.bold.green("npx create-eth<@version>")} ${chalk.gray("[--skip | --skip-install] [-s | --solidity-framework ] [-e | --extension ] [-h | --help]")} + ${chalk.bold.green("npx create-eth<@version>")} ${chalk.gray("[-p | --project ] [--skip | --skip-install] [-s | --solidity-framework ] [-e | --extension ] [-h | --help]")} `); console.log(` ${chalk.bold.blue("Options:")} + ${chalk.gray("-p, --project, --name")} Set project name ${chalk.gray("--skip, --skip-install")} Skip packages installation ${chalk.gray("-s, --solidity-framework")} Choose solidity framework ${chalk.gray("-e, --extension")} Add curated or third-party extension