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

Support for env var parameters #1796

Open
jwilner opened this issue Nov 7, 2024 · 0 comments
Open

Support for env var parameters #1796

jwilner opened this issue Nov 7, 2024 · 0 comments

Comments

@jwilner
Copy link

jwilner commented Nov 7, 2024

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

Currently, the project doesn't support environment variables for parameterizing the CLI's behavior. This can result in frustrating conditional construction of CLI invocations littered through more complex toolchains. For instance, our linting code has to call:

if [[ -n "${GITHUB_ACTIONS-}" ]]; then
    npx @redocly/cli lint --format=github-actions 
else
   npx @redocly/cli lint
fi

Describe the solution you'd like

A standard pattern would be to support prefixed environment variables directly mapping to your CLI args. The CLI arg library this project uses supports this very feature. Thus, a minimal change to your application -- e.g. .env("REDOCLY_CLI") -- would permit easier cross-cutting parameterization for clients like REDOCLY_CLI_OUTPUT_FORMAT=github-actions.

I'm happy to open up this PR if it seems like something the project would welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant