Get up and running with Kite in 5 minutes. This guide will help you create your first workflow.
Kite is a modern CI/CD workflow runner that lets you define pipelines as type-safe Kotlin code. Replace bash scripts and YAML configs with a powerful DSL that provides:
- ✅ Type safety - Catch errors at compile time
- ✅ IDE support - Full autocomplete and syntax highlighting
- ✅ Reusability - Define segments once, use everywhere
- ✅ Local testing - Test pipelines before pushing
- ✅ Platform agnostic - Works on any CI platform
Add Kite to your project:
// build.gradle.kts
repositories {
mavenCentral()
}
dependencies {
implementation("com.gianluz.kite:kite-core:0.1.0-alpha9")
implementation("com.gianluz.kite:kite-dsl:0.1.0-alpha9")
implementation("com.gianluz.kite:kite-runtime:0.1.0-alpha9")
}See Installation for other installation methods.
Create .kite/segments/build.kite.kts:
segments {
segment("build") {
description = "Build the project"
execute {
exec("./gradlew", "build")
}
}
segment("test") {
description = "Run tests"
dependsOn("build")
execute {
exec("./gradlew", "test")
}
}
}Create .kite/rides/ci.kite.kts:
ride {
name = "CI"
flow {
segment("build")
segment("test")
}
}# Run the CI ride
kite-cli ride CI
# Or run specific segments
kite-cli run build testThat's it! You've created your first Kite workflow.
Kite uses a simple directory structure:
your-project/
├── .kite/
│ ├── segments/ # Reusable units of work
│ │ ├── build.kite.kts
│ │ ├── test.kite.kts
│ │ └── deploy.kite.kts
│ └── rides/ # Workflow definitions
│ ├── ci.kite.kts
│ └── release.kite.kts
└── build.gradle.kts
Segments are reusable units of work - like building, testing, or deploying.
segment("build") {
description = "Build the application"
timeout = 10.minutes
execute {
exec("./gradlew", "build")
}
}Rides compose segments into workflows for different scenarios (CI, release, etc.).
ride {
name = "CI"
flow {
segment("build")
parallel {
segment("test")
segment("lint")
}
}
}Inside execute blocks, you have access to the execution context:
execute {
// Run commands
exec("./gradlew", "test")
// Access environment variables
val branch = env("BRANCH_NAME")
// Work with files
writeFile("output.txt", "Hello!")
// Conditional logic
if (branch == "main") {
exec("./deploy.sh")
}
}Learn more in Core Concepts.
IntelliJ IDEA automatically provides full IDE support for .kite.kts files:
- ✅ Syntax highlighting
- ✅ Autocomplete
- ✅ Type checking
- ✅ Refactoring support
- ✅ Error detection
After adding Kite dependencies, reload your Gradle project:
- View → Tool Windows → Gradle
- Click "Reload All Gradle Projects" (↻ icon)
That's it! Your .kite.kts files now have full IDE support.
See Troubleshooting if autocomplete doesn't work.
Here's a complete CI/CD workflow for an Android app:
segments {
segment("compile") {
description = "Compile the Android app"
execute {
exec("./gradlew", "compileDebugKotlin")
}
}
segment("lint") {
description = "Run Android lint checks"
dependsOn("compile")
execute {
exec("./gradlew", "lintDebug")
}
}
segment("test") {
description = "Run unit tests"
dependsOn("compile")
execute {
exec("./gradlew", "testDebugUnitTest")
}
}
segment("assemble") {
description = "Build APK"
dependsOn("lint", "test")
execute {
exec("./gradlew", "assembleDebug")
}
}
}ride {
name = "CI"
maxConcurrency = 2
flow {
segment("compile")
// Run lint and tests in parallel
parallel {
segment("lint")
segment("test")
}
segment("assemble")
}
}Easiest approach - Use the Kite action:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run CI
uses: ./.github/actions/run-kite
with:
command: ride CIOr manual setup:
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
- name: Build Kite CLI
run: ./gradlew :kite-cli:installDist
- name: Run CI
run: kite-cli/build/install/kite-cli/bin/kite-cli ride CITip: The action includes caching for much faster subsequent runs!
See CI Integration and GitHub Actions for details.
Define reusable functions:
fun ExecutionContext.gradleTask(vararg tasks: String) {
exec("./gradlew", *tasks)
}
segments {
segment("build") {
execute {
gradleTask("clean", "build")
}
}
}Run segments based on conditions:
segment("deploy") {
condition = { ctx: ExecutionContext ->
ctx.env("BRANCH") == "main"
}
execute {
exec("./deploy.sh", "production")
}
}Run independent segments concurrently:
flow {
segment("compile")
parallel {
segment("unit-tests")
segment("integration-tests")
segment("lint")
}
}See Parallel Execution for more patterns.
Now that you have Kite running, explore these topics:
- Core Concepts - Deep dive into rides, segments, and flows
- Writing Segments - Create powerful, reusable segments
- Writing Rides - Compose complex workflows
- Execution Context - Master the context API
- Artifacts - Share files between segments
- CI Integration - Deploy to GitHub Actions, GitLab CI, etc.
- Documentation: docs/
- Issues: GitHub Issues
- Examples: Check
.kite/in the Kite repository
Welcome to Kite! 🪁 Let's build better CI/CD workflows together.