Skip to content

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 create-typescript-app:

Terminal window
npx create-typescript-app
┌ ✨ create-typescript-app@2.0.0 ✨
│ Learn more on: https://github.com/JoshuaKGoldberg/create-typescript-app
│ Running with mode --setup for a new repository.

All Bingo templates support the following set of CLI flags.

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:

Terminal window
npx create-typescript-app --directory my-fancy-project

Type: boolean

Prints help text.

Terminal window
npx create-typescript-app --help

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 create-typescript-app:

Terminal window
npx create-typescript-app --mode setup

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 create-typescript-app:

Terminal window
npx create-typescript-app --offline

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 create-typescript-app:

Terminal window
npx create-typescript-app --skip-files

Type: boolean

Whether to skip sending network requests as specified by templates. In setup mode, this includes creating a repository on GitHub.

For example, creating a repository using create-typescript-app without populating network requests, but with network installation of packages (pnpm install instead of pnpm install --offline):

Terminal window
npx create-typescript-app --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.

Type: boolean

Whether to skip running local scripts as specified by templates.

For example, creating a repository using create-typescript-app without running scripts such as pnpm format --write:

Terminal window
npx create-typescript-app --skip-scripts

Type: boolean

Prints the Bingo and template package versions.

Terminal window
npx create-typescript-app --version

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:

Terminal window
npx create-typescript-app --title 'My New App'

Any required options that are not provided will be prompted for by the template’s CLI.

Made with 💝 in Boston by Josh Goldberg.