-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Overview
This issue proposes adding lifecycle management commands to MXCP to standardize common development workflows like setup, testing, and deployment.
Problem Statement
Currently in MXCP projects:
- Setup scripts, test runners, deployment scripts are scattered across directories
- No standardized way to run common development tasks
- Scripts are often project-specific and not reusable
- Cross-platform compatibility issues (bash scripts don't work on Windows)
- Developers need to remember multiple commands and their locations
Proposed Solution
Add a new mxcp dev
command group with subcommands for common lifecycle tasks:
Commands
mxcp dev setup
- Initialize project dependencies and environmentmxcp dev test [--level light|full|unit]
- Run tests at different levelsmxcp dev deploy --target <target>
- Deploy to configured targetsmxcp dev run <command>
- Execute custom lifecycle commandsmxcp dev list
- List all available lifecycle commands
Configuration
Projects define lifecycle commands in mxcp-site.yml
:
lifecycle:
setup:
description: "Initialize project"
commands:
- command: "pip install -r requirements.txt"
name: "Install dependencies"
- command: "dbt deps"
name: "Install dbt packages"
condition: "if_not_exists:dbt_packages"
test:
light:
description: "Quick tests"
commands:
- "mxcp test"
full:
description: "All tests"
commands:
- "mxcp test"
- "dbt test"
- "pytest"
deploy:
targets:
production:
description: "Deploy to AWS"
commands:
- "./deploy.sh"
environment:
required: ["AWS_REGION"]
custom:
clean:
description: "Clean files"
commands:
- "rm -rf target/"
Benefits
- Consistency: All team members use the same commands
- Cross-platform: Works on Windows, macOS, and Linux
- Self-documenting: Commands are defined with descriptions
- Discoverable: List all available commands with
mxcp dev list
- Safe: Preview commands with
--dry-run
before executing
Implementation
- Add new
src/mxcp/cli/dev.py
module - Update schema to support lifecycle configuration
- Create comprehensive tests
- Add documentation
This aligns with MXCP's existing patterns (similar to mxcp dbt
wrapper) and enhances the developer experience.
Metadata
Metadata
Assignees
Labels
No labels