Skip to content

new command

Terminal window
keel new [project-name]

Alias:

Terminal window
keel n [project-name]
  • Cannot be empty.
  • Cannot contain spaces.
  • Cannot contain / or \.
  • With --yes (-y) the name must be passed as an argument.

The command prompts, in this order:

  1. Project name (if not passed as argument)
  2. Module host: GitHub, GitLab, Custom domain or Local module
  3. Owner/group/domain based on host
  4. Confirmation or manual editing of module path
  5. Use of Air and creation of .air.toml
  6. .env support
  7. Initialize Git repository
  8. Install dependencies (go mod tidy)
FlagDescription
--yes, -ySkips prompts and applies defaults
--without-starter-moduleDoes not create internal/modules/starter
--with-folder-structureCreates an opinionated structure (middleware, guards, scheduler, etc.)

Base:

  • cmd/main.go
  • go.mod
  • keel.toml
  • README.md
  • .gitignore

Optional:

  • .env, .env.example
  • .air.toml
  • internal/modules/starter/*
  • folders: internal/middleware, internal/guards, internal/scheduler, internal/checkers, internal/events, internal/hooks

Depending on your answers:

  • git init <appName>
  • go mod tidy
  • initial commit with message: feat: initial commit keel framework

If something fails, the command continues and shows warnings () in the console.

Defaults applied by the CLI:

  • moduleName = github.com/my-github-user/<app>
  • useAir = true
  • includeAirConfig = true
  • useEnv = true
  • initGit = true
  • installDeps = true

Interactive project:

Terminal window
keel new payments-api

Automatic project with full structure:

Terminal window
keel new payments-api --yes --with-folder-structure

Project without starter module:

Terminal window
keel new payments-api --without-starter-module
  • directory '<name>' already exists
  • project name cannot be empty
  • project name cannot contain spaces
  • project name must not contain '/' or '\\'
  • project name is required when using --yes/-y

If you use --without-starter-module and don’t use --with-folder-structure, create internal/ manually before using keel generate, because that command requires a valid Keel project structure.