Skip to content

CLI Overview

keel is the official CLI for the Keel ecosystem to create, initialize, and maintain structured Go projects.

This section is based on the real code of keel and ss-keel-core, including tests and generator templates.

  • keel/cmd/*: real definition of commands, arguments, aliases and flags.
  • keel/internal/generator/templates/*: exact files and structure generated by the CLI.
  • keel/cmd/*_test.go: expected behavior cases and errors.
  • ss-keel-core/core/*: resulting HTTP runtime (/health, /docs, OpenAPI, lifecycle).
  • Creating projects ready to work with (keel new)
  • Adopting Keel in existing projects (keel init)
  • Generating components with automatic wiring (keel generate)
  • Installing addons with automatic project wiring (keel add)
  • Running project scripts (keel run)
  • Shell autocompletion (keel completion)
CommandAliasPurpose
keel new [project-name]keel nCreates a new project from official templates
keel initGenerates keel.toml in an existing project
keel generate [type] [name]keel gGenerates modules/components and updates cmd/main.go
keel add [alias|repo]Installs an addon from the official registry or a direct GitHub repo
keel run [script]Runs scripts from [scripts] in keel.toml
keel completion ...Generates/installs autocompletion (zsh, bash, fish, powershell)
keel --versionkeel -vShows version, commit, build date and platform
Terminal window
# 1) Install CLI
go install github.com/slice-soft/keel@latest
# 2) Create project
keel new my-api
cd my-api
# 3) Run dev environment
keel run dev
# 4) Generate first module
keel generate module users --gorm
# 5) Install another addon
keel add jwt
# 6) Check commands and version
keel --help
keel --version

The CLI generates code that directly uses ss-keel-core:

  • core.New(core.KConfig{...})
  • app.Use(...)
  • app.RegisterController(...)
  • app.Listen()

When you run a generated project, you inherit the core’s behavior:

  • GET /health (if DisableHealth is false)
  • GET /docs and GET /docs/openapi.json when Env != "production"
  • standardized HTTP error handling and graceful shutdown