Skip to content

kurkik kafka sync: apply an AsyncAPI document to Apache Kafka

sync is the one command that changes your cluster. It shows a plan and asks first. Before the first change it saves a snapshot and a rollback file.

  • Start with --dry-run.
  • A plan that deletes or recreates something asks you to type the connection’s name.
  • Without extra flags, sync only adds what is missing.
  • It never copies messages or consumer positions.
Terminal window
kurkik kafka sync history prod
Terminal window
kurkik kafka sync revert <snapshot> prod

revert takes --dry-run, --yes, --force, --expect-plan, --snapshot-dir and --output. A revert cannot bring back lost messages or consumer positions.

Terminal window
kurkik kafka sync orders.yaml prod --dry-run
kurkik kafka sync orders.yaml prod
Flag What it does
--accept-groups Agree up front to how group sync works: a group is created by writing its settings, and no positions are copied.
--acls Include ACLs: who may do what.
--all Sync every area: --configs --acls --groups --schemas.
--allow-host HOST Allow fetching remote $refs from this host. Nothing is fetched otherwise. You can repeat it.
--configs Sync configuration: topic settings or policies, and broker settings that can change at runtime.
--delete Delete the topics the document does not describe, within what it owns.
--delete-topic TOPIC Delete only this one of them. You can repeat it.
--dry-run Show the plan and change nothing. Kafka also checks the requests on the broker.
--exclude GLOB Skip topics that match. It wins over --include. You can repeat it.
--expect-plan DIGEST Apply only if the plan still has this digest, as shown by --dry-run.
--force With --overwrite: recreate a topic when partitions must go down or replication differs (its messages are lost). With --delete or --revoke: also take what somebody still uses.
--groups, --consumers Include consumer groups. --consumers is the same flag. It takes more requests.
--include GLOB Only topics whose name matches this pattern. You can repeat it.
--include-internal Also show the system’s own topics, such as __consumer_offsets or Pulsar’s system topics.
--max-channels N Read at most this many topics.
-o, --output FORMAT Output format: text or json.
--overwrite Allow changing topics that already exist: settings, and raising partitions. Without it they are listed and left alone.
--prefix PREFIX Only topics that start with this. An export writes it into the document as the part of the cluster it owns. You can repeat it.
--replace-schemas With --overwrite: replace a schema of another type or with another history. Nothing is converted.
--revoke Revoke access that the cluster grants and the document does not declare.
--schemas Upload the schema versions the target is missing. Never deletes a version on its own.
--snapshot-dir DIR Where to keep snapshots and rollback files.
--timeout DURATION Give up after this long, for example 60s or 2m.
-y, --yes Apply without asking. Needed when nobody can answer, as in CI.
Code Means
0 The cluster matches the document.
1 Something failed.
2 It still differs: you declined, only looked, or something was left alone.
3 Applied, but not confirmed.

All codes: exit codes.

Real output, one question per page: Apache Kafka sync examples.

Flag What it does
--config FILE Use this connections file instead of $KURKIK_CONFIG or ~/.config/kurkik/connections.yaml.
-h, --help Show help.
--no-color No colours. NO_COLOR=1 does the same.
--no-project Ignore the project connections file.
--project-dir DIR Look for the project’s .kurkik/connections.yaml from this folder up.
--trust-project Use the project file without asking. Meant for CI. Same as KURKIK_TRUST_PROJECT=1.
-v, --verbose Say what Kurkik finds while it reads (on stderr).
-V, --version Show the version.