Skip to content

helix export

Export a flow project in one of three formats: a bundled YAML (every imports: and ${file:...} resolved into one self-contained file), a .env template enumerating every ${VAR} referenced, or a multi-stage Dockerfile that builds and runs the project.

Usage

helix export <file> [--format=yaml|env|docker] [--output=PATH]

Flags

Flag Default Description
--format=FMT docker Output format: yaml (alias bundle), env, or docker.
--output=PATH stdout Write to PATH instead of stdout.

The first non-flag argument is the flow file.

Formats

--format=docker

Emits a multi-stage Dockerfile that builds the Helix binary from source and ships an image containing just /helix and /flow.yaml. Exposes ports 8080 (http-server), 8081 (health), and 9090 (metrics/management). The COPY line names the flow file by its basename, so the generated Dockerfile expects to be built from the project root.

--format=yaml (alias bundle)

Loads the flow with dsl.LoadYAMLFull, which resolves every imports: and ${file:...} include, then re-marshals the resolved graph as a single YAML document. The output preserves the original helix: config, declared connectors, agents, and workflows, but flattens the imports tree so the result is portable.

Prints Exported bundle to PATH (N bytes, M routes) on success when writing to a file.

--format=env

Scans the flow file and every glob-resolved imports: target for ${VAR} and ${VAR:-default} references, deduplicates them, and emits a sorted .env template. Defaults are recorded as # Default: <value> comment lines above the key. Two reserved namespaces are filtered out: ${file:...} (path includes) and ${include:...}.

Behavior notes

  • Requires $HELIX_LICENSE. Verified at process start.
  • Unknown formats fail with unsupported export format %q (supported: yaml, env, docker).
  • The Dockerfile output embeds # Generated by Helix v<version>. The bundled YAML embeds a header naming the source file and a timestamp.

Examples

Generate a Dockerfile to stdout (default):

helix export app.yaml

Generate a Dockerfile to disk:

helix export app.yaml --format=docker --output=Dockerfile

Bundle every import into a single deployable YAML:

helix export app.yaml --format=yaml --output=app.bundle.yaml

Extract the env template (sorted, deduplicated):

helix export app.yaml --format=env --output=.env.example

Source

cmd/helix/main.go lines 2287-2363 (cmdExport), 2367-2422 (exportBundle), 2426-2500 (exportEnvTemplate).

See also