Plan
Plan
The plan command shows the execution plan for scripts without actually running them. It displays the dependency graph and execution order.
Arguments:
@argument("input", type=Path())
@option("--output", "-o", type=Path(), default=None, help="Output file path for the plan")
@option("--json", "json_format", is_flag=True, default=False, help="Output plan as JSON graph with nodes and edges")
@option("--config", type=Path(exists=True), help="Path to 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
