Purpose of `no-prompt` option in `frontity create-package` command

What is the purpose of the no-prompt option in frontity create-package command
It asks you the same questions with or without this option

⬢  cool-project  npx frontity create-package my-custom-theme --no-prompt
? Enter the namespace of the package: theme
✔ Adding package.json.
✔ Adding src/index.js.
✔ Installing package my-custom-theme.

New package "my-custom-theme" created.

⬢  cool-project  npx frontity create-package my-custom-theme2
? Enter the namespace of the package: theme
✔ Adding package.json.
✔ Adding src/index.js.
✔ Installing package my-custom-theme2.

New package "my-custom-theme2" created.

This flag is intended for programmatic use of the CLI.

You can also pass the name of the package as an environmental variable FRONTITY_NAME . In this case, if you pass the --no-prompt flag, the CLI will use the name from that variable.

If you don’t specify FRONTITY_NAME, the CLI will have to prompt you for the name of the package because otherwise how is it going to know what you want to call it? :sweat_smile:

But I agree that it should be documented much better because it’s confusing - I would also think that it’s a bug!

Yeah, --no-prompt should never prompt, and it should use the default options if the args or ENV variables are not present. In this case, it should use the namespace theme. So I agree with @mmczaplinski, this is a bug.

Could you please guys open a bug?

Bug report: https://github.com/frontity/frontity/issues/434

@juanma Sorry if my initial reply was confusing to you. I think I misunderstod that you were already passing the name of the package to the CLI. It’s indeed a bug!

1 Like