Skip to main content

orun plan

orun plan compiles intent, component discovery, and compositions into an immutable execution DAG.

Usage​

orun plan [component]

Pass a component name as a positional argument to restrict the plan to that component — equivalent to --component <name>:

orun plan network-foundation

When run without --intent, orun automatically discovers intent.yaml by walking up the directory tree to the git root. The plan is always global — it always includes all components. Use the positional argument or --component to explicitly restrict compilation to specific components.

The generated plan is saved to .orun/plans/{checksum}.json and also written as .orun/plans/latest.json. orun run resolves latest automatically, so you rarely need to specify an output path.

Common examples​

Generate a plan (auto-discovers intent):

orun plan

Generate a plan scoped to one component (positional argument):

orun plan network-foundation

Generate a plan from a specific intent file:

orun plan -i examples/intent.yaml

Generate with an explicit output path (for backwards compatibility):

orun plan -i examples/intent.yaml -o /tmp/orun-plan.json

Generate a named plan that can be referenced by name later:

orun plan -i examples/intent.yaml --name release-candidate

Generate YAML output:

orun plan -i examples/intent.yaml -o plan.yaml -f yaml

Filter to one environment:

orun plan -i examples/intent.yaml --env staging

Filter to one component:

orun plan -i examples/intent.yaml --component api-edge-worker

Preview the dependency graph while compiling:

orun plan -i examples/intent.yaml --view dag

Focus on changed components:

orun plan -i examples/intent.yaml --changed --base main

Since v2.9.0 --changed only includes components whose files actually changed. Dependencies are pulled in only when their edge declares include: always — see Dependency rules → Include policy.

Debug how --changed resolved its git refs:

orun plan -i examples/intent.yaml --changed --explain

Use trigger bindings for CI-driven environment activation:

orun plan --from-ci github --event-file "$GITHUB_EVENT_PATH"

Simulate a named trigger locally:

orun plan --trigger github-pull-request --base main --head HEAD

Flags​

FlagMeaning
--intent, -iIntent file path (auto-discovered if not set)
--output, -oExplicit output path (optional; defaults to .orun/plans/)
--format, -fOutput format: json or yaml
--nameGive the plan a memorable name for later reference via --plan <name>
--debugEnable debug logging during planning
--env, -eRestrict compilation to one environment
--componentRestrict compilation to one or more components (repeatable)
--view, -vRender a view such as dag, dependencies, or component=<name>
--changedEnable change-aware filtering
--baseBase git ref for change detection
--headHead git ref for change detection
--filesExplicit changed-file list
--uncommittedScope to uncommitted changes
--untrackedScope to untracked files
--explainPrint how --changed resolved its base and head refs
--triggerNamed trigger binding for environment activation
--from-ciCI provider for event normalization (e.g. github)
--event-filePath to provider event JSON file
--artifactArtifact backend for uploading plan shard from CI (github)
--github-outputWrite matrix, plan_id, exec_id to $GITHUB_OUTPUT (for GitHub Actions matrix)

GitHub Actions usage​

When run inside GitHub Actions with --artifact github, orun plan:

  1. Derives an execution ID from GITHUB_RUN_ID, GITHUB_RUN_ATTEMPT, and the plan checksum
  2. Writes a plan shard (manifest.json + plan.json + metadata) to a temp directory
  3. Uploads the shard as a GitHub Actions artifact using the embedded @actions/artifact helper
  4. With --github-output, writes matrix, plan_id, and exec_id to $GITHUB_OUTPUT for downstream matrix jobs

Example:

orun plan \
--from-ci github \
--event-file "$GITHUB_EVENT_PATH" \
--artifact github \
--github-output

This replaces the need for actions/upload-artifact@v4 and manual jq piping in CI workflows.

Output contract​

The generated plan contains explicit jobs, dependency edges, step phases, labels, and runtime metadata. Read plan schema for the full structure.

Plans stored in .orun/plans/ can be inspected with orun get plans and orun describe plan <id>.

Use --config-dir only when you need to load legacy folder-shaped compositions instead of intent-declared packages.

See context-aware discovery for how orun run and orun get jobs auto-filter by component when run from inside a component directory.