File tree Expand file tree Collapse file tree 3 files changed +42
-5
lines changed
Expand file tree Collapse file tree 3 files changed +42
-5
lines changed Original file line number Diff line number Diff line change @@ -531,8 +531,9 @@ Cross-reference commands require `REFRESH CATALOG FULL` to populate reference da
531531| Command | Syntax | Notes |
532532| ---------| --------| -------|
533533| Interactive REPL | ` mxcli ` | Interactive MDL shell |
534- | Execute command | ` mxcli -p app.mpr -c "SHOW ENTITIES " ` | Single command |
534+ | Inline commands | ` mxcli -p app.mpr -c "CMD1; CMD2; CMD3 " ` | Semicolons batch multiple commands |
535535| Execute script | ` mxcli exec script.mdl -p app.mpr ` | Script file |
536+ | Stdin piping | ` echo "CMD" \| mxcli -p app.mpr ` | Quiet mode, pipe-friendly |
536537| Check syntax | ` mxcli check script.mdl ` | Parse-only validation |
537538| Check references | ` mxcli check script.mdl -p app.mpr --references ` | With reference validation |
538539| Lint project | ` mxcli lint -p app.mpr [--format json\|sarif] ` | 14 built-in + 27 Starlark rules |
Original file line number Diff line number Diff line change @@ -37,16 +37,51 @@ CREATE ASSOCIATION Sales.Order_Customer
3737 TYPE Reference;
3838```
3939
40- ## Executing Scripts
40+ ## Execution Modes
4141
42- ### From the Command Line
42+ mxcli supports several ways to execute MDL. All modes open a single connection to the project — there is no per-command overhead.
4343
44- Use ` mxcli exec ` to run a script against a project:
44+ ### Script File
45+
46+ Use ` mxcli exec ` to run a ` .mdl ` file:
4547
4648``` bash
4749mxcli exec setup_domain_model.mdl -p /path/to/app.mpr
4850```
4951
52+ ### Inline Commands (` -c ` )
53+
54+ Pass one or more semicolon-separated commands with the ` -c ` flag:
55+
56+ ``` bash
57+ # Single command
58+ mxcli -p app.mpr -c " SHOW ENTITIES"
59+
60+ # Multiple commands in one connection
61+ mxcli -p app.mpr -c " DESCRIBE ENTITY Sales.Customer; DESCRIBE ENTITY Sales.Order; SHOW MICROFLOWS IN Sales"
62+ ```
63+
64+ This is the fastest way for AI agents to batch multiple queries — all commands share a single connection.
65+
66+ ### Stdin Piping
67+
68+ When stdin is a pipe (not a terminal), mxcli reads commands from it in quiet mode (no banner, no prompts):
69+
70+ ``` bash
71+ # Pipe from echo
72+ echo " SHOW ENTITIES; SHOW MICROFLOWS" | mxcli -p app.mpr
73+
74+ # Pipe from file
75+ mxcli -p app.mpr < commands.mdl
76+
77+ # Pipe from heredoc
78+ mxcli -p app.mpr << 'EOF '
79+ DESCRIBE ENTITY Sales.Customer;
80+ DESCRIBE ENTITY Sales.Order;
81+ SHOW MICROFLOWS IN Sales;
82+ EOF
83+ ```
84+
5085### From the REPL
5186
5287Use ` EXECUTE SCRIPT ` inside an interactive session:
Original file line number Diff line number Diff line change @@ -120,8 +120,9 @@ Everything mxcli can do, organized by use case.
120120
121121| Capability | Command | Notes |
122122| ---| ---| ---|
123- | Batch execution | ` mxcli -p app.mpr -c "... " ` | Non-interactive |
123+ | Inline commands | ` mxcli -p app.mpr -c "CMD1; CMD2; CMD3 " ` | Semicolon-separated, single connection |
124124| Script files | ` mxcli exec script.mdl -p app.mpr ` | Run MDL files |
125+ | Stdin piping | ` echo "CMD" \| mxcli -p app.mpr ` | Quiet mode, no prompts |
125126| Docker build | ` mxcli docker build -p app.mpr ` | Build MDA in container |
126127| Docker check | ` mxcli docker check -p app.mpr ` | Validate in container |
127128| Testing | ` mxcli test tests/ -p app.mpr ` | ` .test.mdl ` / ` .test.md ` |
You can’t perform that action at this time.
0 commit comments