{"id":1502,"library":"griffecli","title":"Griffe CLI","description":"griffecli provides the command-line interface for Griffe, a powerful library designed to extract structural information and API signatures from Python projects. It's used to generate API documentation and detect breaking changes. The current version is 2.0.2, and it follows the release cadence of its core library, Griffe, which is actively maintained.","status":"active","version":"2.0.2","language":"python","source_language":"en","source_url":"https://github.com/mkdocstrings/griffe","tags":["documentation","api-generation","cli","code-analysis","type-hints"],"install":[{"cmd":"pip install griffecli","lang":"bash","label":"Install griffecli"}],"dependencies":[{"reason":"griffecli is a command-line interface wrapper for the griffe library, and it explicitly depends on griffe>=2.0.0 for its core functionality.","package":"griffe","optional":false}],"imports":[{"wrong":"from griffe.cli import main","symbol":"main","correct":"from griffecli import main"}],"quickstart":{"code":"import os\nfrom pathlib import Path\nfrom griffe.cli import main\n\n# Create a dummy module for demonstration\nPath('my_module.py').write_text(\n    \"\"\"\"\"\"A simple module.\n\ndef hello():\n    \"\"\"Say hello.\"\"\"\n    return 'Hello, Griffe!'\n\"\"\"\n)\n\n# Programmatically run the 'griffe dump' command\n# Equivalent to: griffe dump my_module.py --output-format json\n# We pass arguments as if they were from the command line\ntry:\n    main(['dump', 'my_module.py', '--output-format', 'json'])\nexcept SystemExit as e:\n    if e.code != 0:\n        print(f\"Error running Griffe: {e}\")\n\n# Clean up\nPath('my_module.py').unlink(missing_ok=True)\nPath('my_module.json').unlink(missing_ok=True)\n","lang":"python","description":"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."},"warnings":[{"fix":"Review 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.","message":"Griffe 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.","severity":"breaking","affected_versions":"griffecli 2.x, griffe 2.x"},{"fix":"For programmatic usage, refer to the `griffe` library documentation for its Python API. Use `griffecli` mainly for its command-line entry point (`griffe`).","message":"griffecli 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Remove 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'`.","message":"The `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.","severity":"deprecated","affected_versions":"griffecli 2.x, griffe 2.x"},{"fix":"Upgrade 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.","message":"Griffecli 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.","severity":"breaking","affected_versions":"griffecli 2.x, griffe 2.x"},{"fix":"Review the test script (`/script.py`) to locate and correct the unterminated triple-quoted string literal, ensuring all multi-line strings are properly closed.","message":"The 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.","severity":"gotcha","affected_versions":"N/A (test script error)"}],"env_vars":null,"search_vec":"'2.0.2':41 'activ':55 'analysi':64 'api':21,31,59 'api-gener':58 'break':35 'cadenc':47 'chang':36 'cli':2,61 'code':63 'code-analysi':62 'command':7 'command-lin':6 'core':50 'current':38 'design':15 'detect':34 'document':32,57 'extract':17 'follow':44 'generat':30,60 'griff':1,11,52 'griffec':3 'hint':67 'inform':19 'interfac':9 'librari':14,51 'line':8 'maintain':56 'power':13 'project':25 'provid':4 'python':24 'releas':46 'signatur':22 'structur':18 'type':66 'type-hint':65 'use':28 'version':39","created_at":"2026-04-09T03:50:41.996157+00:00","updated_at":"2026-04-16T15:28:44.064047+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.2.0","cli_name":"griffe","cli_version":"sh: 1: griffe: not found","type":"library","homepage":"https://griffe.readthedocs.io/en/stable/cli.html","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/griffecli/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-08-27","next_check":"2026-07-30","install_tag":"stale"}}