Registry / devops / cmdkit

cmdkit

JSON →
library2.7.7pypypi✓ verified 81d ago

A command-line utility toolkit for Python, providing classes and functions for building CLI applications with subcommands, namespaces, configuration, logging, and auto-colorized help text. Current version is 2.7.7, supporting Python 3.9+. It follows a moderate release cadence with bugfixes and minor features.

pip install cmdkit
INSTALL
IMPORT
SIG · CMDKIT
C
cmdkit
devopspythonv2.7.7
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.7.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Application
from cmdkit import Application
from cmdkit import Command
cli
from cmdkit import cli
Interface
from cmdkit import Interface

Creates a minimal CLI application using the Command class.

from cmdkit import Command, Namespace class MyApp(Command): name = 'myapp' usage = 'myapp [options]' description = 'A sample CLI application' interface = Command.build_interface( 'MyApp', 'A sample CLI app', 'v1.0' ) def __init__(self, name=None): super().__init__(name=name) # Add subcommands, options, etc. if __name__ == '__main__': MyApp.main()
Debug
Known issues
breakingThe 'toml' dependency was removed in v2.7.6. If you rely on automatic TOML config parsing, you must now use tomli/tomli-w or Python 3.11+'s tomllib. Code using cmdkit's Configuration with TOML will break unless you adapt.
fix
Upgrade to cmdkit>=2.7.6 and ensure your Python version is 3.9+ (tomllib available on 3.11+; for older Python, install tomli and tomli-w).
affects: <2.7.6
breakingPython 3.10+ requirement was relaxed in v2.7.7 to 3.9+. If you are on Python 3.9, upgrade to v2.7.7. If you pin to an older version, you may get installation failures on Python 3.9.
fix
Pin cmdkit>=2.7.7 to support Python 3.9.
affects: <2.7.7
deprecatedThe 'toml' package used by cmdkit is deprecated and no longer maintained. cmdkit v2.7.6+ removed this dependency.
fix
Upgrade to cmdkit>=2.7.6 to switch to tomli/tomli-w or use Python's standard library (tomllib).
affects: <2.7.6
gotchaWhen subclassing Command, ensure you call super().__init__(name=name) or you may encounter missing attributes like 'logger'.
fix
Always call super().__init__(name=name) in your Command subclass constructor.
affects: all
Upgrade
Version history
2.7.7latest on PyPI · released Dec 28, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Resources
cmdkit — pip install cmdkit · libregistry