CLI
Create and Init
Commands for creating a new project or initializing an existing one.
project create
Create a new directory and initialize it as a Project-managed project.
project create [directory] [flags]Synonym: project new [directory] [flags]
Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
directory | yes, unless --tmp or --global-tmp is used | none | Directory to create and initialize. |
Flags
| Flag | Synonyms | Type | Default | Description |
|---|---|---|---|---|
--template | - | string | none | Template repository, for example DotNaos/project-template. |
--template-path | - | string | none | Local template path, mainly for local template development. |
--version | - | string | none | Template version to write into the project lock. |
--commit | - | string | none | Template commit or label to write into the project lock. |
--force | - | boolean | false | Replace an existing .project/template.lock.yaml. |
--github | - | boolean | false | Create a private GitHub repository by default and push the project. |
--github-visibility | - | string | private | GitHub repository visibility. Valid values: private, public. Requires --github when changed. |
--tmp | --local-tmp | boolean | false | Create a local tmp project in ./tmp and install default modules. |
--global-tmp | - | boolean | false | Create a generated project under /tmp. |
--help | -h | boolean | false | Print help. |
Behavior
- Creates the target directory.
- Writes
.project/template.lock.yaml. - Prints a copy-paste-ready
cd <path>line. - With
--tmpor--global-tmp, adds a random suffix so the command can be run repeatedly. - With
--tmpor--global-tmp, writes tmp template values and installs the template's default modules. - With
--github, initializes Git, creates a private GitHub repository by default, commits, and pushesmain. - GitHub repositories are private by default. Use
--github-visibility publicto create a public repository. - With
--github, storesOP_SERVICE_ACCOUNT_TOKENon the new GitHub repository before the first push.
Examples
project create my-project
project new my-project
project new --tmp
project new my-project --global-tmp
project new my-project --github
project new my-project --github --github-visibility publicproject init
Initialize Project template state in an existing directory.
project init [directory] [flags]Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
directory | no | . | Existing directory to initialize. |
Flags
| Flag | Synonyms | Type | Default | Description |
|---|---|---|---|---|
--template | - | string | none | Template repository. |
--template-path | - | string | none | Local template path. |
--version | - | string | none | Template version. |
--commit | - | string | none | Template commit or label. |
--force | - | boolean | false | Replace an existing .project/template.lock.yaml. |
--help | -h | boolean | false | Print help. |
Examples
project init
project init existing-project
project init --template DotNaos/project-template --version 0.1.0