Different pipes. One standard.

Type to search this site.

Search runs in your browser against a static index built with this site (Pagefind). Nothing you type is sent to a server.

openflange CLI: Available — v0.0.1 (experimental)

CLI reference

One binary, openflange, that validates, runs, serves and tests pipes and pipelines on your machine. No server, no account.

Release v0.0.1, experimental

Install with go install github.com/openflange/openflange-go/cmd/openflange@v0.0.1 (requires Go); binaries and a Homebrew formula are planned. openflange help <command> is the reference for every flag, and docs/cli.md in the repository documents what scripts may rely on.

Commands

CommandWhat it does
openflange search <query>Find pipes in the configured registry index.
openflange inspect <pipe>Show a pipe’s contract: ports, parameters, implementation, permissions.
openflange validate <pipe|pipeline> [--plan] [--json]Check a manifest or a pipeline without running it. --plan prints the execution plan.
openflange resolveResolve every reference and create or complete openflange.lock.yaml.
openflange update [ref]Re-resolve all references, or one, and update the lockfile.
openflange run <pipe|pipeline> [--locked] [--input name=path|-] [--output name=path|-] [--param k=v] [--grant ...] [--trusted] [--report path|-]Execute. The sole input is bound to stdin and the sole output to stdout by default.
openflange serve <pipe|pipeline|dir> [--addr 127.0.0.1:8080] [--token ...]Expose pipes over the HTTP Pipe Protocol. Loopback by default; a non-loopback address needs a token.
openflange test <pipe|dir>Run the portable tests beside a manifest.
openflange init [dir]Scaffold a new, working pipe in dir (default: the current directory): a manifest with a Starlark expression and a test file. Existing files are never overwritten.
openflange version [--capabilities] [--json]Print the version. --capabilities lists the supported specification versions, adapters and languages, standard pipes and features.
openflange completion bash|zsh|fishPrint a shell completion script.
openflange help <command>Show help for a command: flags and examples.

The table gives the syntax of the CLI specification plus the commands the implementation adds. The implementation accepts a little more — for example validate without a target checks the current directory, and run binds the only required port to stdin or stdout. Every reporting command accepts --json.

A complete run

From a clone of the repository:

Input (stdin)
"Alice@Example.COM"
Command
printf '"Alice@Example.COM"\n' | openflange run ./examples/email/normalize-and-mask-email
Output (stdout)
"a***e@example.com"

With more than one input or output, name them. - means stdin or stdout. With in.ndjson holding "Alice@Example.COM" and "BOB@example.org":

bash
openflange run ./examples/email/normalize-and-mask-email-branching \
  --input email=in.ndjson \
  --output masked=- \
  --output normalized=norm.ndjson \
  --report report.json
# stdout (masked):
# "a***e@example.com"
# "b*b@example.org"
# norm.ndjson:
# "alice@example.com"
# "bob@example.org"

Diagnostics go to stderr and never into a data stream. --report writes a JSON run report: state, duration, and record and byte counts per port. Parameters are set with --param:

bash
openflange run ./examples/email/normalize-and-mask-email --param character=# < in.ndjson
# "a###e@example.com"
# "b#b@example.org"

Output contract

  • stdout carries data only: the records of a run, or the one JSON document of a reporting command given --json. Diagnostics, progress and summaries go to stderr.
  • Colour and the live status line appear only on a terminal. NO_COLOR or --no-color disables them; --quiet prints errors only.
  • Piped output is plain, one finding per line, and starts with the error code:
text
E_PARAM: unknown parameter "charcter" (pipeline.yaml:13:7, at nodes.mask.parameters.charcter)

Exit codes

CodeMeaning
0Success.
1A run failed or was cancelled, or a test failed.
2Usage or validation error. Nothing was executed.

Choosing a registry

Registry references such as openflange/lowercase are resolved through an index file. Point the CLI at any index, local or remote:

bash
openflange search email --registry ./registry/dist/index.json
OPENFLANGE_REGISTRY=https://registry.example.com/index.json openflange search email

The default public index is not live

The default is https://openflange.com/index.json, which is not published yet. A local path or your own URL works without it; no central registry is required.

Permissions

A pipe that starts a subprocess, opens a network connection or reads a secret declares it. Nothing is granted by default. Grant per node in pipeline.yaml (grants:), or for a whole run with --grant. --trusted grants everything the pipes declare and prints that restrictions are not sandbox-enforced. See Permissions.

What your program sees

If your pipe is a program, this is the entire protocol for the simple case:

  • One input arrives on stdin, one output leaves on stdout, one JSON value per line.
  • stderr is for diagnostics. Exit 0 for success, anything else for failure.
  • Parameters arrive as environment variables named OPENFLANGE_PARAM_<UPPER_SNAKE_NAME>.

With more ports, the path in OPENFLANGE_CONFIG points to a JSON file listing each port and a local endpoint for the extra ones. Your program GETs extra inputs and POSTs extra outputs. See the multi-port example.

Performance

The CLI starts in under 20 ms, and a test streams a million records through a three-step pipeline with bounded memory. Measured as single runs on a shared virtual machine (AMD EPYC 9655P, 8 virtual CPUs, 16 GB RAM, Linux 6.12); the method, the variance and the remaining costs are in docs/performance.md.

Batch mode for executable and Starlark pipes is in v0.0.1 and experimental: a pipe declares batch: {maxItems, maxWaitMs} and receives several records per call. See the batch mode concept.

What the CLI is not

It runs pipelines. It does not manage databases, schedule jobs or keep a history of runs. Call it from the scheduler you already have.