CLI
Bingo templates each provide a CLI to set up a new repository or transition an existing one. That CLI will interactively prompt you for any required options that can’t be inferred from disk.
For example, to run @mfaith/create:
npx @mfaith/createpnpx @mfaith/createyarn dlx @mfaith/create┌ ✨ @mfaith/create@2.0.0 ✨││ Learn more on: https://github.com/michaelfaith/mfaith-create││ Running with mode --setup for a new repository.Common Flags
Section titled “Common Flags”All Bingo templates support the following set of CLI flags.
--directory
Section titled “--directory”Type:
string
What local directory path to run under.
If not provided:
- If the current directory is empty, defaults to it (
.) - Otherwise, you’ll be prompted to input one
For example, creating a new repository in a subdirectory:
npx @mfaith/create --directory my-fancy-projectpnpx @mfaith/create --directory my-fancy-projectyarn dlx @mfaith/create --directory my-fancy-project--help
Section titled “--help”Type:
boolean
Prints help text.
npx @mfaith/create --helppnpx @mfaith/create --helpyarn dlx @mfaith/create --help--mode
Section titled “--mode”Type:
string
Which Execution Mode to run in.
If not provided, it will be inferred based on whether Bingo is being run in an existing repository.
For example, specifying creating a new repository with @mfaith/create:
npx @mfaith/create --mode setuppnpx @mfaith/create --mode setupyarn dlx @mfaith/create --mode setup--offline
Section titled “--offline”Type:
boolean
Whether to run in an “offline” mode that skips network requests.
If provided, templates will be hinted to not make any network requests. That often means they will install from offline caches, skip creating a repository on GitHub, and skip sending GitHub API requests. The repository will roughly be a local-only creation.
For example, specifying creating a new repository offline with @mfaith/create:
npx @mfaith/create --offlinepnpx @mfaith/create --offlineyarn dlx @mfaith/create --offline--owner
Section titled “--owner”Type:
string
What GitHub organization or user the repository will be under.
This is used as the owner of the repository created by --remote.
If not provided, Bingo will infer it from the GitHub CLI’s configured user, then prompt for it if the template defines an owner option.
For example, creating a new repository under a my-organization organization:
npx @mfaith/create --owner my-organization --remotepnpx @mfaith/create --owner my-organization --remoteyarn dlx @mfaith/create --owner my-organization --remote--remote
Section titled “--remote”Type:
boolean
Whether to create a remote repository on GitHub if one does not already exist.
Defaults to whether an origin Git remote already exists in the repository.
When enabled, Bingo will:
- Create a remote repository on GitHub if one does not exist, adding it as the
originremote - Apply any network requests specified by the template to the remote repository
When disabled, Bingo will not create a remote repository and will skip requests (--skip-requests will default to true).
--repository
Section titled “--repository”Type:
string
What the repository will be named.
Defaults to the name of the --directory being run under.
Providing --repository without --directory will also use it as the directory name.
For example, creating a new repository whose name differs from its local directory:
npx @mfaith/create --directory my-local-directory --repository my-fancy-projectpnpx @mfaith/create --directory my-local-directory --repository my-fancy-projectyarn dlx @mfaith/create --directory my-local-directory --repository my-fancy-project--skip-files
Section titled “--skip-files”Type:
boolean
Whether to skip creating files on disk.
This can be useful if you’d like to only run scripts such as linter auto-fixing and update repository settings for a previously created repository.
For example, specifying updating all of repository except its files with @mfaith/create:
npx @mfaith/create --skip-filespnpx @mfaith/create --skip-filesyarn dlx @mfaith/create --skip-files--skip-requests
Section titled “--skip-requests”Type:
boolean
Whether to skip sending network requests as specified by templates.
For example, creating a repository using @mfaith/create without populating network requests, but with network installation of packages (pnpm install instead of pnpm install --offline):
npx @mfaith/create --skip-requestspnpx @mfaith/create --skip-requestsyarn dlx @mfaith/create --skip-requests--skip-requests effectively defaults to true if --offline is provided.
However, it does not prevent network requests from being sent by other parts of templates.
For example, templates may run package installation scripts that don’t include their own --offline flag when Bingo’s --offline is not provided.
--skip-scripts
Section titled “--skip-scripts”Type:
boolean
Whether to skip running local scripts as specified by templates.
For example, creating a repository using @mfaith/create without running scripts such as pnpm format --write:
npx @mfaith/create --skip-scriptspnpx @mfaith/create --skip-scriptsyarn dlx @mfaith/create --skip-scripts--version
Section titled “--version”Type:
boolean
Prints the Bingo and template package versions.
npx @mfaith/create --versionpnpx @mfaith/create --versionyarn dlx @mfaith/create --versionTemplate Flags
Section titled “Template Flags”The template being generated from will likely add in additional flags. Templates generally add in a CLI flag for each of the options they support.
For example, if a template defines a title option, --title will be type string:
npx @mfaith/create --title 'My New App'pnpx @mfaith/create --title 'My New App'yarn dlx @mfaith/create --title 'My New App'Any required options that are not provided will be prompted for by the template’s CLI.