{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/5"}],"enrichment":{"capability":"Handles proper exit procedures for CLI applications: prints traceback information, derives correct exit codes from exceptions, and flushes output streams in the right order.","skillfed_tags":["cli-utilities","exception-handling"],"use_cases":["Ensure a click-based CLI application exits with the correct code when an exception occurs, including Windows-specific winerror codes.","Print exception messages and optional tracebacks to stderr in a controlled way before exiting a CLI tool.","Flush stdout and stderr streams in the right order to prevent buffered output from appearing after the program has already exited.","Integrate signal handlers (SIGINT, SIGTERM) into a CLI application to raise custom exceptions for clean shutdown.","Display subprocess errors (from CalledProcessError) with their captured stdout and stderr alongside the exception message."],"what_it_does":"cli_exit_tools is a small utility library that standardizes how Python CLI applications shut down cleanly. It provides three main functions: extracting the correct system exit code from an exception (including Windows winerror codes), printing exception messages with optional traceback to stderr, and flushing output streams to ensure output appears in the correct order before exit.\n\nThe package is designed to integrate into the exception handler of a click-based CLI application or any other command-line tool. It handles platform differences (Windows, Linux, macOS) transparently and works with exceptions that carry subprocess stdout/stderr attributes. The library has no external dependencies beyond click and lib-detect-testenv, making it lightweight to add to existing projects.","worth_installing":"Yes. The package is lightweight, actively maintained, has no known vulnerabilities, and solves a real problem in CLI development\u2014proper exception handling and stream flushing are easy to get wrong and this library handles the platform-specific details. Install it if you're building a CLI tool with click or similar frameworks and want reliable, correct exit behavior."},"id":"cli-exit-tools","links":{"html":"https://skillfed.io/packages/cli-exit-tools","md":"https://skillfed.io/packages/cli-exit-tools.md","pypi":"https://pypi.org/project/cli-exit-tools/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2024-10-02","license_spdx":null,"license_treatment":"permissive","name":"cli-exit-tools","python_support":"supports_current","summary":"functions to exit an cli application properly"},"popularity":{"monthly_downloads":2536130,"position":3015,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.2.7"}
