Skip to content

fix(cli): allow --help to work without config file#3927

Open
littleKitchen wants to merge 1 commit intoelastic:mainfrom
littleKitchen:fix/help-without-login
Open

fix(cli): allow --help to work without config file#3927
littleKitchen wants to merge 1 commit intoelastic:mainfrom
littleKitchen:fix/help-without-login

Conversation

@littleKitchen
Copy link

Summary

When running connectors <subcommand> --help without first running connectors login, users would see a confusing error about config.yml not being found. This PR fixes that by allowing help to work without authentication.

Changes

  • Skip config loading when help flags (-h/--help) are present in command args
  • Update error message to suggest running connectors login first (clearer guidance)
  • Add tests verifying help works without config file

Testing

  • All 2099 existing tests pass
  • Added 6 new test cases for subcommand help without config

Before

$ connectors job --help
.cli/config.yml was not found. Make sure that the config is either present at the default location...

After

$ connectors job --help
Usage: connectors job [OPTIONS] COMMAND [ARGS]...
  Sync jobs management
Options:
  --help  Show this message and exit.
...

Fixes #3700

The CLI now allows running --help on subcommands (connector, index, job)
without requiring authentication first. Previously, users would see a
confusing error about config.yml not being found.

Changes:
- Skip config loading when help flags (-h/--help) are present
- Update error message to suggest running 'connectors login' first
- Add tests verifying help works without config

Fixes elastic#3700
@littleKitchen littleKitchen requested a review from a team as a code owner January 31, 2026 07:35
@cla-checker-service
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
68835ea

Please, read and sign the above mentioned agreement if you want to contribute to this project

@artem-shelkovnikov
Copy link
Member

Hi @littleKitchen,

Thanks for your contribution! I will test it out, but can you in the meantime sign the Elastic CLA, so that we could proceed with merging this change in?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

connectors login required before connectors <command group> --help, but error message doesn't say so

2 participants