Getting Started
This tutorial will get you up and running with Typeflows in under 5 minutes. You’ll install Typeflows and start implementing Configuration-as-Code for your repository.
Prerequisites
An existing project Git repo with a project setup for your build system of choice.
Step 1: Install Typeflows
Add Typeflows to your build system, including the GitHub and LLM modules:
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
plugins {
id("com.typeflows") version "1.0.0"
}
dependencies {
typeflowsApi("com.typeflows:typeflows-github:1.0.0")
typeflowsApi("com.typeflows:typeflows-llm:1.0.0")
}
Step 2: Create Source Folder
Create a Typeflows configuration directory:
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
mkdir -p src/typeflows/kotlin
Step 3: Add Your First Managed Files
Let’s start with an AGENTS.md file and a Dependabot configuration. Create your source files:
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
import io.typeflows.agents.Agents
import io.typeflows.github.DotGitHub
import io.typeflows.github.TypeflowsGitHubRepo
import io.typeflows.github.dependabot.DepdendabotSchedule
import io.typeflows.github.dependabot.Dependabot
import io.typeflows.github.dependabot.PackageEcosystem
import io.typeflows.github.dependabot.PackageEcosystem.Gradle
import io.typeflows.github.dependabot.PackageEcosystem.Maven
import io.typeflows.github.dependabot.ScheduleInterval.Weekly
import io.typeflows.github.dependabot.Update
import io.typeflows.util.Builder
import java.time.DayOfWeek.FRIDAY
import java.time.LocalTime
class Typeflows : Builder<TypeflowsGitHubRepo> {
override fun build() = TypeflowsGitHubRepo {
dotGithub = DotGitHub {
dependabot = Dependabot {
version = 2
updates += Update(Gradle) {
directory = "/"
schedule = DepdendabotSchedule(Weekly) {
day = FRIDAY
time = LocalTime.of(12, 0)
}
}
}
}
files += Agents.of(
"""
# AI Agents
Instructions for AI agents working with this repository
"""
)
}
}
Step 4: Run Typeflows Export
Running the export task will export all of the configuration files defined in your Typeflows class:
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
./gradlew typeflowsExport
Step 5: Verify Output
Typeflows will create the necessary directories and files in your .github/ folder. Check that your ‘AGENTS.md’ and .github/dependabot.yml files have been created:
Better Experience in Landscape Mode
The code examples look much better when viewed horizontally. Please rotate your device for the best experience!
Or view on a larger screen to see the code!
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: weekly
day: friday
time: "12:00"
Conclusion
Your AGENTS.md and Dependabot configuration are now managed by Typeflows, giving you:
- Type safety - No more YAML syntax errors
- IDE support - Autocomplete and validation
- Dynamic construction - Use loops, conditionals, and functions to build complex configurations
- Composability - Content (Markdown, YAML etc) can be composed from independently controlled parts
- Reusability - Share configurations across projects
Your Typeflows class is now the single source of truth for your GitHub configuration. Any changes you make here will be reflected in your repository folder when you run the export process.
But this is just the beginning, as Typeflows can manage your entire repository setup, including workflows, version files and more!