The Manifest
Status: 🟢 Implemented — the entire
Kargo.tomlschema parses and validates today, including sections that later phases will act on. The Manifest Format reference marks which sections affect a build right now.
Kargo.toml is the only file you configure. This page is the guided tour; the
reference has every key.
The smallest valid manifest
[package]
name = "my-app"
version = "0.1.0"
kotlin = "2.4.21"
[targets.jvm]
Four lines: an identity, a compiler version, and something to compile for. Every other section is optional.
A realistic one
[package]
name = "my-service"
group = "com.example"
version = "1.2.0"
kotlin = "2.4.21"
description = "Order processing service"
authors = ["Jane Doe <jane@example.com>"]
license = "Apache-2.0"
repository = "https://github.com/example/my-service"
main-class = "com.example.MainKt"
[targets.jvm]
java-target = "25"
[dependencies]
ktor-server-core = "io.ktor:ktor-server-core:2.3.0"
kotlinx-coroutines-core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0"
[dev-dependencies]
kotlin-test = "org.jetbrains.kotlin:kotlin-test:2.4.21"
[plugins]
serialization = "org.jetbrains.kotlin.plugin.serialization"
[profile.release]
optimization = true
[lint]
rules = ["naming", "style", "complexity"]
Read top to bottom, that is: who I am, what I compile to, what I need, what I need to test, which compiler plugins to apply, how release differs from dev, and how strict to be about style.
Sections at a glance
| Section | Purpose | Guide |
|---|---|---|
[package] | Identity, version, metadata, entry point | below |
[targets] | What to compile for | Targets |
[dependencies], [dev-dependencies] | What you depend on | Dependencies |
[target.<name>.dependencies] | Per-target dependencies | Multiplatform |
[flavor.<name>.dependencies] | Per-flavor dependencies | Flavors |
[compose] | Enable Compose Multiplatform | Compose |
[plugins] | Kotlin compiler plugins | below |
[ksp], [kapt] | Annotation processors | below |
[build-config] | Compile-time constants | below |
[flavors] | Build flavor dimensions | Flavors |
[profile.*] | Debug and optimization settings | Profiles |
[repositories] | Where to fetch artifacts | Dependencies |
[workspace] | Multi-module projects | Workspaces |
[catalog] | Shared version definitions | Version Catalogs |
[toolchain] | JDK and Kotlin overrides | Toolchains |
[test] | Coverage thresholds | Testing |
[lint], [format] | Code quality rules | Lint and Format |
[hooks] | Commands at lifecycle points | Plugins and Hooks |
[signing] | Publishing signatures | Publishing |
[package.docker] | Container image settings | Packaging |
[package]
| Field | Required | Notes |
|---|---|---|
name | Yes | Alphanumeric, -, _. Validated on load. |
version | Yes | Must parse as semver. |
kotlin | Yes | Exact compiler version; downloaded if absent. |
group | For publishing | Maven group id, e.g. com.example. |
main-class | For kargo run | JVM entry point, e.g. com.example.MainKt. |
description, authors, license, repository | No | Metadata, carried into published POMs. |
ksp-version | No | Pins the KSP processor API version. |
name and version are validated when the manifest loads, not when you build, so
a typo fails immediately with a pointed error rather than halfway through a
compile.
A top-level fun main() in Foo.kt with package com.example compiles to
com.example.FooKt — that is the string main-class wants.
[targets]
One target, as a subtable:
[targets.jvm]
java-target = "25"
Several, as an inline table each:
[targets]
jvm = { java-target = "25" }
android = { min-sdk = 24, target-sdk = 36, compile-sdk = 36 }
ios-arm64 = {}
ios-simulator-arm64 = {}
js = { module-kind = "es" }
{} means "this target, default settings". Target names accept kebab-case or
camelCase — ios-arm64 and iosArm64 are the same target. The full list is in
the Targets reference.
Dependencies in three forms
[dependencies]
# 1. Coordinate shorthand — what you will use 95% of the time
kotlinx-coroutines-core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0"
# 2. Detailed, when you need scope, exclusions, or a classifier
my-lib = { group = "com.example", artifact = "my-lib", version = "1.0.0", scope = "runtime" }
# 3. From a version catalog
ktor-server = { catalog = "ktor-server", bundle = true }
The key on the left is a local alias. It is what kargo remove takes and what
appears in kargo tree output; it has no effect on resolution. See
Dependencies.
[plugins]
Kotlin compiler plugins, by id:
[plugins]
serialization = "org.jetbrains.kotlin.plugin.serialization"
parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version = "2.4.21" }
Omit the version and the plugin tracks package.kotlin, which is almost always
what you want — a compiler plugin built against a different compiler than the one
compiling your code is a reliable source of confusing failures.
Compose is not listed here. It has its own section because Kargo manages the plugin for you.
Annotation processing
KSP processors, and KAPT for libraries that have not migrated:
[ksp]
room-compiler = "androidx.room:room-compiler:2.6.1"
[ksp-options]
"room.schemaLocation" = "build/schemas"
[kapt]
dagger-compiler = "com.google.dagger:dagger-compiler:2.59.2"
[kapt-options]
"dagger.fastInit" = "enabled"
Processors run before the main compile, and generated sources are fed back into it. Both tools can run in the same build; each runs only the processors its own section declares.
Prefer KSP. It is faster, it processes only what changed, and it does not need
the Java stub-generation pass that KAPT runs over every source in the target.
KAPT is here for processors that have not migrated — see
[kapt] for what that pass does and what it
does not do.
[build-config]
Compile-time constants, available to your Kotlin code as a generated
BuildConfig object:
[build-config]
API_VERSION = "v2"
TELEMETRY_ENABLED = "false"
if (BuildConfig.TELEMETRY_ENABLED.toBoolean()) { … }
Values support ${env:VAR} interpolation. Flavors can add to and
override these per variant.
This is for configuration you want baked into the binary. Build-time secrets
belong in .kargo.env instead — anything in [build-config] is
committed and shipped.
Environment interpolation
Any string value can reference an environment variable or a
.kargo.env entry:
[repositories]
internal = { url = "https://nexus.example.com/maven", username = "${env:NEXUS_USER}", password = "${env:NEXUS_PASS}" }
Interpolation happens when the manifest loads, before parsing. So you can interpolate anything — a version, a URL, a path — not just credentials.
Design notes
TOML, not a DSL. A manifest is data. It can be read by tools, diffed usefully,
and edited by kargo add without reformatting the file, because kargo add
rewrites the TOML tree rather than the text.
Deterministic ordering. Every map in the manifest is stored sorted, so serialized output and lockfiles are byte-stable across runs and machines.
Parse everything, act on what exists. Sections for unbuilt features still parse and validate. You can write a complete, forward-looking manifest today; Kargo warns rather than failing on sections it cannot act on yet. Check Implementation Status for which is which.
Next
- Dependencies — add, remove, update, lock
- Building and Running — what
kargo builddoes with all this - Manifest Format — every key, exhaustively