Skip to content

CLI: should paths be relative to working dir, or to the workflow? #1232

@josephjclark

Description

@josephjclark

When running a command in the CLI, usually I'd expect all relative paths to be relative to the user's working dir

But when running a workflow, I wonder if all paths should be relative to that workflow

In particular when I pass a workflow name without a path - which I can do from the top level of a workspace - if I also want to reference some state or an output path, my paths might get very long

openfn my-worklow -o workflows/my-workflow/tmp/output.json

When really I probanly just want this:

openfn my-workflow -o tmp/output.json

This sort of means that the working dir is the workflow dir, not the actual working dir. Which is a bit wierd but very useful like this.

Obviously absolute paths or home paths would resolve properly.

The other way we might do this is use a special character in path strings to mean "the execution target folder". So $/tmp/output.json would resolve to workflows/my-workflow/tmp/output.json

That's probably better because it means that CLI behaviour is usually more like you'd expect from a CLI relative to the working dir), but we provide convenient shortcuts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    DevX Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions