# Create Zuplo API

The `create-zuplo-api` CLI makes it easy to create a new Zuplo API using the
default template or an
[example](https://github.com/zuplo/zuplo/tree/main/examples) from a public
GitHub repository. It's the fastest way to get started with Zuplo.

```bash
npx create-zuplo-api@latest
```

## Options

`create-zuplo-api` comes with the following options:

- `-v, --version` - Output the current version of create-zuplo-api
- `--eslint` - Initialize with ESLint configuration
- `--prettier` - Initialize with Prettier configuration
- `--empty` - Initialize an empty project
- `--use-npm` - Explicitly tell the CLI to bootstrap the application using npm
- `--use-pnpm` - Explicitly tell the CLI to bootstrap the application using pnpm
- `--use-yarn` - Explicitly tell the CLI to bootstrap the application using Yarn
- `--use-bun` - Explicitly tell the CLI to bootstrap the application using Bun
- `--reset, --reset-preferences` - Reset the preferences saved for
  create-zuplo-api
- `--git` - Whether or not to initialize the project as a git repository
- `--version-check` - Whether or not to check for an outdated version
- `--install` - Whether or not to install packages
- `--yes` - Use saved preferences or defaults for unprovided options
- `-e, --example <example-name|github-url>` - An example to bootstrap the API
  with. You can use an example name from the official Zuplo repository or a
  public GitHub URL. The URL can use any branch and/or subdirectory
- `--example-path <path-to-example>` - In a rare case, your GitHub URL might
  contain a branch name with a slash (for example, bug/fix-1) and the path to
  the example (for example, foo/bar). In this case, you must specify the path to
  the example separately: `--example-path foo/bar`
- `-h, --help` - Display the help message

### Examples

The following examples show different ways to use `create-zuplo-api`:

#### With Default Template

```bash
npx create-zuplo-api@latest my-api
cd my-api
npm run dev
```

You will then be asked the following prompts:

```bash
What's your project named? my-api
Would you like to use ESLint? No / Yes
Would you like to use Prettier? No / Yes
```

#### With an Official Example from GitHub

To create a new Zuplo API using an official example from the Zuplo GitHub
repository, you specify the example name using the `--example` option.

```bash
npx create-zuplo-api@latest my-api --example my-example
```

You can find the list of available examples in the
[Zuplo examples repository](https://github.com/zuplo/zuplo/tree/main/examples).

#### With any Public GitHub Repository

To create a new Zuplo API using any public GitHub repository, you can specify
the repository URL using the `--example` option.

```bash
npx create-zuplo-api@latest my-api --example https://github.com/username/repo
```
