Thank you for your interest in contributing to mxcli! This guide will help you get started.
- Go 1.26+ — the project uses pure Go with no CGO dependency
- bun — used for the VS Code extension (
vscode-mdl/); do not use npm/node - Docker — required for integration tests and running Mendix apps
- ANTLR4 — only needed if modifying the MDL grammar (
.g4files)
# Clone the repository
git clone https://github.com/mendixlabs/mxcli.git
cd mxcli
# Build
make build
# Run tests
make testThe binary is output to ./bin/mxcli.
See CLAUDE.md for a detailed architecture overview. Key directories:
| Directory | Description |
|---|---|
cmd/mxcli/ |
CLI entry point (Cobra commands) |
sdk/ |
Core SDK: domain model, microflows, pages, MPR reader/writer |
mdl/ |
MDL parser (ANTLR4 grammar, AST, visitor, executor) |
api/ |
High-level fluent API |
sql/ |
External database connectivity |
vscode-mdl/ |
VS Code extension for MDL language support |
make build # Build mxcli + source_tree (syncs embedded assets automatically)
make release # Cross-compile for all platforms
make vscode-ext # Build the VS Code extension (requires bun)make test # Unit tests
make test-mdl MPR=path/to/app.mpr # MDL integration tests (requires Docker)make fmt # Format code
make vet # Run go vetIf you modify mdl/grammar/MDLLexer.g4 or mdl/grammar/MDLParser.g4:
make grammar # Regenerate the ANTLR4 parserSee docs/03-development/MDL_PARSER_ARCHITECTURE.md for parser design details.
The extension lives in vscode-mdl/ and uses bun (not npm):
cd vscode-mdl
bun install
bun run compileOr use the Makefile:
make vscode-ext # Build .vsix package
make vscode-install # Build and install into VS Code- Follow standard Go conventions (
go fmt,go vet) - Use descriptive names matching Mendix terminology
- Add
// SPDX-License-Identifier: Apache-2.0as the first line of every new source file - Keep BSON/JSON tags consistent with Mendix serialization format
- Export types that should be part of the public API
Mendix uses different "storage names" in BSON $Type fields than the "qualified names" in SDK documentation. Always verify storage names against:
- Existing MPR files
- Reflection data in
reference/mendixmodellib/reflection-data/ - Parser cases in
sdk/mpr/parser_microflow.go
See the table in CLAUDE.md for common mappings.
Templates in sdk/widgets/templates/ must include both type (PropertyTypes schema) and object (default WidgetObject) fields. Always extract from Studio Pro, not generated programmatically.
Before writing MDL scripts, read the relevant skill files in .claude/skills/mendix/ for syntax reference and common pitfalls. Validate with:
./bin/mxcli check script.mdl # Syntax check
./bin/mxcli check script.mdl -p app.mpr --references # With reference validation- Create a feature branch from
main - Make your changes, ensuring tests pass (
make test) - Add tests for new functionality
- Verify the build succeeds (
make build) - Submit a pull request with a clear description of the changes
Please report bugs and feature requests via the project's issue tracker. Include:
- Steps to reproduce
- Expected vs actual behavior
- Mendix version (if relevant)
- Output of
mxcli --version
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.