Kantra is a CLI for Konveyor analysis and transformation.
Analysis Containerless mode — prerequisites and layout are documented in docs/containerless.md
Analysis Hybrid mode (external language providers run in containers; the analyzer runs on the host.) and Transform —
- Podman 4+ or Docker (Engine 24+ / Desktop 4+). Kantra defaults to
podman; override withexport CONTAINER_TOOL=/path/to/docker.
Download the zip for your OS and CPU from GitHub releases:
| Platform | Asset |
|---|---|
| Linux | kantra.linux.amd64.zip, kantra.linux.arm64.zip |
| macOS | kantra.darwin.amd64.zip, kantra.darwin.arm64.zip |
| Windows | kantra.windows.amd64.zip, kantra.windows.arm64.zip |
Each archive contains the CLI plus bundled assets (default rulesets, JDT language server, static report template, and Java/Maven helper files).
- Unzip the archive into the default config directory (or another directory you will keep):
Linux
mkdir -p ~/.kantra
unzip kantra.linux.amd64.zip -d ~/.kantra # or kantra.linux.arm64.zipmacOS
mkdir -p ~/.kantra
unzip kantra.darwin.amd64.zip -d ~/.kantra # or kantra.darwin.arm64.zipWindows (PowerShell)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.kantra"
Expand-Archive -Path kantra.windows.amd64.zip -DestinationPath "$env:USERPROFILE\.kantra"
# or kantra.windows.arm64.zipYou can also use Extract All in File Explorer and choose %USERPROFILE%\.kantra (for example C:\Users\You\.kantra).
- Put the CLI on your
PATH:
| Platform | Binary in the zip | Example |
|---|---|---|
| Linux | kantra |
sudo mv ~/.kantra/kantra /usr/local/bin/ |
| macOS | darwin-kantra |
sudo mv ~/.kantra/darwin-kantra /usr/local/bin/kantra |
| Windows | windows-kantra.exe |
add to PATH as kantra.exe |
- Verify:
kantra version
Kantra resolves bundled assets in this order: KANTRA_DIR (if set) → binary directory (when it contains rulesets/, jdtls/, and static-report/) → the default config directory: $HOME/.kantra on macOS, %USERPROFILE%\.kantra on Windows, and on Linux $XDG_CONFIG_HOME/.kantra when set or otherwise $HOME/.kantra. Containerless analysis requires those assets; hybrid and transform need the CLI and a container runtime (see Prerequisites).
Requires Go 1.25+.
git clone https://github.com/konveyor/kantra.git
cd kantra
go build -o kantra .go build produces only the CLI — not the bundled rulesets, JDT LS, or report assets. Extract a release zip into the default config directory (for example ~/.kantra on macOS/Linux or %USERPROFILE%\.kantra on Windows), or point KANTRA_DIR at that directory. See docs/developer.md for container-based development workflows.
Containerless (default) — Java + builtin on the host:
kantra analyze --input=/path/to/app --output=/path/to/out --overwrite --target cloud-readinessHybrid — language providers in containers, engine on the host (needed for Go, Python, Node.js, C#, or Java in a container):
kantra analyze --input=/path/to/app --output=/path/to/out --run-local=false --overwrite--mode—full(default, source + deps where supported) orsource-only.- Filtering —
--target,--source,--label-selector; list labels withkantra rules list-targets/kantra rules list-sources.
Deeper detail: docs/containerless.md, docs/hybrid.md.
Run OpenRewrite recipes on Java source (runs in a container; requires Podman/Docker):
kantra transform openrewrite --list-targets
kantra transform openrewrite --input=/path/to/app --target=<recipe-name>| Command | Purpose |
|---|---|
kantra config |
Login / sync / list Konveyor Hub profiles (kantra config --help) |
kantra rules |
List rule labels and run YAML rule tests (kantra rules --help) |
kantra discover / kantra generate |
Asset-generation workflows; see docs/examples.md |
Use kantra <command> --help for flags.
| Topic | Doc |
|---|---|
| Examples | docs/examples.md |
| Hybrid / containerless analysis | docs/hybrid.md, docs/containerless.md |
| Rule YAML tests | docs/testrunner.md |
| Writing rules | docs/rules-quickstart.md |
| Usage (modes, providers, rules, output) | docs/usage.md |
| Hack scripts / asset generation | hack/README.md |