Qx CLI: scaffolding, code generation, local dev orchestration
Project description
qx-cli
Scaffolding, code generation, and local-dev orchestration for the Qx framework. Invoked as qx once installed, or uv run qx during development.
What lives here
qx new service NAME— scaffold a complete new Qx service: directory structure, pyproject.toml, DI bootstrap, FastAPI app factory, Alembic config, Docker Compose overrides, and aREADME.md.qx generate aggregate NAME— add a domain aggregate withEntity, events, and a stub repository to an existing service.qx generate command NAME— add aCommandand handler class with the standard boilerplate.qx generate query NAME— add aQueryand handler class.qx generate endpoint— add a FastAPI route file wired to the Mediator.qx generate event NAME— add anIntegrationEventand its handler skeleton.qx dev up— start the local Docker Compose stack (Postgres, Redis, NATS, Prometheus, Tempo, Grafana, MailHog, MinIO).qx dev down— stop and remove the local stack.qx version— print the framework version.
Usage
# Install (or use via uv in the workspace)
pip install qx-cli
# Scaffold a new service
qx new service payments-service
cd payments-service
# Add domain objects
qx generate aggregate Payment
qx generate command ProcessPayment
qx generate query GetPayment
qx generate event PaymentProcessed
# Start local infra
qx dev up
# Run
uv run uvicorn payments_service.main:app --reload
Generated structure
qx new service produces:
my-service/
├── src/my_service/
│ ├── domain/aggregates/ # domain model
│ ├── application/
│ │ ├── commands/ # command handlers
│ │ └── queries/ # query handlers
│ ├── infrastructure/
│ │ └── persistence/ # repositories, SA mapping
│ └── presentation/routes/ # FastAPI routes
├── tests/
│ ├── unit/
│ └── integration/
├── alembic/
├── pyproject.toml
└── README.md
Design rules
- Generated code follows the same conventions as
examples/identity-service— it is the canonical reference for what the generator should produce. qx dev up/downis a thin wrapper arounddocker composepointing atdeploy/docker-compose.yamlin the workspace root. It does not manage application containers, only infrastructure.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qx_cli-1.1.0.tar.gz
(26.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
qx_cli-1.1.0-py3-none-any.whl
(58.2 kB
view details)
File details
Details for the file qx_cli-1.1.0.tar.gz.
File metadata
- Download URL: qx_cli-1.1.0.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15c24bd66adff12c744b4c1e6c88f3da4f78d56793c3fdd62e43a0cf30fa266b
|
|
| MD5 |
c5801ebdcb25801380231be5812b79a0
|
|
| BLAKE2b-256 |
b3b59450b79e58f7c22df4b96b8cdaad39575db80de6bed7cd97a0d543bf9add
|
File details
Details for the file qx_cli-1.1.0-py3-none-any.whl.
File metadata
- Download URL: qx_cli-1.1.0-py3-none-any.whl
- Upload date:
- Size: 58.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b0c941252e7f3b6c42ceaa93b04f83617848c17112048a1c37f099fba780d9b
|
|
| MD5 |
37af51c26a58cc302ce20cf6bf653127
|
|
| BLAKE2b-256 |
16025ab878f3534e4c35a29f76234faa25949aff25cf24c4feed75e424eb553e
|