Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/heft > IHeftParsedCommandLine > commandName

IHeftParsedCommandLine.commandName property

Returns the subcommand passed on the Heft command line, before any aliases have been expanded. This can be useful when printing error messages that need to refer to the invoked command line.

Signature:

readonly commandName: string;

Remarks

For example, if the invoked command was heft test --verbose, then commandName would be test.

Suppose the invoked command was heft start which is an alias for heft build-watch --serve. In this case, the commandName would be start. To get the expanded name build-watch, use IHeftParsedCommandLine.unaliasedCommandName instead.

When invoking phases directly using heft run, the commandName is run.