Skip to content

Bug: Wrong modules routing with alchemy cli #491

Description

@BeaverNotACat

Description

The --config parameter in the Advanced Alchemy CLI is designed to be used from the user's project root. However, it currently only supports passing package-internal modules. Attempting to use external modules will result in the following error:
Error loading config: No module named '<module_name>'

URL to code causing the issue

No response

MCVE

Run the following command with any arbitrary module path:

uv run alchemy --config <any module path> init

This will fail with the error Error loading config

Run the command using a valid internal module

uv run alchemy --config advanced_alchemy.base init

This works as expected and pass further

Steps to reproduce

1.Initialize a new project

uv init
  1. Add Advanced Alchemy with CLI extras
uv add advanced-alchemy[cli]
  1. Create a alchemy_config.py file in the project root with the following content
from advanced_alchemy.config import SQLAlchemyAsyncConfig

connection_string = "postgresql+psycopg://postgres:postgres@domain:5432/pandoradb"
config = SQLAlchemyAsyncConfig(connection_string=str(connection_string))
  1. Run the CLI with your config
uv run alchemy --config alchemy_config.config init
  1. Observe the error: Error loading config: No module named 'alchemy_config'

Screenshots

No response

Logs

Package Version

uv 0.7.11
cpython-3.13.3-linux-aarch64-gnu
advanced-alchemy 1.4.4

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Activity

  1. BeaverNotACat commented on Jun 13, 2025

    @BeaverNotACat
    Author

    Also usage documentation is currently outdated and does not reflect behavior, like [OPTIONS] COMMAND [ARGS] parameter order.
    I’d be happy to contribute an update to the docs when I could use alchemy cl

  2. added
    acceptedChange or enhancement is accepted for development.
    on Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedChange or enhancement is accepted for development.bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions