Global Configuration
Status: 🟢 The file is read and most keys are honored. ⚪ Remote cache keys parse but have no transport yet, and
[lint]/[format]defaults await the linter.
~/.kargo/config.toml holds machine-wide settings: parallelism, cache location,
credentials, toolchain preferences. On Windows, %USERPROFILE%\.kargo\config.toml.
Project settings in Kargo.toml always win. Global config is for what belongs to
the machine, not the project — nothing here should be required for a checkout to
build.
A complete example
[build]
jobs = 8
default-target = "jvm"
compiler-backend = "build-tools"
[repositories]
google = "https://maven.google.com"
internal = "https://nexus.example.com/repository/maven-public"
[credentials.my-nexus]
username = "deploy"
token-cmd = "op read 'op://Dev/Nexus/token'"
[cache]
dir = "~/.kargo/build-cache"
max-size = "10GB"
write = true
remote = "https://cache.example.com/kargo"
remote-auth = "${env:KARGO_CACHE_TOKEN}"
remote-push = false
[toolchain]
kotlin-mirror = "https://mirror.example.com/kotlin/releases"
auto-download = true
jdk = "/usr/lib/jvm/java-25-openjdk"
[lint]
default-rules = ["naming", "style"]
[format]
style = "official"
[build]
| Key | Type | Default | Description |
|---|---|---|---|
jobs | integer | CPU count | ⚪ Parallel compilation jobs. Parsed and exported as KARGO_JOBS; nothing acts on it yet. |
default-target | string | none | Target used when a project declares several and you pass no --target. |
compiler-backend | "cli" | "build-tools" | "build-tools" | How the compiler is invoked. build-tools compiles incrementally; cli spawns kotlinc. |
daemon | bool | true | Reuse a long-lived compiler process between builds. |
jobs has no effect today, and setting it will not change a build. Two
separate reasons, both worth knowing:
- There is one compilation unit per build — every main source set is flattened into it — so there is no second compile for a job limit to schedule. See the unit graph.
- Within that one unit, the only parallelism the Kotlin compiler offers is
-Xbackend-threads, and Kargo does not pass it. Its code-generation workers append to unsynchronised lists in every version Kargo supports, so a build that uses it can fail with an internal compiler exception instead of compiling — rarely, and never twice in the same place. You can still pass it yourself through[profile] compiler-args, with that risk.
jobs does not bound downloads either. Those are capped separately at 8
concurrent requests, which is about being a good citizen towards a repository
rather than about this machine's cores, so the two are deliberately not the same
number.
The default, build-tools, compiles through the Kotlin Build Tools API, so a
one-file change recompiles one file rather than the whole source set. It needs
Kotlin 2.4 or later and a JVM or Android target, and downloads about 60MB of
its own jars once per Kotlin version; a build it cannot serve compiles with
kotlinc instead and never fails for the backend's sake.
compiler-backend = "cli" pins the old behaviour, and
KARGO_COMPILER_BACKEND=cli (or =build-tools) chooses for a single build.
See Incremental Compilation.
[repositories]
A map of name to URL, merged with each project's [repositories]. For
repositories every project on this machine should see — an internal mirror, for
instance.
[repositories]
internal = "https://nexus.example.com/repository/maven-public"
Credentials do not belong here. Use [credentials].
[credentials]
Named credential sets that a project references by name, so a shared manifest never needs to know how your machine stores secrets.
[credentials.my-nexus]
username = "deploy"
password = "literal-but-please-do-not"
[credentials.ci-registry]
username = "ci"
token-cmd = "secret-tool lookup service registry"
| Key | Type | Description |
|---|---|---|
username | string | Basic auth user. |
password | string | Basic auth password or token. |
token-cmd | string | Command whose stdout is the credential. |
# in a project's Kargo.toml
[repositories]
internal = { url = "https://nexus.example.com/maven", auth = "my-nexus" }
Prefer token-cmd. It keeps the secret in your password manager rather than in a
plaintext file, and it works with anything that has a CLI — 1Password, pass,
secret-tool, Vault.
[cache]
| Key | Type | Default | Description |
|---|---|---|---|
dir | string | ~/.kargo/build-cache | Local build cache location, which KARGO_HOME moves along with everything else Kargo keeps globally. |
max-size | string | 10GB | LRU eviction threshold. "500MB", "10GB". A value that is not a size is reported and ignored, leaving the default. |
write | bool | true | Whether a build stores its output here. Reading is unaffected: false still restores from entries that are already there. |
remote | string | none | ⚪ Remote cache base URL. |
remote-auth | string | none | ⚪ Bearer token for the remote cache. |
remote-push | bool | false | ⚪ Whether this machine uploads. |
dir is the build cache — your compiled output. Downloaded Maven artifacts
are a separate cache with a separate lifetime, and it is not configurable here:
it follows KARGO_HOME (see Paths).
Keep remote-push = false on developer machines. A cache any client can write to
lets whoever can push an entry decide what your next build compiles to.
See The Build Cache.
[toolchain]
| Key | Type | Default | Description |
|---|---|---|---|
kotlin-mirror | string | JetBrains releases | Alternative download source. |
auto-download | bool | true | Fetch missing toolchains automatically. |
jdk | string | discovered | A major version, or an absolute path. |
auto-download = false is the air-gapped setting: builds then fail naming the
missing version instead of attempting a download.
See Toolchains.
[lint] and [format]
⚪ Defaults for projects that declare none. Awaiting the linter.
[lint]
default-rules = ["naming", "style"]
[format]
style = "official"
Precedence
For any setting, later wins:
~/.kargo/config.tomlKargo.toml.kargo.env(for${env:…}values)- The process environment
- Command-line flags
So kargo build --offline beats any configured value, and a project that pins
[toolchain] jdk beats your machine's default.
Inspecting
kargo self info # paths, versions, sizes
kargo env # resolved environment, secrets masked
Paths
| Path | Contents |
|---|---|
~/.kargo/config.toml | This file |
~/.kargo/toolchains/ | Kotlin compilers, managed JDKs, Android SDK |
~/.kargo/cache/ | Maven artifacts, in Maven layout |
~/.kargo/build-cache/ | Compiled output, content-addressed |
~ is expanded in dir values.
Next
- Manifest Format — per-project settings
- Secrets and Environment