{"id":23435,"library":"cmdkit","title":"cmdkit","description":"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.","status":"active","version":"2.7.7","language":"python","source_language":"en","source_url":"https://github.com/glentner/cmdkit","tags":["cli","command-line","toolkit","subcommands","namespace","configuration","logging"],"install":[{"cmd":"pip install cmdkit","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Command is now exposed at top-level; importing from submodule is unnecessary and may break.","wrong":"from cmdkit.cli import Command","symbol":"Command","correct":"from cmdkit import Command"},{"note":"Namespace is a top-level export for managing hierarchical data.","symbol":"Namespace","correct":"from cmdkit import Namespace"}],"quickstart":{"code":"from cmdkit import Command, Namespace\n\nclass MyApp(Command):\n    name = 'myapp'\n    usage = 'myapp [options]'\n    description = 'A sample CLI application'\n\n    interface = Command.build_interface(\n        'MyApp',\n        'A sample CLI app',\n        'v1.0'\n    )\n\n    def __init__(self, name=None):\n        super().__init__(name=name)\n        # Add subcommands, options, etc.\n\nif __name__ == '__main__':\n    MyApp.main()","lang":"python","description":"Creates a minimal CLI application using the Command class."},"warnings":[{"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).","message":"The '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.","severity":"breaking","affected_versions":"<2.7.6"},{"fix":"Pin cmdkit>=2.7.7 to support Python 3.9.","message":"Python 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.","severity":"breaking","affected_versions":"<2.7.7"},{"fix":"Upgrade to cmdkit>=2.7.6 to switch to tomli/tomli-w or use Python's standard library (tomllib).","message":"The 'toml' package used by cmdkit is deprecated and no longer maintained. cmdkit v2.7.6+ removed this dependency.","severity":"deprecated","affected_versions":"<2.7.6"},{"fix":"Always call super().__init__(name=name) in your Command subclass constructor.","message":"When subclassing Command, ensure you call super().__init__(name=name) or you may encounter missing attributes like 'logger'.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade cmdkit to the latest version (pip install --upgrade cmdkit) and use 'from cmdkit import Command'.","cause":"Installed an older version (<2.5?) or incorrect import path. Command was not always top-level.","error":"AttributeError: module 'cmdkit' has no attribute 'Command'"},{"fix":"Ensure your Command subclass has: super().__init__(name=name).","cause":"Forgot to call super().__init__(name=name) in Command subclass.","error":"TypeError: __init__() got an unexpected keyword argument 'name'"},{"fix":"Install tomli and tomli-w (or use Python 3.11+'s tomllib) and adjust your config loading code to use them explicitly.","cause":"After upgrading to cmdkit 2.7.6+, the dependency on 'toml' was removed. Code that relied on automatic TOML loading may break.","error":"ModuleNotFoundError: No module named 'toml'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}