Redocly/redocly-cli

Support URL in `preview` command

ArtFlag opened this issue · 4 comments

Is your feature request related to a problem? Please describe.

I store my specs on a remote url and I would like to preview them locally but npx -y @redocly/cli preview doesn't seem to take urls, only local paths. I'm getting Unknown argument.

Describe the solution you'd like

I'd like for this command to take URLs. For example, with the pet store API on a gist:

npx -y @redocly/cli preview https://gist.githubusercontent.com/adityamenon/9d43f0a00dd4b49e7af8/raw/a5eb31931dd140e92cda0642948f8dbfe382009a/petstore.yaml

Seems I was using preview instead of preview-docs, which does what I need 👍

Reopening because I think the preview command should accept a URL as well as an input.

@adamaltman could you say more about which URLs should be supported? preview is for running realm locally in develop mode. To preview docs with open source Redoc, the preview-docs command is correct and that does support an OpenAPI file either with a local path or with a remote URL.

preview command should work in the same way as preview-docs and work with a remote URL.