Skip to content

gianluz/kite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

277 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿช Kite

A modern, type-safe CI/CD workflow runner for Kotlin projects.

CI Version Maven Central License Kotlin Docker Java


What is Kite?

Kite helps you define and execute CI/CD workflows using a type-safe Kotlin DSL. Replace bash scripts and YAML configuration with testable, reusable Kotlin code.

Key Features:

  • ๐ŸŽฏ Type-safe DSL - Catch errors at compile time, not runtime
  • โšก Parallel execution - Run segments in parallel for faster builds
  • ๐Ÿ”’ Automatic secret masking - Secrets never leak into logs
  • ๐Ÿ“ฆ Artifact management - Share build outputs between segments
  • ๐ŸŒ Platform-agnostic - Works on any CI/CD platform (no vendor lock-in)
  • ๐Ÿงฉ Reusable components - Define segments once, compose into different workflows

Platform-Agnostic Design:

Kite doesn't assume you're using GitLab, GitHub, or any specific CI platform. Instead of providing opinionated properties like isRelease or mrNumber, you query environment variables directly using env(). This means Kite works on ANY CI/CD platform without modification:

segment("deploy") {
    condition = { ctx ->
        // Your platform, your conventions
        ctx.env("CI_MERGE_REQUEST_LABELS")?.contains("release") == true
    }
}

Quick Example

Define segments (units of work):

// .kite/segments/build.kite.kts
segments {
    segment("build") {
        description = "Build the application"
        execute {
            exec("./gradlew", "assembleRelease")
        }
    }
    
    segment("test") {
        description = "Run tests"
        dependsOn("build")
        execute {
            exec("./gradlew", "test")
        }
    }
}

Compose into rides (workflows):

// .kite/rides/ci.kite.kts
ride {
    name = "CI"
    maxConcurrency = 4
    
    flow {
        segment("build")
        
        parallel {
            segment("test")
            segment("lint")
            segment("detekt")
        }
    }
}

Execute:

# Run a complete workflow
kite-cli ride CI

# Run specific segments
kite-cli run test lint

# List available workflows
kite-cli rides

Use in GitHub Actions:

name: CI
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Run CI Workflow
        uses: ./.github/actions/run-kite
        with:
          command: ride CI

See GitHub Actions documentation for more examples.


Documentation

๐Ÿ“š Complete Documentation

Getting Started

Writing Workflows

Advanced Topics

Integration & Reference


Installation

Kite is published to Maven Central. Add the libraries to your Gradle 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")
}

Published Artifacts

All artifacts are available on Maven Central under the group com.gianluz.kite.

Artifact Coordinates Description Portal
kite-core com.gianluz.kite:kite-core:0.1.0-alpha9 Core domain models and interfaces ๐Ÿ”—
kite-dsl com.gianluz.kite:kite-dsl:0.1.0-alpha9 DSL and Kotlin scripting engine ๐Ÿ”—
kite-runtime com.gianluz.kite:kite-runtime:0.1.0-alpha9 Execution runtime and schedulers ๐Ÿ”—
git plugin com.gianluz.kite:git:0.1.0-alpha9 Type-safe Git operations ๐Ÿ”—
gradle plugin com.gianluz.kite:gradle:0.1.0-alpha9 Flexible Gradle task execution ๐Ÿ”—

Plugins are used via @file:DependsOn in your .kite.kts scripts:

@file:DependsOn("com.gianluz.kite:git:0.1.0-alpha9")
@file:DependsOn("com.gianluz.kite:gradle:0.1.0-alpha9")

Docker (No Installation Required)

Run Kite directly without cloning the repo โ€” just mount your project directory:

# GitHub Container Registry
docker run --rm \
  -v $(pwd):/workspace \
  ghcr.io/gianluz/kite:latest \
  ride CI

# Docker Hub
docker run --rm \
  -v $(pwd):/workspace \
  gianluz/kite:latest \
  ride CI

Pass secrets and environment variables with -e:

docker run --rm \
  -v $(pwd):/workspace \
  -e DEPLOY_TOKEN=$DEPLOY_TOKEN \
  -e CI_COMMIT_TAG=v1.0.0 \
  ghcr.io/gianluz/kite:latest \
  ride Deploy
Registry Image Link
GitHub Container Registry ghcr.io/gianluz/kite ghcr.io/gianluz/kite
Docker Hub gianluz/kite hub.docker.com/r/gianluz/kite

CLI Binary

Install script (macOS / Linux โ€” requires Java 17+):

curl -sSL https://github.com/gianluz/kite/releases/latest/download/install.sh | bash
export PATH="$HOME/.kite/bin:$PATH"
kite-cli ride CI

Download manually from GitHub Releases (.tar for macOS/Linux, .zip for Windows).

Build from source:

git clone https://github.com/gianluz/kite.git && cd kite
./gradlew :kite-cli:installDist
export PATH="$PWD/kite-cli/build/install/kite-cli/bin:$PATH"
kite-cli --version

See Installation Guide for all methods including Docker, Homebrew (coming soon), and CI examples.


Example Workflows

Android Build Pipeline

ride {
    name = "Android CI"
    maxConcurrency = 3
    
    flow {
        segment("clean")
        segment("compile")
        
        parallel {
            segment("unit-tests")
            segment("instrumented-tests")
            segment("lint")
        }
        
        segment("assemble")
    }
}

Multi-Module Project

parallel {
    segment("test-core")
    segment("test-api")
    segment("test-ui")
}

Conditional Deployment

segment("deploy") {
    condition = { ctx: ExecutionContext ->
        ctx.env("BRANCH") == "main"
    }
    execute {
        val token = requireSecret("DEPLOY_TOKEN")
        exec("./deploy.sh", "--prod")
    }
}

Why Kite?

Kite was created to solve the complexity and limitations of existing CI/CD tools like Fastlane and bash scripts.

Before: Fastlane/Fastfile ๐Ÿ˜“

# Fastfile
lane :ci do
  clean
  build
  test    # Sequential only
  lint    # Can't run in parallel
end

lane :test do
  gradle(task: "test")
end

lane :lint do
  gradle(task: "lint")
end

Problems with Fastlane:

  • โŒ Ruby dependency - Requires Ruby environment setup
  • โŒ No type safety - Errors only at runtime
  • โŒ Limited parallelization - Hard to run lanes in parallel
  • โŒ Complex syntax - Learning curve for Ruby/Fastlane DSL
  • โŒ Android/iOS specific - Not ideal for other JVM projects
  • โŒ No IDE support - Limited autocomplete and refactoring
  • โŒ Difficult debugging - Stack traces through Ruby/Fastlane layers

Before: Bash Scripts ๐Ÿ˜ฑ

#!/bin/bash
set -e

./gradlew clean
./gradlew assembleRelease

# Run tests and lint sequentially (slow!)
./gradlew test        # 5 minutes
./gradlew lint        # 2 minutes
# Total: 7 minutes wasted waiting

# Problems:
# - No parallelization
# - No dependency management
# - Secrets leak into logs
# - Hard to maintain
# - Difficult to test
# - No IDE support

After: Kite โœจ

segments {
    segment("clean") { 
        execute { exec("./gradlew", "clean") } 
    }
    
    segment("build") { 
        dependsOn("clean")
        execute { exec("./gradlew", "assembleRelease") } 
    }
    
    segment("test") { 
        dependsOn("build")
        execute { exec("./gradlew", "test") }  // 5 minutes
    }
    
    segment("lint") { 
        dependsOn("build")
        execute { exec("./gradlew", "lint") }  // 2 minutes
    }
}

ride {
    name = "CI"
    maxConcurrency = 4  // Run up to 4 tasks in parallel
    
    flow {
        segment("clean")
        segment("build")
        
        // Test and lint run in parallel!
        parallel {
            segment("test")   // 5 min โŽค
            segment("lint")   // 2 min โŽฆ โ†’ Only 5 min total!
        }
    }
}

Real Benefits vs Fastlane/Bash:

  • โšก Parallel execution - Test and lint run simultaneously (save 2 minutes!)
  • ๐Ÿ”— Dependency management - Build always runs before tests
  • ๐Ÿ”’ Secret masking - requireSecret() automatically masks sensitive data
  • ๐ŸŽฏ Type-safe - Catch errors at compile time, not runtime
  • โœจ Full IDE support - Autocomplete, refactoring, and debugging with Kotlin
  • ๐Ÿงช Testable - Unit test your CI/CD logic (impossible with Fastlane)
  • ๐Ÿ”„ Reusable - Share segments across different workflows
  • ๐Ÿš€ No Ruby needed - Pure Kotlin/JVM, no additional runtime
  • ๐ŸŒ Platform-agnostic - Not limited to Android/iOS like Fastlane
  • ๐Ÿ“ฆ Better for Kotlin projects - Native Kotlin integration

Time savings: Sequential (Fastlane/bash) = 7 min, Kite parallel = 5 min (29% faster)

Comparison:

Fastlane Bash Scripts Kite
Type Safety โŒ Runtime only โŒ None โœ… Compile-time
IDE Support โš ๏ธ Limited โŒ None โœ… Full Kotlin support
Parallel Execution โš ๏ธ Complex โŒ Manual โœ… Built-in
Testing โŒ Hard to test โŒ Hard to test โœ… Unit testable
Dependency Management โš ๏ธ Manual โŒ Manual โœ… Automatic
Secret Masking โš ๏ธ Manual setup โŒ Manual โœ… Automatic
Platform Support โš ๏ธ iOS/Android focus โœ… Any โœ… Any CI/CD
Learning Curve ๐ŸŸก Ruby + Fastlane ๐ŸŸข Low ๐ŸŸข Kotlin only

Contributing

We welcome contributions! Kite is under active development.

Start here: CONTRIBUTING.md - Complete contribution guide

Additional Resources:

Development Setup

# Clone repository
git clone https://github.com/gianluz/kite.git
cd kite

# Build (git hooks install automatically)
./gradlew build

# Run tests
./gradlew test

Project Structure

kite/
โ”œโ”€โ”€ kite-core/          # Core domain models
โ”œโ”€โ”€ kite-dsl/           # DSL and scripting
โ”œโ”€โ”€ kite-runtime/       # Execution engine
โ”œโ”€โ”€ kite-cli/           # Command-line interface
โ”œโ”€โ”€ kite-integration-tests/  # End-to-end tests
โ””โ”€โ”€ docs/               # Documentation

Requirements

  • Java: 17 or higher (LTS)
  • Kotlin: 2.1.20
  • Gradle: 8.0+ (wrapper included)

Roadmap

โœ… Completed

  • Core DSL and execution engine
  • Parallel execution with dependency management
  • Artifact management
  • Automatic secret masking
  • CLI interface
  • CI/CD integration (GitHub Actions, GitLab CI)
  • Timeout and retry mechanisms
  • Platform-agnostic design
  • Maven Central distribution (com.gianluz.kite)
  • Docker image (ghcr.io/gianluz/kite, gianluz/kite)

๐Ÿ”ฎ Planned

  • Swift script support (exploratory) - Write Kite segments in Swift (.kite.swift files)
    • Using Danger-style inline dependency comments
    • Automatic compilation and caching
    • Full Swift Package Manager integration
  • Plugin system for extensibility
  • Remote caching for distributed teams
  • Distributed execution across multiple machines
  • Web dashboard for visualization
  • Additional language support (Python, Go, Rust)

See Development Plan for detailed roadmap.


License

Apache License 2.0 - see LICENSE


Support


Supporters

Special thanks to Luno for supporting the development of Kite! ๐Ÿ™

Luno is a leading cryptocurrency platform that believes in empowering developers with better tools. Their support has been instrumental in making Kite possible.


AI Disclaimer

This project was developed with significant AI assistance. The implementation, architecture, testing, and documentation were created through extensive collaboration using various large language models via Firebender ๐Ÿ”ฅ (an AI-powered development tool with IDE plugins for IntelliJ and Android Studio). While AI played a major role in accelerating development and ensuring comprehensive test coverage, all design decisions, architectural choices, and code quality standards were carefully reviewed and validated.

Note on Quality: Despite thorough testing and review, some inconsistencies between the implementation and documentation may still exist due to the rapid, AI-assisted development process. If you encounter any bugs, inconsistencies, or areas where the documentation doesn't match the actual behavior, please * open an issue* or submit a pull request. Your contributions help improve Kite for everyone!

Shoutout to Firebender for providing an excellent AI-powered development tool! ๐Ÿ”ฅ


Made with โค๏ธ using Kotlin

About

A Kotlin-based CI task runner for GitHub Actions, GitLab CI, and beyond.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors