CLI overview
mfd is the Mfd command-line tool. You use it to build a mfd.yml, discover the shape of your source data, sync it to a destination, and query the result. Every command reads the same mfd.yml, and the Python mfd.Session runs the same engine, so you can mix the CLI and Python freely.
Check your install
mfd --versionYou see the installed version, for example:
mfd 17.0.0If the command is not found, follow Install.
Commands
| Command | Use it to |
|---|---|
mfd connect | Add a source or destination to mfd.yml without hand-editing YAML. |
mfd discover | Read the source and infer the schema of each namespace. Never writes to the destination. |
mfd schema | Print the columns of Parquet files a pipeline wrote to its local data directory. |
mfd metadata | Show the schema discover saved, or apply a reviewed schema for one namespace. |
mfd migrate | Apply migrations/*.sql ALTER batches: rewrite WAL, destination DDL, then the ALTER log. |
mfd sync | Ingest from the source, buffer through the write-ahead log (WAL), and land data in the destination. |
mfd query | Run SQL against your pipelines (SELECT Iceberg ∪ WAL together, STREAM tails that same SQL), interactively or as JSON for scripts. |
mfd df | Print every row of a pipeline or namespace as JSON. |
mfd serve | Expose your Iceberg tables over Iceberg REST and Flight SQL to tools such as Spark, Trino, and PyIceberg. |
mfd doctor | Check mfd.yml for mistakes before a long sync. Omit --pipeline to check the whole file. |
mfd sql-help | List the SQL statements mfd query supports, or export them to a file. |
mfd benchmark | Generate a synthetic JSON dataset for performance testing. |
Run mfd <command> --help to see every flag for a command.
Global flags
Global flags work with every command. You can put them before or after the command name: mfd --config prod.yml sync and mfd sync --config prod.yml are the same.
| Flag | Default | Description |
|---|---|---|
--config <PATH> | ./mfd.yml | Config file to use. Same as the SKIPPR_CONFIG_FILE environment variable. Without it, Mfd looks in the current directory for mfd.yml, then mfd.yaml. If the path you pass does not exist, Mfd falls back to that search. |
--log [LEVEL] | Off | Print logs to stderr. LEVEL is trace, debug, info, warn, or error; --log on its own means info. Logs are always written to logs/mfd.<date>.log, with or without this flag. |
--wal-storage <MODE> | disk | Where the WAL keeps buffered batches: disk or s3. Same as WAL_STORAGE. See WAL and buffering. |
--wal-s3-bucket <BUCKET> | State bucket | S3 bucket for WAL segments when --wal-storage s3. Same as SKIPPR_WAL_S3_BUCKET. A mfd.wal_s3_bucket value in mfd.yml takes precedence. |
--store-type <TYPE> | fjall | Manifold Store engine is fjall. Leftover sled maps to fjall and is not a live engine choice. Same as SKIPPR_STORE_TYPE. A mfd.store.type value in mfd.yml takes precedence. dynamodb is an error. See Manifold Store. |
--workspace <NAME> | None | Written to mfd.workspace by mfd connect. Other commands ignore it and read mfd.yml. |
--storage-mode <MODE> | None | local or s3. Written to mfd.mfd_el_storage_mode by mfd connect. Other commands ignore it. |
--mfd-s3-bucket <BUCKET> | None | Written to mfd.mfd_s3_bucket by mfd connect. Other commands ignore it. |
--tenant <NAME> | None | Written to mfd.tenant by mfd connect. Other commands ignore it. |
-h, --help | Print help for mfd or any command. | |
-V, --version | Print the version. Top level only. |
Mfd also loads a .env file that sits next to your mfd.yml, so ${NAME} references in the config can resolve from it.
Typical workflow
A pipeline goes from nothing to queryable data in five steps. The example uses the public bike-hire sample and keeps engine state on local disk.
Connect a source. Write the pipeline into
mfd.yml:bashmfd --workspace bikehire --storage-mode local connect data-source s3 \ --pipeline bikehire \ --name sample \ --s3-bucket mfd-public-sample-data \ --s3-prefix bike-hireCheck the config.
bashmfd doctorDiscover the schema. Mfd reads the source and saves the inferred columns for each namespace:
bashmfd discover --pipeline bikehire --output text mfd metadata show --pipeline bikehireSync. Run one pass and exit:
bashmfd sync --pipeline bikehire --once --output textQuery. Tables are named
<pipeline>.<namespace>:bashmfd query --plain --sql "SELECT count(*) FROM bikehire.rides"
The same workflow in Python:
import mfd
session = mfd.Session(mfd.Config.discover().get_pipeline("bikehire"))
print(session.doctor())
session.discover()
session.sync(once=True)
print(session.query("SELECT count(*) FROM bikehire.rides"))mfd doctor
mfd discover --pipeline bikehire
mfd sync --pipeline bikehire --once
mfd query --plain --sql "SELECT count(*) FROM bikehire.rides"Output modes
Pick the output that suits who is reading it:
| Command | Modes | Use for scripts |
|---|---|---|
discover, sync | --output progress (default; a live progress display on a terminal), text, json | --output json prints one JSON event per line. |
doctor | --output text (default), json | --output json |
query | Interactive table view (default), --plain | --plain prints one JSON document: {"header": [...], "rows": [[...]]}. |
df | JSON only | Same shape as query --plain. |
metadata show, metadata apply | JSON only | Always JSON. |
Exit codes
| Code | Meaning |
|---|---|
0 | The command succeeded. |
1 | The command failed: invalid or unreadable config, a missing ${NAME} variable, a failed check, sync, discover, or query. |
2 | The command line was invalid, for example an unknown flag or a missing required flag. |
Some failures are only described in the logs. If a command exits 1 without explaining why, run it again with --log.
