--- id: sphinxcontrib-programoutput version: "0.20" license: BSD-2-Clause license_treatment: permissive maintenance: active --- # sphinxcontrib-programoutput — Sphinx extension to include program output License: permissive · Maintenance: active · Downloads: 263.5K/mo ## What it is and what it does sphinxcontrib-programoutput is a Sphinx extension that runs shell commands during documentation builds and inserts their output directly into the generated docs. It provides two directives: `program-output` to embed raw command output, and `command-output` to show shell session examples with prompts. This is useful for keeping documentation examples synchronized with actual program behavior—when the program's output changes, the docs update automatically on the next build. The extension depends only on Sphinx and docutils, making it lightweight to install. It's actively maintained, supports modern Python versions (3.10 through 3.14), and runs on both CPython and PyPy. The BSD-2-Clause license places no significant restrictions on use. Use it for: - Keep CLI tool help text and version output in documentation automatically synchronized with the actual program. - Generate documentation examples by running code snippets and embedding their output without manual copy-paste. - Verify that documented command examples produce the expected output during every documentation build. - Create shell session tutorials that show both the command and its real output without manual formatting. - Maintain API or tool documentation where examples must reflect the current behavior of the software. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Sphinx extension that executes arbitrary shell commands and embeds their output directly into documentation, keeping command examples synchronized with actual program behavior. Yes. Low install friction, no security vulnerabilities, permissive license, and active maintenance. Install if you maintain Sphinx documentation for CLI tools, libraries, or examples where keeping output synchronized with actual behavior matters. The only gotcha is that command execution happens during builds, so only enable this for documentation sources you trust. ## Install pip install sphinxcontrib-programoutput uv add sphinxcontrib-programoutput poetry add sphinxcontrib-programoutput ## Installing sphinxcontrib-programoutput Before you install: Low friction: pure Python wheel with only Sphinx and docutils as runtime dependencies. Actively maintained with a recent release; repository is not archived and receives commits. License in practice: BSD-2-Clause is permissive and imposes minimal restrictions on use or redistribution in most contexts. Quickstart: pip install sphinxcontrib-programoutput # In conf.py: extensions = ['sphinxcontrib.programoutput'] # In your .rst file: .. program-output:: python -V Requires Sphinx 5.0 and Python 3.10 or later; the extension executes arbitrary commands, so only use with trusted documentation sources. Verify before relying: - Whether command execution is sandboxed or has security restrictions beyond trusting the documentation source. - Performance characteristics when executing many commands during a single documentation build. - Whether output caching or incremental rebuilds are supported to avoid re-running commands. ## Package facts - License: BSD-2-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 263.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sphinx command output embedding, execute commands in documentation, keep docs examples up to date, sphinx program output directive, live command output in sphinx, shell command documentation, automated example generation sphinx, sphinx-extension, documentation-automation, cli-docs [View on SkillFed](https://skillfed.io/packages/sphinxcontrib-programoutput) · [View on PyPI](https://pypi.org/project/sphinxcontrib-programoutput/)