Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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, and kcl. 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.

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 is optional and turns off with NO_COLOR, --no-color, TERM=dumb, or 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.0b2

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.0b2
File Size Uploaded Provenance
kantrip-0.1.0b2.tar.gz 689.6 kB With provenance Details

Built distribution (wheel)

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

Total release size: 858.2 kB

Release files / kantrip-0.1.0b2.tar.gz

Download URL kantrip-0.1.0b2.tar.gz
Size 689.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2b897c4aa34f8cb00941d4c6f76545db1ac2fad6b502f0aad6182ae21a01fea6
BLAKE2b-256 checksum
How to use checksums
f581d35b5e2679a5c2573dc9032757607e251d26c6971f3568f4192e85648eaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

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

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

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 Oct 1, 2026.

Transparency log

Security for kantrip 0.1.0b2

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kantrip-0.1.0b2.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 Oct 1, 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