Skip to content

Allow --config to load a YAML or JSON file path - #111

Open
NickMortimer wants to merge 2 commits into
csiro-fair:mainfrom
NickMortimer:feat/config-yaml-file
Open

Allow --config to load a YAML or JSON file path#111
NickMortimer wants to merge 2 commits into
csiro-fair:mainfrom
NickMortimer:feat/config-yaml-file

Conversation

@NickMortimer

@NickMortimer NickMortimer commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

--config on import, new pipeline, and new collection now accepts a path to a YAML or JSON file in addition to an inline JSON object string. File contents are loaded with yaml.safe_load (JSON is valid YAML). Python is not executed.

Problem

Collection and pipeline configuration that is awkward to quote as inline JSON had to be stuffed into the shell. That is brittle on HPC and encourages copying values into shell history.

Solution

Add parse_cli_config(): if the value is an existing file, load it as YAML/JSON; otherwise parse it as inline JSON as before. Empty input still yields {}.

Impact

Existing inline-JSON scripts keep working. You can pass --config collection.yml. No schema change.

Testing

Unit tests for empty input, inline JSON, YAML/JSON files, missing paths, and malformed YAML. CLI test that marimba new pipeline --config path.yml passes the parsed dict through. 22 passed. Ruff/black clean on the touched files.

Documentation

CHANGELOG Unreleased, docs/cli.md, docs/overview.md.

Breaking Changes

None. Inline JSON remains supported.

Notes to Reviewer

If --config names a path that exists, it is always treated as a file, even if the string also happens to be valid JSON.

Inline JSON objects still work, so existing scripts keep running. File
contents are loaded with yaml.safe_load; Python is not executed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@NickMortimer
NickMortimer requested a review from cjackett as a code owner August 27, 2026 02:27
Nested JSON objects exceed NAME_MAX, and Path.is_file() raises ENAMETOOLONG
on Python 3.12/3.13 instead of returning False, which broke e2e import tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant