MODX CLI is a command-line interface for MODX 3: now in beta.
Built with Symfony Console, it provides programmatic access to many MODX features including all essential CRUD actions on resources, chunks, snippets, templates and TVs. You can also create and register custom commands to add in new functionality for chaiining commands togther or creating access to specific extras.
All commands optionally return json allowing easy automation if that’s your thing.
Whilst a very high percentage of the source is covered by unit and integration tests, this is still in beta so be careful if you’re using in production.
Getting it
You can clone the source at https://github.com/Finetuned/modx-cli or require it from https://packagist.org/packages/finetuned/modx-cli
Demos coming soon
The next step is the hard part: making demos of everything you can do with it - especially adding custom commands for extras, workflows, etc. If there’s something you’d like to see in the demo, let me know. If you find any issues, please post on the github repo.
MCP Server
There’s also an open-source MCP server which will be released in due course.