OpenFn / OpenFn/kit

CLI: ensure consistent path handling

Open
#1,049 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DevX
Dominant language
TypeScript
Stars
21
Forks
23
Avg merge
1d 22h
Merged PRs (30d)
17

Description

The CLI needs a single helper util function which will resolve paths in a consistent way.

When the user says openfn job.js, what is job.js relative to? The current working dir of course. But any path resolution needs to be consistent about that. We also need to support stuff like /job.js and ~./job.js.

It's not super hard to do this, and most of the CLI does it in a consistent way. It's what baseDir is sort of supposed to sort out.

But there isn't a single helper function. Ideally users contributing new commands can just do resolvePath(options, path) and getCommandRoot() or something, and we have a single function which works it all out without needing much thought

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the CLI's existing path-resolution logic and how baseDir is used across commands. Identify the current working directory, absolute-path, and home-path cases, then centralize them in one helper such as resolvePath(options, path) so new commands can use consistent behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.