The project
command
Sets up a corgi project.
Basic usage
From your command line, cd
into an empty directory and run:
npx @wethegit/corgi@latest project .
The dot .
indicates the current working directory. You can also choose to specify a directory name instead.
You'll then be prompted to enter an optional template repo. For more information on templates, see the template option below.
Arguments
Arguments | Description |
---|---|
directory | Relative directory to create the project in. If you do not pass a directory argument, you will be prompted for one. |
Examples
npx @wethegit/corgi@latest project .
npx @wethegit/corgi@latest project my-cool-website
Options
Flag | Short flag | Description |
---|---|---|
--template | -t | Optional. URL of a GitHub repo's branch containing a corgi template. Example: https://github.com/<user>/<repo>/tree/<branchname> . If you do not pass this flag, you will be prompted to enter an optional template. |
--help | -h | Displays a list of arguments and options. |
Templates
Pre-defined templates for corgi projects can be pulled into your project automatically, by specifying the --template
option within the project
command. These templates must live within a branch of a GitHub repo which you have access to. Templates are just sets of files which extend the base corgi setup. This typically includes sets of pre-defined pages, components, locales, and so on.
Example
npx @wethegit/corgi@latest project . --template https://github.com/<user>/<repo>/tree/<branchname>
Custom config
If a custom template is specified, the project
command will look for an optional JSON file located the root of the template repo, called corgi-project.config.json
.
This config file can include overrides for the project at the time of initial scaffolding. Currently, the "package" property is the only supported config, but this allows you to add fields and values to your project's package.json
. Some examples include extra dependencies, scripts, and a project name. The default corgi config settings look like this:
{
package: {
name: "corgi-project",
dependencies: {},
devDependencies: {},
scripts: {},
}
}
You can overwrite any of these properties from within your template's corgi-project.config.json
, like so:
{
"name": "andrews-corgi-project",
"dependencies": {
"gsap": "~3.12.2",
"three": "~0.154.0"
},
"scripts": {
"serve-https": "node https-server.js"
}
}