run command
keel run [script]run takes the command from [scripts] in keel.toml.
Configuration example
Section titled “Configuration example”[scripts]dev = "air -c .air.toml"build = "go build -o bin/my-api ./cmd/main.go"test = "go test ./..."lint = "golangci-lint run"Execution
Section titled “Execution”keel run devkeel run testkeel run buildYou can also define your own scripts:
[scripts]migrate = "go run ./cmd/migrate/main.go up"keel run migrateHow the script is executed internally
Section titled “How the script is executed internally”- Unix/macOS:
sh -c "<script>" - Windows:
cmd /C "<script>"
This allows compound commands like &&, pipes, and redirections.
Error behavior
Section titled “Error behavior”The command fails when:
keel.tomldoes 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 directoryno scripts defined in keel.tomlscript '<name>' does not exist in keel.toml
Best practices
Section titled “Best practices”- Keep scripts reproducible (
build,test,lint,dev). - Avoid destructive commands without confirmation.
- Keep
keel.tomlversioned alongside the code to standardize the team’s workflow.