Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: provide help for adaptor functions #31

Closed
josephjclark opened this issue Oct 7, 2022 · 0 comments · Fixed by #114
Closed

CLI: provide help for adaptor functions #31

josephjclark opened this issue Oct 7, 2022 · 0 comments · Fixed by #114
Labels
enhancement New feature or request

Comments

@josephjclark
Copy link
Collaborator

User story

A great idea presented by Mtuchi, which I really like, is to be able to use @openfn/cli to get help about adaptor functions.

Something like this:

openfn -a language-http -h get

Details

This is basically modelled on iex -h which reports help information about elixir functions.

An ideal solution would be to:

  • Print a one-sentence description of the function, the signature and an example
  • Also print a hyperlink to online documentation

Implementation notes

We need to work out the format of the help question. You have to input the adaptor name and a function - so is that @openfn/language-http.get or language-http/get or even -a language-http -h get.

That last one is the most consistent, because it uses a standard command to input an adaptor (which can accept an inline path to a local package), and a simple help command which takes a function name and nothing more.

When we move all the adaptors into the monorepo, we'll be streamlining all the help docs and making sure they'er in one place with predictable URLs. So generating a printing a URL to the help docs is pretty easy.

What about the help itself? The CLI needs to intelligence to look in the adaptor's package, read the type definition for the required function (either straight from the dts or from the ast.json), and massage it into a nice, standard format for the CLI.

Because we want to optmise the formatting for the CLI we want to read fairly low level data and generate output, rather than just dumping an existing string (or even HTML string)

@josephjclark josephjclark added the enhancement New feature or request label Oct 7, 2022
@josephjclark josephjclark changed the title CLI: report or link to help for adaptor functions CLI: provide help for adaptor functions Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant