Install & Compatibility
Where this runs
tested against v2.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✕ build_error
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
main
✓ from griffecli import main
✗ from griffe.cli import main
The primary way to use `griffecli` is via the command line. This example demonstrates how to programmatically invoke the `griffe dump` command, which extracts module information, and outputs it in JSON format. It's equivalent to running `griffe dump my_module.py --output-format json` in your shell.
import os
from pathlib import Path
from griffe.cli import main
# Create a dummy module for demonstration
Path('my_module.py').write_text(
""""""A simple module.
def hello():
"""Say hello."""
return 'Hello, Griffe!'
"""
)
# Programmatically run the 'griffe dump' command
# Equivalent to: griffe dump my_module.py --output-format json
# We pass arguments as if they were from the command line
try:
main(['dump', 'my_module.py', '--output-format', 'json'])
except SystemExit as e:
if e.code != 0:
print(f"Error running Griffe: {e}")
# Clean up
Path('my_module.py').unlink(missing_ok=True)
Path('my_module.json').unlink(missing_ok=True)
griffe --version
Debug
Known issues
breakingGriffe 2.x (and thus griffecli 2.x) introduced significant breaking changes from Griffe 1.x. The internal API was heavily refactored, which impacts users who were accessing Griffe programmatically (e.g., `GriffeLoader` instantiation). The output format of `griffe dump` also changed.fixReview the Griffe 2.0 migration guide if upgrading from 1.x. Adapt programmatic usage to the new API. Be aware of changes in the `griffe dump` output schema.
affects: griffecli 2.x, griffe 2.x
gotchagriffecli is primarily a command-line wrapper. The actual core logic and API are provided by the `griffe` library. When using programmatically, you will typically import directly from `griffe` (e.g., `from griffe.loader import GriffeLoader`) rather than trying to import from `griffecli` itself.fixFor programmatic usage, refer to the `griffe` library documentation for its Python API. Use `griffecli` mainly for its command-line entry point (`griffe`).
affects: All versions
deprecatedThe `docstrings_parser` argument (a parameter) was removed in Griffe 2.x. Its functionality was replaced by the `docstring_parser` argument (a string name, like 'markdown' or 'griffe') or inferred automatically.fixRemove the `docstrings_parser` parameter from your code. If you need to specify a parser, use the `docstring_parser` string argument instead, e.g., `docstring_parser='markdown'`.
affects: griffecli 2.x, griffe 2.x
breakingGriffecli 2.x and Griffe 2.x require Python 3.10 or higher. Installation on Python environments older than 3.10 will fail with a 'Requires-Python >=3.10' error.fixUpgrade your Python environment to version 3.10 or newer. Alternatively, if your project allows, consider using an older version of griffecli (e.g., 1.x) that is compatible with your current Python version.
affects: griffecli 2.x, griffe 2.x
gotchaThe test script encountered a `SyntaxError: unterminated triple-quoted string literal`, preventing it from executing. This error indicates a fundamental issue with the Python code in the test script itself, rather than a specific behavior or breaking change within the `griffecli` or `griffe` library.fixReview the test script (`/script.py`) to locate and correct the unterminated triple-quoted string literal, ensuring all multi-line strings are properly closed.
affects: N/A (test script error)
Upgrade
Version history
2.2.0latest on PyPI · released Aug 16, 2026
Audit
Dependencies
grifferequiredgriffecli is a command-line interface wrapper for the griffe library, and it explicitly depends on griffe>=2.0.0 for its core functionality.