Plan
Plan
The plan command shows the execution plan for scripts without actually running them. It displays the dependency graph and execution order.
Usage
trilogy plan [input] [options]
Arguments
| Argument | Description |
|---|---|
input | Path to a Trilogy script or directory. Defaults to the current directory. |
Options
| Option | Description |
|---|---|
-o, --output PATH | Output file path for the plan. |
--json | Output the plan as a JSON graph with nodes and edges. |
--config PATH | Path to a trilogy.toml configuration file. |
Full Examples
# Show execution plan for a directory
trilogy plan jobs/
# Show plan for a single file
trilogy plan etl_script.preql
# Output plan as JSON
trilogy plan jobs/ --json
# Save plan to file
trilogy plan jobs/ -o execution_plan.txt
# Save JSON plan to file
trilogy plan jobs/ --json -o plan.json
Output Formats
Text format (default):
- Number of scripts
- Number of dependencies
- Execution levels (which scripts can run in parallel)
- Dependency edges
JSON format (--json):
{
"nodes": [{"id": "script.preql", "path": "/full/path/script.preql"}],
"edges": [{"from": "a.preql", "to": "b.preql"}],
"execution_order": [["a.preql"], ["b.preql", "c.preql"]]
}
Notes
- Useful for understanding complex dependency chains before running
- Execution levels show which scripts can run in parallel
- Dependencies are determined by import statements between scripts
- No dialect or connection arguments - planning does not touch the database