The following is the full example of kosko.toml. Config files must be written in TOML. All properties are optional.

# Global configs
require = ["a"]
components = ["b"]
extensions = ["js", "json"]
baseEnvironment = "c"
# Environment configs
require = ["c"]
components = ["d"]
require = ["e"]
components = ["f"]
global = "environments/#{environment}"
component = "environments/#{environment}/#{component}"

Global Configs

Global configs are always applied.


Require external modules.

# Using TypeScript
require = ["ts-node/register"]


Components to generate. It can be either a component's name or a glob pattern.

# Generate all components in components folder
components = ["*"]
# Generate components with specified names
components = ["foo", "bar"]
# Generate components matched to the glob pattern
components = ["nginx_*"]
# Ignore components
components = ["!foo", "!bar"]


Extension names of components. You don't have to set this option. It's detected automatically from require.extensions.


Specify the base environment. You may define default or common variables in the base environment. The base environment can be used with or without --env/e option. When --env/-e option is set, variables in the base environment are overrided by the specified environment.

Environment Configs

Environment configs are applied when you run kosko generate with --env/-e option. Environment configs are merged with global configs.

# Applied when env = "dev"
require = ["c"]
components = ["d"]
# Applied when env = "prod"
require = ["e"]
components = ["f"]


Specify the path to global environment file.


Specify the path to component environment file.