Skip to main content



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

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

Global Configs#

Global configs are always applied.


Require external modules.

# Using TypeScriptrequire = ["ts-node/register"]


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

# Generate all components in components foldercomponents = ["*"]
# Generate components with specified namescomponents = ["foo", "bar"]
# Generate components matched to the glob patterncomponents = ["nginx_*"]
# Ignore componentscomponents = ["!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.