Project
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

ArgumentRequiredDefaultDescription
directoryyes, unless --tmp or --global-tmp is usednoneDirectory to create and initialize.

Flags

FlagSynonymsTypeDefaultDescription
--template-stringnoneTemplate repository, for example DotNaos/project-template.
--template-path-stringnoneLocal template path, mainly for local template development.
--version-stringnoneTemplate version to write into the project lock.
--commit-stringnoneTemplate commit or label to write into the project lock.
--force-booleanfalseReplace an existing .project/template.lock.yaml.
--github-booleanfalseCreate a private GitHub repository by default and push the project.
--github-visibility-stringprivateGitHub repository visibility. Valid values: private, public. Requires --github when changed.
--tmp--local-tmpbooleanfalseCreate a local tmp project in ./tmp and install default modules.
--global-tmp-booleanfalseCreate a generated project under /tmp.
--help-hbooleanfalsePrint help.

Behavior

  • Creates the target directory.
  • Writes .project/template.lock.yaml.
  • Prints a copy-paste-ready cd <path> line.
  • With --tmp or --global-tmp, adds a random suffix so the command can be run repeatedly.
  • With --tmp or --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 pushes main.
  • GitHub repositories are private by default. Use --github-visibility public to create a public repository.
  • With --github, stores OP_SERVICE_ACCOUNT_TOKEN on 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 public

project init

Initialize Project template state in an existing directory.

project init [directory] [flags]

Arguments

ArgumentRequiredDefaultDescription
directoryno.Existing directory to initialize.

Flags

FlagSynonymsTypeDefaultDescription
--template-stringnoneTemplate repository.
--template-path-stringnoneLocal template path.
--version-stringnoneTemplate version.
--commit-stringnoneTemplate commit or label.
--force-booleanfalseReplace an existing .project/template.lock.yaml.
--help-hbooleanfalsePrint help.

Examples

project init
project init existing-project
project init --template DotNaos/project-template --version 0.1.0

On this page