install

new-project

CLI tool for scaffolding new projects from the Oh-My Copier template. No local Python installation required — everything runs inside Docker.

Prerequisites

Installation

curl -fsSL https://install.krengtest.se/install | bash

If ~/.local/bin is not already in your PATH, the installer will print instructions. In that case, run:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Usage

new-project <project-name>

The script creates a new directory with the project name in the current directory, clones the template repository, and starts an interactive guide where you fill in project details. Once complete, an initial git commit is created.

Examples

# Create a project in the current directory
new-project my-new-site

# Create a project in a specific directory
new-project my-new-site --output ~/projects

# Use a specific branch or tag from the template repository
new-project my-new-site --vcs-ref feat/magento

# Run non-interactively using an answers file
new-project my-new-site --answers answers.yml

# Use a different template repository
new-project my-new-site --template git@github.com:another-org/template.git

Flags

Flag Description
--output DIR Create the project in the specified directory (default: current directory)
--answers FILE Path to a YAML file with answers for non-interactive mode
--vcs-ref REF Branch, tag, or commit to use from the template repository
--template REPO Override the default template repository
--help Show help text
--version Show version number

Environment Variables

Variable Description
GIT_SCAFFOLD_TEMPLATE Override the default template repository
GIT_SCAFFOLD_TEMPLATE="git@github.com:my-org/template.git" new-project my-project

Non-interactive Mode (answers file)

For automated workflows, you can provide a YAML file with answers to the template’s questions:

# answers.yml
project_name: my-site
project_description: A description of the project
new-project my-project --answers answers.yml

How It Works

  1. Checks that Docker is running
  2. Checks (if gh is installed) that the repo name does not already exist in the Oh-My GitHub organization
  3. Creates the project directory and initializes a git repository
  4. Starts a Docker container with Python and installs Copier
  5. Runs Copier against the template repository — either interactively or with an answers file
  6. Creates an initial commit with all generated files

If anything goes wrong, the project directory is automatically cleaned up.

Updating

Run the install command again to get the latest version:

curl -fsSL https://install.krengtest.se/install | bash