Skip to content

Commit

Permalink
docs: add documentation to integrate alchemy commands in an existing …
Browse files Browse the repository at this point in the history
…group (#378)
  • Loading branch information
Kumzy authored Jan 31, 2025
1 parent 7ed7997 commit 3ec9660
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/usage/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,32 @@ Here's how to extend the CLI with your own commands:
# Add migration commands to your group
add_migration_commands(alchemy_group)
Custom Group Integration
~~~~~~~~~~~~~~~~~~~~~~~~

You can also integrate Advanced Alchemy's commands into your existing Click group:

.. code-block:: python
import click
from advanced_alchemy.cli import add_migration_commands
@click.group()
def cli():
"""My application CLI."""
pass
# Add migration commands to your CLI group
add_migration_commands(cli)
@cli.command()
def my_command():
"""Custom command in your CLI."""
pass
if __name__ == "__main__":
cli()
Typer integration
-----------------

Expand Down

0 comments on commit 3ec9660

Please sign in to comment.