Skip to main content

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 a README.md.
  • qx generate aggregate NAME — add a domain aggregate with Entity, events, and a stub repository to an existing service.
  • qx generate command NAME — add a Command and handler class with the standard boilerplate.
  • qx generate query NAME — add a Query and handler class.
  • qx generate endpoint — add a FastAPI route file wired to the Mediator.
  • qx generate event NAME — add an IntegrationEvent and 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/down is a thin wrapper around docker compose pointing at deploy/docker-compose.yaml in 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-0.1.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qx_cli-0.1.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file qx_cli-0.1.0.tar.gz.

File metadata

  • Download URL: qx_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for qx_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7863a3ff0bb5daf612b4519e1ab3005255c789aa68814a6b737486185e87d59b
MD5 8dde62867ff9eda6d9676b53110e157c
BLAKE2b-256 f45fcfedda80c47c80390f4f9e09310a54599b31d91c7029e6712bf0c4eb333f

See more details on using hashes here.

File details

Details for the file qx_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qx_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for qx_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa3008973bf8bca1d845b7b6c4c30e37b5c0ba66bf06f143b03ef42daaabca04
MD5 27a205f3a1b7a48fac5f654f54a0387c
BLAKE2b-256 efdd8473774a8186ed3032d41225337ee7a1ec1feb5ece47ede3bde9b415a73c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page