kcp

command module
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

KCP CLI

A command-line tool for planning and executing Kafka migrations to Confluent Cloud.

Scan existing Kafka deployments, generate migration plans and cost reports, create infrastructure-as-code assets, and execute end-to-end migrations with real-time monitoring.

Supports Amazon MSK and Apache Kafka (including Confluent Platform and other Kafka-API-compatible distributions) as migration sources.

Full documentation · Latest release

Installation

[!CAUTION] Do not build from source for normal use. Install a released binary using the methods below instead. Source builds can contain breaking, untested changes.

kcp ships pre-built binaries with every GitHub release: macOS and Linux (amd64/arm64), and Windows (amd64). Each release includes these assets: kcp_darwin_amd64, kcp_darwin_arm64, kcp_linux_amd64, kcp_linux_arm64, and kcp_windows_amd64.exe.

macOS & Linux

Recommended — install script. Detects your OS and architecture, downloads the latest stable release, verifies its checksum, and installs it onto your PATH:

curl -fsSL https://raw.githubusercontent.com/confluentinc/kcp/main/install.sh | sh

To pin a specific version or change the install directory:

# Install a specific release
curl -fsSL https://raw.githubusercontent.com/confluentinc/kcp/main/install.sh | KCP_VERSION=v0.8.5 sh

# Install somewhere other than /usr/local/bin
curl -fsSL https://raw.githubusercontent.com/confluentinc/kcp/main/install.sh | KCP_INSTALL_DIR="$HOME/.local/bin" sh

Manual download. Prefer to do it by hand? Run uname -m if unsure of your architecture (arm64/aarch64 → arm64; x86_64 → amd64):

# Apple Silicon: darwin_arm64. Intel Mac: darwin_amd64. Linux: linux_amd64 or linux_arm64.
PLATFORM=darwin_arm64
LATEST_TAG=$(curl -s https://api.github.com/repos/confluentinc/kcp/releases/latest \
  | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')

curl -L -o kcp "https://github.com/confluentinc/kcp/releases/download/${LATEST_TAG}/kcp_${PLATFORM}"
chmod +x kcp
./kcp version

# Optional: put kcp on your PATH so you can run it from any directory
sudo mv kcp /usr/local/bin/kcp
kcp version
Run with Docker

Prefer a container? kcp is published as a multi-arch image:

docker pull confluentinc/kcp:latest
docker run --rm -v "$PWD:/work" -w /work --user "$(id -u):$(id -g)" confluentinc/kcp:latest version

See Running kcp in Docker for AWS credentials, state-file mounts, the web UI, and mirroring into an internal registry (e.g. JFrog Artifactory).

Windows
  1. Download kcp_windows_amd64.exe from the latest release.
  2. Rename it to kcp.exe.
  3. Create a folder to keep it in, for example C:\Program Files\kcp, and move kcp.exe there.
  4. Add that folder to your PATH so you can run kcp from any terminal: open the Start menu, search for "Edit environment variables for your account", select Path, click Edit → New, paste the folder path, then OK.
  5. Open a new PowerShell window (so it picks up the updated PATH) and verify:
kcp version

Upgrading

kcp can update itself in place:

kcp update              # check for and install the latest release
kcp update --check-only # report the latest version without installing
sudo kcp update         # for system-wide installs (e.g. /usr/local/bin)

Contributing

This repository is public and open to community contributions. To build from source, run the tests, or submit a pull request, see CONTRIBUTING.md.

Resources and Support


FOSSA License FOSSA Security

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
gen-docs command
Command gen-docs regenerates the per-command markdown reference under docs/assets/command-reference/ from the Cobra command tree.
Command gen-docs regenerates the per-command markdown reference under docs/assets/command-reference/ from the Cobra command tree.
iac
lambda-scanner command
Command lambda-scanner is a one-shot AWS Lambda (custom runtime, provided.al2023) that runs kcp scan steps from inside the cluster's VPC, so private MSK clusters can be scanned, and returns the resulting kcp-state.json in the invoke response.
Command lambda-scanner is a one-shot AWS Lambda (custom runtime, provided.al2023) that runs kcp scan steps from inside the cluster's VPC, so private MSK clusters can be scanned, and returns the resulting kcp-state.json in the invoke response.
ui
integration-tests
route-conversion
Package routeconversion is the live e2e suite for a dynamic-to-static route conversion (spec.dynamicToStaticConversion) against a real Confluent Gateway, cluster link and clients (Minikube profile kcp-e2e-route-conversion).
Package routeconversion is the live e2e suite for a dynamic-to-static route conversion (spec.dynamicToStaticConversion) against a real Confluent Gateway, cluster link and clients (Minikube profile kcp-e2e-route-conversion).
internal
build_info
Package build_info exposes ldflag-injected build metadata (Version, Commit, Date) and small derived helpers (IsDev, DocsURL) that depend on it.
Package build_info exposes ldflag-injected build metadata (Version, Commit, Date) and small derived helpers (IsDev, DocsURL) that depend on it.
logging
Package logging provides a file-only slog sink for components that own rich, pre-formatted terminal output (e.g.
Package logging provides a file-only slog sink for components that own rich, pre-formatted terminal output (e.g.
manifest
Package manifest defines the migration manifest (migration.yaml) schema and a strict parser.
Package manifest defines the migration manifest (migration.yaml) schema and a strict parser.
manifest/schemagen
Package schemagen generates the migration.yaml and gateway-migration.yaml JSON Schemas from the manifest Go structs.
Package schemagen generates the migration.yaml and gateway-migration.yaml JSON Schemas from the manifest Go structs.
manifest/schemagen/gen command
Command gen writes the committed JSON Schemas.
Command gen writes the committed JSON Schemas.
migrate
Package migrate wires the manifest, source, target, and reconcile engine together for `kcp migration resources create`.
Package migrate wires the manifest, source, target, and reconcile engine together for `kcp migration resources create`.
migrate/acls
Package acls implements the source-read stage of the native-ACL migration plane: flattening sarama's ACL listing into the canonical types.Acls tuple and reading the MSK "allow.everyone.if.no.acl.found" server property.
Package acls implements the source-read stage of the native-ACL migration plane: flattening sarama's ACL listing into the canonical types.Acls tuple and reading the MSK "allow.everyone.if.no.acl.found" server property.
migrate/clusterlink
Package clusterlink implements the cluster-link Reconciler: it reconciles the desired link (derived from the live source + manifest) against the actual link on the target, additively (§8.2, §8.6).
Package clusterlink implements the cluster-link Reconciler: it reconciles the desired link (derived from the live source + manifest) against the actual link on the target, additively (§8.2, §8.6).
migrate/mirrortopics
Package mirrortopics reconciles spec.topics (mode: mirror): it creates a mirror topic on the cluster link for each selected source topic that is not already mirrored.
Package mirrortopics reconciles spec.topics (mode: mirror): it creates a mirror topic on the cluster link for each selected source topic that is not already mirrored.
migrate/newtopics
Package newtopics reconciles spec.topics (mode: new): it creates a plain topic on the target for each selected source topic, reproducing partition count, RF, and all explicitly-set (non-default) configs.
Package newtopics reconciles spec.topics (mode: new): it creates a plain topic on the target for each selected source topic, reproducing partition count, RF, and all explicitly-set (non-default) configs.
migrate/serviceaccounts
Package serviceaccounts derives Confluent Cloud service-account display names from source Kafka principals.
Package serviceaccounts derives Confluent Cloud service-account display names from source Kafka principals.
migrate/topicselect
Package topicselect resolves a desired topic set from a live source topic list using glob include/exclude patterns.
Package topicselect resolves a desired topic set from a live source topic list using glob include/exclude patterns.
noemoji
Package noemoji holds a repository guard test that fails if any Go source contains an emoji (see CLAUDE.md "No emojis").
Package noemoji holds a repository guard test that fails if any Go source contains an emoji (see CLAUDE.md "No emojis").
redact
Package redact removes sensitive values from connector configurations before they are persisted to the state file or written to logs.
Package redact removes sensitive values from connector configurations before they are persisted to the state file or written to logs.
regexanchor
Package regexanchor compiles a user-supplied regular expression to an anchored full-match, safely.
Package regexanchor compiles a user-supplied regular expression to an anchored full-match, safely.
retry
Package retry calls an operation again when it fails on a connection-level error, waiting longer each time, until it succeeds, fails some other way, runs out of budget, or its context ends.
Package retry calls an operation again when it fails on a connection-level error, waiting longer each time, until it succeeds, fails some other way, runs out of budget, or its context ends.
retry/retrytest
Package retrytest shortens the retry schedule for one test, so a test that drives a retry does not wait the production backoff.
Package retrytest shortens the retry schedule for one test, so a test that drives a retry does not wait the production backoff.
services/groupoffsets
Package groupoffsets reads consumer groups' committed offsets from a source cluster, detects commits that land after a fence, validates the offsets against a destination cluster's high-water marks, and writes them to the destination.
Package groupoffsets reads consumer groups' committed offsets from a source cluster, detects commits that land after a fence, validates the offsets against a destination cluster's high-water marks, and writes them to the destination.
services/hcl/confluent
Package confluent: topic.go generates Terraform for plain Confluent Cloud topics (used by `kcp iac topics generate --mode new`).
Package confluent: topic.go generates Terraform for plain Confluent Cloud topics (used by `kcp iac topics generate --mode new`).
services/iampolicy
Package iampolicy renders AWS IAM policy documentation for commands that have multiple variants (e.g.
Package iampolicy renders AWS IAM policy documentation for commands that have multiple variants (e.g.
services/migplan
Package providers holds the live implementations of the migplan provider interfaces, wrapping existing KCP clients and, for the prototype, static files.
Package providers holds the live implementations of the migplan provider interfaces, wrapping existing KCP clients and, for the prototype, static files.
services/migplan/reconcile
Package reconcile is the pure reconciliation core for topic-based migrations.
Package reconcile is the pure reconciliation core for topic-based migrations.
services/migration/d2s
Package d2s implements the FSM-driven orchestrator for a dynamic-to-static route conversion (spec.dynamicToStaticConversion): fence the dynamic route, re-check the conversion on post-fence data, copy the in-scope consumer groups' committed offsets to the destination, and switch the route to static.
Package d2s implements the FSM-driven orchestrator for a dynamic-to-static route conversion (spec.dynamicToStaticConversion): fence the dynamic route, re-check the conversion on post-fence data, copy the in-scope consumer groups' committed offsets to the destination, and switch the route to static.
services/migration/killpoint
Package killpoint holds the migration FSMs' three test-only seams.
Package killpoint holds the migration FSMs' three test-only seams.
services/migration/tbm
Package tbm implements the FSM-driven orchestrator for the Topic-Batch Migration (TBM) workflow.
Package tbm implements the FSM-driven orchestrator for the Topic-Batch Migration (TBM) workflow.
services/plan/engine
Package engine is the decision core behind `kcp report plan`: it turns a source cluster's migration-relevant facts into the target recommendations (size band, cluster type, networking, auth, switchover, and the human-assist handoffs).
Package engine is the decision core behind `kcp report plan`: it turns a source cluster's migration-relevant facts into the target recommendations (size band, cluster type, networking, auth, switchover, and the human-assist handoffs).
services/reconcile
Package reconcile implements the generic desired-state reconcile loop (feasibility §8.4): for each Reconciler, check preconditions, compute the plan (desired vs actual), and either preview it (dry-run) or apply it additively.
Package reconcile implements the generic desired-state reconcile loop (feasibility §8.4): for each Reconciler, check preconditions, compute the plan (desired vs actual), and either preview it (dry-run) or apply it additively.
targets
Package targets is the Target abstraction (feasibility §7.4): Confluent Cloud and Confluent Platform implementations behind a common set of operations.
Package targets is the Target abstraction (feasibility §7.4): Confluent Cloud and Confluent Platform implementations behind a common set of operations.
testsupport
Package testsupport holds small helpers shared by test files across packages.
Package testsupport holds small helpers shared by test files across packages.
tracing
Package tracing sets up OpenTelemetry tracing for kcp: where spans go, the root span of each command, and the helpers instrumented code uses to open, close and annotate spans.
Package tracing sets up OpenTelemetry tracing for kcp: where spans go, the root span of each command, and the helpers instrumented code uses to open, close and annotate spans.
tracing/tracingtest
Package tracingtest installs an in-memory span recorder as the global tracer provider for one test, and helps assert on what was recorded.
Package tracingtest installs an in-memory span recorder as the global tracer provider for one test, and helps assert on what was recorded.
yamlsafe
Package yamlsafe holds the one YAML-error rule every secret-bearing decode in kcp must apply.
Package yamlsafe holds the one YAML-error rule every secret-bearing decode in kcp must apply.
pkg
lib
Package lib is the stable bytes-in / bytes-out façade over kcp's state-processing and plan-generation pipelines.
Package lib is the stable bytes-in / bytes-out façade over kcp's state-processing and plan-generation pipelines.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL