---
title: generate
description: API reference for the `turbo generate` command
product: turborepo
type: reference
summary: All flags and options for the `turbo generate` command used to scaffold new packages and run custom generators.
related:
  - /docs/guides/generating-code
  - /docs/reference/turbo-gen
---

# generate

Extend your Turborepo with new apps and packages.

```bash title="Terminal"
turbo generate
```

* [`turbo generate run [generator-name]`](#run-generator-name): Run custom generators defined in your repository.
* [`turbo generate workspace [options]`](#workspace): Create a new package in your repository by copying an existing one or from the start.

For more information and practical use cases for writing custom generators, visit [the "Generating code" guide](/docs/guides/generating-code).

<Callout type="info">
  `turbo gen` is an alias for `turbo generate`. Additionally, `run` is the
  default command so `turbo gen` is equivalent to `turbo generate run`.
</Callout>

run [generator-name] [#run-generator-name]

Run custom generators defined in your repository.

```bash title="Terminal"
turbo gen run [generator-name]
```

Flag options [#flag-options]

--args [#--args]

Answers to pass directly to the generator's prompts.

--config <path> [#--config-path]

Generator configuration file.

Default: `turbo/generators/config.js`

--root <path> [#--root-path]

The root of your repository

Default: directory with root `turbo.json`

workspace [#workspace]

Create a new workspace.

```bash title="Terminal"
turbo gen workspace [options]
```

Flag options [#flag-options-1]

--name <name> [#--name-name]

The name for the new workspace to be used in the `package.json` `name` key. The `name` key is the unique identifier for the package in your repository.

--empty [#--empty]

Creates an empty workspace. Defaults to `true`.

--copy <name>/<url> [#--copy-nameurl]

Name of local workspace within your monorepo or a fully qualified GitHub URL with any branch and/or subdirectory.

--destination <path> [#--destination-path]

Where the new workspace should be created.

--type <app/package> [#--type-apppackage]

The type of workspace to create (`app` or `package`).

--root <path> [#--root-path-1]

The root of your repository. Defaults to the directory of the root `turbo.json`.

--show-all-dependencies [#--show-all-dependencies]

Prevent filtering dependencies by workspace type when selecting dependencies to add.

--example-path <path>, -p <path> [#--example-path-path--p-path]

In a rare case, your GitHub URL might contain a branch name with a slash (e.g. `bug/fix-1`) and the path to the example (e.g. `foo/bar`). In this case, you must specify the path to the example separately.

---

[View full sitemap](/sitemap.md)