Skip to content

run command

Terminal window
keel run [script]

run takes the command from [scripts] in keel.toml.

[scripts]
dev = "air -c .air.toml"
build = "go build -o bin/my-api ./cmd/main.go"
test = "go test ./..."
lint = "golangci-lint run"
Terminal window
keel run dev
keel run test
keel run build

You can also define your own scripts:

[scripts]
migrate = "go run ./cmd/migrate/main.go up"
Terminal window
keel run migrate
  • Unix/macOS: sh -c "<script>"
  • Windows: cmd /C "<script>"

This allows compound commands like &&, pipes, and redirections.

The command fails when:

  • keel.toml does not exist
  • the [scripts] section does not exist
  • the requested script does not exist or is empty
  • the shell command returns an error

Typical errors:

  • keel.toml not found in current directory
  • no scripts defined in keel.toml
  • script '<name>' does not exist in keel.toml
  1. Keep scripts reproducible (build, test, lint, dev).
  2. Avoid destructive commands without confirmation.
  3. Keep keel.toml versioned alongside the code to standardize the team’s workflow.