Skip to main content

Kantrip

CI status MIT License Sponsor on GitHub
PyPI version
Linux support macOS support

Kantrip stores your Kafka connection profiles and hands the right one to the client you're about to run. You describe a cluster once (brokers, TLS, credentials, and optionally a Schema Registry), then run your usual tools through it:

kantrip exec prod -- kcat -L
kantrip exec prod -- kafka-topics --list

For each run, Kantrip writes that client's own config format to a private temporary directory, starts the client, and deletes the files when it exits. Passwords, private keys, and client secrets live in a separate vault in your OS credential store: a dedicated keychain on macOS, or a dedicated GNOME Keyring or KDE Wallet collection on Linux. They never go into the profile or onto the command line.

Supported clients are kcat, the Apache Kafka and Confluent CLIs (including the Schema Registry console producers and consumers), Kaskade, kaf, kcl, and kafui. Other programs you start with kantrip exec can read the connection from KAFKA_* variables and generated config files. Connections can be plaintext or verified TLS, with SASL/PLAIN, SCRAM, mTLS, or OAuth where the client supports it. Authentication always requires verified TLS. Compatibility lists what works with each client.

There is no global "current profile". You name the profile on every command, or open a subshell for it, so switching profiles in one terminal never changes what another terminal connects to.

Screenshots

Add List
kantrip add creating three profiles kantrip list showing the profiles
Describe Commands
kantrip describe showing a profile's Kafka and Registry settings kantrip --help listing the commands

What it does

  • Profiles. add, edit, remove, list, and describe, with JSON and YAML output for scripts. A profile can have several bootstrap servers, a description, labels to filter by, and one Schema Registry (Confluent or Apicurio) with its own TLS and credentials.
  • Secrets. Kantrip asks for passwords and client secrets at a prompt that doesn't echo, and reads private keys from files. describe only says which secrets are configured and never opens the vault.
  • Custom CAs. A private CA bundle is validated and copied into the profile, so the original file can move or disappear later.
  • Client checks. Arguments that would change the connection, such as -b or --bootstrap-server, are rejected. Kantrip checks each client's version before starting it and names the release to install when it's too old.
  • Subshells. kantrip exec prod opens Bash, Zsh, or Fish with the supported clients already set up for that profile. Your startup files and history still load, and nothing is left behind after exit.
  • Supervision. Kantrip forwards Ctrl-C and other signals to the client and exits with the client's exit code. Session files left by a crash are cleaned up on a later run.
  • Checks. kantrip ping connects and authenticates to Kafka and the Registry without touching topics, groups, or schemas. kantrip doctor checks the profile database, the vault, stored credentials, certificate expiry, sessions, and installed clients without changing anything; kantrip doctor --repair fixes what it safely can.
  • Failure handling. Credential changes are journaled, so a failure halfway through leaves the previous profile working. Database migrations run automatically and back up the database first.
  • Output. Results go to stdout and messages to stderr. Color follows --color auto|always|never, NO_COLOR, FORCE_COLOR, and TERM=dumb, and turns off when output isn't a terminal.

Quick start

Install with pipx:

pipx install kantrip

Add a profile, check it, and run some clients with it:

kantrip add local
kantrip doctor
kantrip list
kantrip describe local
kantrip ping local
kantrip exec local -- kcat -L
kantrip exec local -- kafka-topics --list
kantrip exec local -- kaskade admin

Leave out the command to get a subshell for the profile:

kantrip exec local
kantrip current
kcat -L
kafka-topics --list
exit

Documentation

Questions

Ask in GitHub Discussions.

Security

Please report vulnerabilities privately, as described in the security policy.

Donations

If Kantrip saves you time, you can sponsor it on GitHub.

AI Assistance

Kantrip is developed with AI assistance. Every AI-assisted change is reviewed and tested before it's merged.

Acknowledgements

Sponsored by LittleHorse Built with Rich

Metadata

Release files for kantrip 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kantrip 0.1.0
File Size Uploaded Provenance Actions
kantrip-0.1.0.tar.gz 715.2 kB With provenance Details for kantrip-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kantrip 0.1.0
File Interpreter ABI Platform Actions
kantrip-0.1.0-py3-none-any.whl Python 3 none any Details for kantrip-0.1.0-py3-none-any.whl

Total release size: 887.9 kB

Release files / kantrip-0.1.0.tar.gz

Download URL kantrip-0.1.0.tar.gz
Size 715.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9c82e98f9ae58f93e8277c73a835ff2bf2d4e841d2fb48cd10131b04c9cf9bf4
BLAKE2b-256 checksum
How to use checksums
c97332e81484b24b93601c6f17762012ad1b6cbf637ceaa88a36a5052f6da795
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / kantrip-0.1.0-py3-none-any.whl

Download URL kantrip-0.1.0-py3-none-any.whl
Size 172.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5f3ce3d08de1dee8ef552f0766c1d19f75c53aa820e48d8e4b4ecac541880f3
BLAKE2b-256 checksum
How to use checksums
ee926a87fad6e7b4d48e32b7943aa2fb0ba87a5244870785f3c16f7f7806e66e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for kantrip 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kantrip-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page