sphinxcontrib-runcmd
Sphinx "runcmd" extension
Decision gist · record as of 2026-08-14
Yes, if you maintain Sphinx documentation and want to keep command output examples in sync with reality. The low install friction and permissive license make it a safe addition. However, the aging codebase (last release 2018) means you should verify compatibility with your Python version and Sphinx version before relying on it for critical docs. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Sphinx to be installed and a working Sphinx documentation project.
- Installation is straightforward with a single dependency on sphinx and a pure-Python wheel.
- The package is aging—last release was 2018-11-08 and no updates since—but the repository remains active with a recent commit on 2025-04-28, suggesting maintenance rather than abandonment.
License · maintenance · safety
MIT (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.
last release 2018-11-08 (2836 days) · last repo commit 2025-04-28 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 135,786 downloads/mo, #11,418 on PyPI
Alternatives
Verify before relying
pip install sphinxcontrib-runcmd
In conf.py:
extensions = ["sphinxcontrib.runcmd"]
In your .rst file:
.. runcmd:: python script.py -h
:syntax: bash
:prompt:- Whether the package works reliably with modern Python versions beyond 3.6, given the last release was 2018.
- Whether command execution works across Windows, macOS, and Linux without platform-specific issues.
- Performance characteristics when executing many commands or long-running processes in a single build.
What it is and what it does
sphinxcontrib-runcmd is a Sphinx extension that lets you run shell commands during documentation builds and automatically insert their output into your reStructuredText files. Instead of manually copying command output into your docs, you write a directive with the command you want to run, and the extension executes it and captures the result. It builds on Sphinx's standard code-block directive, so you get all the usual formatting options like line numbers, syntax highlighting, and line ranges.
The extension adds several options beyond code-block: you can specify output syntax highlighting separately from the command, display the command prompt itself, dedent output, and apply regex-based text replacements to clean up or anonymize the output. This makes it useful for keeping documentation in sync with actual tool behavior without manual updates.
Use it for
- Documenting CLI tools by running them with --help and embedding the actual output in your docs.
- Keeping API documentation examples current by executing test scripts and showing their real output.
- Building tutorials where command results need to stay synchronized with the actual tool behavior.
- Generating reference documentation that includes real command output without manual copying.
- Creating reproducible documentation where the build process verifies that examples actually work.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you maintain Sphinx documentation and want to keep command output examples in sync with reality.
The low install friction and permissive license make it a safe addition. However, the aging codebase (last release 2018) means you should verify compatibility with your Python version and Sphinx version before relying on it for critical docs. No known security vulnerabilities.
Install
sphinxcontrib-runcmd on PyPI
Before you install
Installation is straightforward with a single dependency on sphinx and a pure-Python wheel. The package is aging—last release was 2018-11-08 and no updates since—but the repository remains active with a recent commit on 2025-04-28, suggesting maintenance rather than abandonment.
Requires Sphinx to be installed and a working Sphinx documentation project.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute it freely with minimal restrictions.
Quickstart
pip install sphinxcontrib-runcmd
In conf.py:
extensions = ["sphinxcontrib.runcmd"]
In your .rst file:
.. runcmd:: python script.py -h
:syntax: bash
:prompt:
Verify before relying
- Whether the package works reliably with modern Python versions beyond 3.6, given the last release was 2018.
- Whether command execution works across Windows, macOS, and Linux without platform-specific issues.
- Performance characteristics when executing many commands or long-running processes in a single build.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagesphinx |
| Maintenance | Aging 2,836 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 135,786 / month, #11,418 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.6Topic :: DocumentationTopic :: Utilities |
Evidence: sphinxcontrib_runcmd-0.2.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “embed shell command results in docs”
- sphinxcontrib-runcmdA Sphinx extension that executes arbitrary shell commands and embeds…
- sphinxcontrib-programoutputA Sphinx extension that executes arbitrary shell commands and embeds…
- markdown-execExecutes code blocks embedded in Markdown files and replaces them…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also sphinx-prompt · sphinxcontrib-programoutput · sphinx_mdinclude · sphinx-jinja · sphinx-substitution-extensions · sphinx-panels · changelog · sphinxcontrib-typer · sphinxcontrib-video · rich-rst