{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/15"}],"enrichment":{"capability":"Provides portable signal handling, exception-to-exit-code mapping, and clean error printing for Click CLI applications across platforms.","skillfed_tags":["cli-tools","signal-handling","exit-codes"],"use_cases":["Wrap a Click command to ensure it returns exit code 130 on Ctrl+C and 141 on broken pipe, matching shell conventions.","Build a multi-command CLI that toggles full Rich-formatted tracebacks via --traceback without modifying command code.","Handle SIGTERM gracefully in containerised applications by translating it to a deterministic exit code.","Test error paths by raising exceptions and verifying the correct exit code is returned without manual bookkeeping.","Pipe CLI output to head or other truncating tools without noisy tracebacks when BrokenPipeError occurs."],"what_it_does":"lib_cli_exit_tools wraps Click commands to handle platform-specific signal translation, exception-to-exit-code mapping, and error output formatting. It solves the problem of CLI applications behaving inconsistently across shells, CI/CD systems, and operating systems by automatically converting Python exceptions (FileNotFoundError, PermissionError, KeyboardInterrupt) into standard exit codes, translating SIGINT/SIGTERM/SIGBREAK into structured exceptions, and gracefully handling BrokenPipeError when output is piped to truncating tools.\n\nThe library is built on rich-click and provides two main entry points: run_cli() for wrapping a single command with signal handling and exit-code translation, and cli_session() as a context manager for centralised configuration and testing. It supports optional traceback display via --traceback, custom signal handlers, and subprocess stdout/stderr capture. Configuration is test-friendly and requires no boilerplate beyond wrapping your Click command.","worth_installing":"Yes. The package is actively maintained, has low install friction, carries no security vulnerabilities, and solves a real problem for CLI developers: portable signal handling and consistent exit codes across platforms. Use it whenever you wrap a Click command that needs to behave correctly in shell pipelines and CI/CD systems."},"id":"lib-cli-exit-tools","links":{"html":"https://skillfed.io/packages/lib-cli-exit-tools","md":"https://skillfed.io/packages/lib-cli-exit-tools.md","pypi":"https://pypi.org/project/lib-cli-exit-tools/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-29","license_spdx":null,"license_treatment":"permissive","name":"lib-cli-exit-tools","python_support":"supports_current","summary":"CLI exit handling helpers: clean signals, exit codes, and error printing"},"popularity":{"monthly_downloads":138656,"position":11323,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.3.4"}
