{"id":31548710,"url":"https://github.com/mxlint/mxlint-cli","last_synced_at":"2025-10-04T16:52:12.686Z","repository":{"id":230616940,"uuid":"777141768","full_name":"mxlint/mxlint-cli","owner":"mxlint","description":"A set of tools to enhance Mendix app development workflows. They are mainly designed for professionals but should be usable for everybody.","archived":false,"fork":false,"pushed_at":"2025-09-03T05:46:31.000Z","size":60034,"stargazers_count":26,"open_issues_count":7,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-03T07:27:06.130Z","etag":null,"topics":["best-practices","golang","linting","mendix","mxlint","opa","policies","rego","security","xunit"],"latest_commit_sha":null,"homepage":"https://mxlint.com","language":"SCSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mxlint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-25T09:33:05.000Z","updated_at":"2025-09-03T05:45:22.000Z","dependencies_parsed_at":"2025-07-30T12:17:49.208Z","dependency_job_id":"7730cf9b-9642-4c00-a048-7de49a0c5dc2","html_url":"https://github.com/mxlint/mxlint-cli","commit_stats":null,"previous_names":["cinaq/mendix-cli"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/mxlint/mxlint-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxlint%2Fmxlint-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxlint%2Fmxlint-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxlint%2Fmxlint-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxlint%2Fmxlint-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxlint","download_url":"https://codeload.github.com/mxlint/mxlint-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxlint%2Fmxlint-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278343086,"owners_count":25971399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["best-practices","golang","linting","mendix","mxlint","opa","policies","rego","security","xunit"],"created_at":"2025-10-04T16:52:07.282Z","updated_at":"2025-10-04T16:52:12.649Z","avatar_url":"https://github.com/mxlint.png","language":"SCSS","readme":"# MxLint CLI\n\nA set of Command line interface tools for Mendix developers, CICD engineers and platform engineers.\n\n\u003e This project is in early development stage. Please use with caution. We are looking for contributors to help us improve the tools. Please create a PR with your changes. We believe in open ecosystem and open source. We are looking forward to your contributions. These can be documentation improvements, bug fixes, new features, etc.\n\n## Mendix Studio Pro extension\n\nThe quickest way to try out MxLint is to use it as Mendix Studio pro extension. Follow the instructions at [mxlint-extension](https://github.com/mxlint/mxlint-extension)\n\n## Basic Usage\n\nmxlint-cli is a set of tools to help you with your Mendix projects. As such you can use it in many ways. To give you a feeling what it does. Try the following example:\n\n### Prerequisites\n\n- Mendix Project source\n- Operating system: Linux, MacOS, Windows\n- Download your platform specific binary from the [releases page](https://github.com/mxlint/mxlint-cli/releases)\n- Download the policies from the [releases page](https://github.com/mxlint/mxlint-rules/releases) and extract them to a directory\n\n### Export Mendix model to Yaml\n\n- copy `mxlint-cli` to your project directory\n- Open a terminal and navigate to your project directory; ideally use git-bash on Windows or Terminal on MacOS/Linux\n- run `./mxlint-cli export-model`\n\nYou will see a new directory `modelsource` with the exported Mendix model in Yaml format\n\nIt's advisable to add the `mxlint-cli` file to your `.gitignore` file. This way you don't accidentally commit it to your repository.\n\n### Lint Mendix Yaml files\n\n- copy `policies` directory to your project directory\n- run `./mxlint-cli lint --xunit-report=report.xml`\n\nYou will see a summary of the policy evaluations in the terminal and a report in the `report.xml` file. The report is in xUnit format. You can use it in your CI/CD pipeline.\n\nDo you want to create your own policies? Please refer to our guide [Create new policy](./docs/create-new-policy.md)\n\n## export-model\n\nMendix models are stored in a binary file with `.mpr` extension. This project exports Mendix model to a human readable format, such as Yaml. This enables developers to use traditional code analysis tools on Mendix models. Think of quality checks like linting, code formatting, etc.\n\n![Mendix Model Exporter](./resources/model-new-entity.png)\n\nSee each Mendix document/object as a separate file in the output directory. And see the differences between versions in a version control system. Here we changed the `Documentation` of an entity and added a new `Entity` with one `Attribute`.\n\n#### Pipeline integration\n\nIf you do not want to export the model to Yaml on your local machine, you can do it in your pipeline. Here's a high-level example:\n\n```bash\n$ ./bin/mxlint-cli-darwin-arm64 export-model -i resources/app-mpr-v1/\nINFO[0000] Exporting resources/full-app-v1.mpr to modelsource\nINFO[0000] Completed resources/full-app-v1.mpr\n\n$ ./bin/mxlint-cli-darwin-arm64 lint\n## policies/001_project_settings/001_0001_anonymous_disabled.rego\nPASS (0.00148s) modelsource/Security$ProjectSecurity.yaml\n\n## policies/001_project_settings/001_0002_demo_users_disabled.rego\nSKIP (0.00000s) modelsource/Security$ProjectSecurity.yaml\n\n## policies/001_project_settings/001_0003_security_checks.rego\nSKIP (0.00000s) modelsource/Security$ProjectSecurity.yaml\n\n## policies/001_project_settings/001_0004_strong_password.rego\nSKIP (0.00000s) modelsource/Security$ProjectSecurity.yaml\n\n## policies/002_domain_model/002_0001_number_of_entities.rego\nPASS (0.00190s) modelsource/Administration/DomainModels$DomainModel.yaml\nPASS (0.00156s) modelsource/Atlas_UI_Resources/DomainModels$DomainModel.yaml\nPASS (0.00240s) modelsource/MyFirstModule/DomainModels$DomainModel.yaml\n\n## policies/002_domain_model/002_0002_number_of_attributes.rego\nPASS (0.00161s) modelsource/Administration/DomainModels$DomainModel.yaml\nPASS (0.00113s) modelsource/Atlas_UI_Resources/DomainModels$DomainModel.yaml\nPASS (0.00158s) modelsource/MyFirstModule/DomainModels$DomainModel.yaml\n```\n\n## lint\n\n![Mendix Lint report](./resources/lint-xunit-report.png)\nLint Mendix Yaml files. This tool checks for common mistakes and enforces best practices. It uses OPA as policy engine. Therefore policies must be written in the powerful Rego language. Please refer to [Rego language reference](https://www.openpolicyagent.org/docs/latest/policy-reference/) for more information on the syntax and semantics.\n\n### NOQA (Ignore document)\n\nA specific document can be marked as \"Skipped\" if you have a line in the `documentation` field that starts with either `#noqa` or `# noqa` followed by an optional message (Case in-sensitive). This message will be included as \"Skipped\" reason in linting results.\n\n## serve\n\nRun a server that exports model and lints whenever the input MPR file changes. This is works in standalone way and via integration with the Mendix Studio Pro extension.\n\n```\n./bin/mxlint-cli-darwin-arm64 serve -i . -o modelsource -r rules -p 8084\nINFO[0000] Starting server on port 8084\nINFO[0000] Watching for changes in /Users/xcheng/project\nINFO[0000] Output directory: modelsource\nINFO[0000] Rules directory: rules\nINFO[0000] Mode: basic\nINFO[0000] Debounce time: 500 ms\nINFO[0000] HTTP server listening on 127.0.0.1:8084\nINFO[0000] Dashboard available at http://localhost:8084\nINFO[0000] Initial export and lint\nINFO[0000] Running export-model and lint\nINFO[0000] Exporting /Users/xcheng/project/App.mpr to modelsource\nINFO[0000] Found 361 documents\nINFO[0000] Completed /Users/xcheng/project/App.mpr\n```\n\nThe serve command provides:\n- A web dashboard at http://localhost:8084\n- An API endpoint at http://localhost:8084/api/results for JSON results\n- Automatic re-linting when files change\n- Debouncing to prevent excessive processing on rapid changes\n\n## test-rules\n\nRules can be written in both `Rego` and `JavaScript` format. To speed up rule development we have implemented `test-rules` subcommand that can quickly evaluate your rule against known test scenarios. The test cases are written in `yaml` format. \n\n```\n$ ./bin/mxlint-darwin-arm64 test-rules -r resources/rules\nINFO[0000] \u003e\u003e resources/rules/001_0002_demo_users_disabled.js \nINFO[0000] PASS  allow\nINFO[0000] PASS  no_allow\nINFO[0000] \u003e\u003e resources/rules/001_0003_security_checks.rego \nINFO[0000] PASS  allow\nINFO[0000] PASS  no_allow_1\nINFO[0000] PASS  no_allow_2\n```\n\n### Features\n\n- Export Mendix model to Yaml\n- Lint Mendix Yaml files for common mistakes and enforces best practices\n- Watch for changes and automatically re-lint\n- Serve lint results via HTTP for integration with other tools\n- Microflow transformation to more readable format (advanced mode)\n- Support for both Rego and JavaScript rules\n- Human readable output\n\n## TODO\n\n- [x] Export Mendix model to Yaml\n- [x] Improve output human readability\n- [x] Linting for Mendix Yaml files\n- [x] Create policies for linting\n- [x] Output linting results in xUnit format\n- [x] Support watching for changes (watch command)\n- [x] Serve lint results via HTTP (serve command)\n- [x] Basic microflow transformation to more readable format\n- [ ] Expand test coverage\n- [ ] Support incremental changes for better performance\n- [ ] Improve performance for large models\n- [ ] Improve error handling\n- [ ] Enhance microflow transformation with pseudo code generation\n\n## Contribute\n\nCreate a PR with your changes. We will review and merge it.\n\nRego files must follow the [style guide](https://github.com/StyraInc/rego-style-guide/blob/main/style-guide.md)\n\nMake sure to run the tests before creating a PR:\n\n```bash\nmake test\n```\n\n## License\n\nThis project is an initiative of CINAQ. See [LICENSE](./LICENSE). [CINAQ](https://cinaq.com) is a registered trademark of CINAQ B.V.. Mendix is a registered trademark of Mendix B.V. All other trademarks are the property of their respective owners.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxlint%2Fmxlint-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxlint%2Fmxlint-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxlint%2Fmxlint-cli/lists"}