Configuration
Complete guide to configuring kist for your project.
Configuration File
kist uses YAML configuration files. By default, kist looks for kist.yml in your project root.
bash
# Use default config
kist
# Specify a config file
kist --config kist.production.ymlBasic Structure
yaml
# Project metadata
name: my-project
version: 1.0.0
# Plugins to load
plugins:
- @getkist/action-sass
- @getkist/action-typescript
# Build pipeline definition
pipeline:
build:
stages:
- name: stage-name
steps:
- action: ActionName
options:
key: valueConfiguration Options
Project Metadata
yaml
name: my-project # Project name
version: 1.0.0 # Project version (semver)
description: My project # Optional descriptionPlugins
Declare plugins to load:
yaml
plugins:
# Official plugins (scoped)
- @getkist/action-sass
- @getkist/action-typescript
# Community plugins
- kist-plugin-custom
# Local plugins
- ./plugins/my-pluginPipeline Definition
Define your build pipeline with stages and steps:
yaml
pipeline:
# Pipeline name
build:
# Optional pipeline settings
parallel: false # Run stages in parallel
continueOnError: false # Stop on first error
stages:
- name: prepare
steps:
- action: DirectoryCleanAction
options:
directory: dist
- action: DirectoryCreateAction
options:
directory: dist
- name: compile
steps:
- action: TypeScriptCompilerAction
options:
tsconfig: tsconfig.jsonMultiple Pipelines
Define multiple pipelines for different tasks:
yaml
pipeline:
dev:
stages:
- name: build
steps:
- action: TypeScriptCompilerAction
options:
tsconfig: tsconfig.json
prod:
stages:
- name: build
steps:
- action: TypeScriptCompilerAction
options:
tsconfig: tsconfig.prod.json
- name: minify
steps:
- action: JavaScriptMinifyAction
options:
inputFile: dist/index.js
outputFile: dist/index.min.jsCore Actions
These actions are built into kist:
| Action | Description |
|---|---|
DirectoryCleanAction | Remove directory contents |
DirectoryCopyAction | Copy directories |
DirectoryCreateAction | Create directories |
FileCopyAction | Copy files |
FileRenameAction | Rename files |
VersionWriteAction | Write version files |
RunScriptAction | Run npm scripts |
PackageManagerAction | npm operations |
DocumentationAction | Generate docs |
Action Options
Each action has its own options. Example:
yaml
- action: StyleProcessingAction
options:
inputFile: src/styles/main.scss
outputFile: dist/css/main.css
style: compressed # compressed | expanded
sourceMap: true
- action: TypeScriptCompilerAction
options:
tsconfig: tsconfig.json
outDir: dist/js
declaration: trueEnvironment Variables
Use environment variables in your config:
yaml
pipeline:
build:
stages:
- name: deploy
steps:
- action: RunScriptAction
options:
script: deploy
env:
API_KEY: ${API_KEY}
NODE_ENV: productionConfig Inheritance
Kist supports configuration inheritance through the extends keyword, allowing you to create reusable base configurations.
Basic Usage
Create a base config and extend it:
yaml
# kist.base.yml
name: my-project
plugins:
- @getkist/action-typescript
- @getkist/action-sass
defaults:
outputDir: distyaml
# kist.dev.yml
extends: ./kist.base.yml
pipeline:
dev:
stages:
- name: build
steps:
- action: TypeScriptCompilerAction
options:
sourceMap: trueHow Merging Works
When extending a configuration:
- Objects are deep merged - Child properties override parent properties
- Arrays are replaced - Child arrays completely replace parent arrays
- Primitives are overwritten - Simple values in child override parent
yaml
# base.yml
project:
name: my-project
settings:
debug: false
timeout: 30
plugins:
- plugin-a
- plugin-b
# child.yml
extends: ./base.yml
project:
settings:
debug: true # Overrides to true
newOption: 1 # Added
# timeout: 30 # Inherited from base
plugins:
- plugin-c # Replaces entire arrayResult:
yaml
project:
name: my-project
settings:
debug: true
timeout: 30
newOption: 1
plugins:
- plugin-cMultiple Inheritance
Extend from multiple configs (processed in order):
yaml
extends:
- ./configs/base.yml
- ./configs/typescript.yml
- ./configs/testing.yml
# Your overrides hereEnvironment-Specific Configs
yaml
# kist.yml (base)
name: my-app
plugins:
- @getkist/action-typescript
defaults:
minify: false
sourceMap: trueyaml
# kist.production.yml
extends: ./kist.yml
defaults:
minify: true
sourceMap: false
pipeline:
build:
stages:
- name: optimize
steps:
- action: JavaScriptMinifyActionRun with: kist --config kist.production.yml
Shared Team Configs
Create organization-wide configs:
yaml
# @myorg/kist-config-base/index.yml
name: "{{ project.name }}"
plugins:
- @getkist/action-typescript
- @getkist/action-eslint
- @getkist/action-jest
defaults:
compilerOptions:
target: ES2020
strict: trueyaml
# Your project's kist.yml
extends: "@myorg/kist-config-base"
project:
name: my-specific-projectCLI Options
Override config options via CLI:
bash
# Specify config file
kist --config kist.yml
# Set log level
kist --log-level debug
# Run specific pipeline
kist --pipeline prod
# Watch mode
kist --watchBest Practices
- Use separate configs for dev/prod environments
- Keep secrets in environment variables
- Use meaningful stage names for clarity
- Order stages by dependency (clean → build → test → deploy)
- Document custom options in your README
Next Steps
- Pipeline Architecture - Deep dive into pipelines
- Available Plugins - Browse all plugins
- API Reference - Full API documentation
