-
-
Notifications
You must be signed in to change notification settings - Fork 485
Description
Summary
I recently tried following the documentation on Extending the CLI using entry points, specifically for the uv package manager configuration, and found an issue.
The incorrect documentation is located in: docs/usage/cli.rst line 127.
The current documentation suggests using [project.scripts]:
[project.scripts]
my_command = "my_litestar_plugin.cli:main"Problem: Based on the Litestar source code (which explicitly searches for entry_points(group="litestar.commands")), and my own testing, the [project.scripts] configuration only creates an independent, standalone executable. It does not register the command with the litestar.commands entry point group, and therefore the command fails to inject into the main litestar CLI group (litestar -h).
Proposed Fix: The configuration should use the explicit and standard [project.entry-points] for custom plugin groups, which is compatible with uv and all PEP 621 compliant tools:
[project.entry-points."litestar.commands"]
my_command = "my_litestar_plugin.cli:main"This ensures the command is correctly discovered by the LitestarExtensionGroup.
Action Request:
If you'd prefer to fix this yourselves, please feel free to close this issue once the documentation has been updated. Otherwise, please let me know, and I would be happy to submit a Pull Request to resolve this documentation error.
Thank you!