CLI
Install the CLI extra:
Commands are available as urich <command>.
create-app
Scaffold a new application directory.
Creates a minimal layout with main.py and a placeholder for registering modules.
add-context
Add a bounded context (folder with domain, application, infrastructure, module.py skeleton).
Use --dir to specify the project root (default is current directory). Creates e.g. orders/domain.py, orders/application.py, orders/infrastructure.py, orders/module.py.
add-aggregate
Add an aggregate to an existing context.
Creates or updates the orders context with an aggregate named Order and the usual domain/application/infrastructure pieces.
After scaffolding
In your app entrypoint (e.g. main.py):
from urich import Application
from orders.module import orders_module
app = Application()
app.register(orders_module)
app.openapi(title="My API", version="0.1.0")
Run with:
Then open http://localhost:8000/docs.