[id="osdk-cli-reference-new_{context}"]
= new

The `operator-sdk new` command creates a new Operator application and generates
(or _scaffolds_) a default project directory layout based on the input
`<project_name>`.

.`new` arguments
[options="header",cols="1,3"]
|===
|Argument |Description

|`<project_name>`
|Name of the new project.
|===

.`new` flags
[options="header",cols="1,3"]
|===
|Flag |Description

|`--api-version`
|CRD `APIVersion` in the format `$GROUP_NAME/$VERSION`, for example `app.example.com/v1alpha1`. Used with `ansible` or `helm` types.

|`--generate-playbook`
|Generate an Ansible playbook skeleton. Used with `ansible` type.

|`--header-file <string>`
|Path to file containing headers for generated Go files. Copied to `hack/boilerplate.go.txt`.

|`--helm-chart <string>`
|Initialize Helm operator with existing Helm chart: `<url>`, `<repo>/<name>`, or local path.

|`--helm-chart-repo <string>`
|Chart repository URL for the requested Helm chart.

|`--helm-chart-version <string>`
|Specific version of the Helm chart. (Default: latest version)

|`--help, -h`
|Usage and help output.

|`--kind <string>`
|CRD `Kind`, for example `AppService`. Used with `ansible` or `helm` types.

| `--skip-git-init`
|Do not initialize the directory as a Git repository.

|`--type`
|Type of Operator to initialize: `go`, `ansible` or `helm`. (Default: `go`)

|===

[NOTE]
====
Starting with Operator SDK v0.12.0, the `--dep-manager` flag and support for
`dep`-based projects have been removed. Go projects are now scaffolded to use Go
modules.
====

.Example usage for Go project

[source,terminal]
----
$ mkdir $GOPATH/src/github.com/example.com/
----

[source,terminal]
----
$ cd $GOPATH/src/github.com/example.com/
----

[source,terminal]
----
$ operator-sdk new app-operator
----

.Example usage for Ansible project

[source,terminal]
----
$ operator-sdk new app-operator \
    --type=ansible \
    --api-version=app.example.com/v1alpha1 \
    --kind=AppService
----
