Skip to content

altis-cli --help / --version should work without configuration #47

Description

@mikelittle

bin/altis-cli.js runs the config-load and setup gate inside main() before it parses any arguments (parser.parse(...) is the last thing it does). As a result --help and --version never reach yargs when the CLI is unconfigured:

  • In a non-TTY (CI, scripts, piped output) an unconfigured CLI hits the !config.get('didSetup') branch and calls process.exit(1) — so altis-cli --help fails for anyone who hasn't run setup.
  • In a TTY it prompts "Run initial setup?" instead of showing help.

Spotted when trying to set up a simple asmoke test which failed in CI.

Fix: short-circuit --help / --version (and ideally -h / -v) before the config-load and setup gate, so informational flags work regardless of setup state — standard CLI behaviour. The parser is already built at that point (configure() on line 26), so it can handle these before any config work happens.

Once fixed, the smoke test could optionally go back through bin/altis-cli.js if we want it to cover the entry point too, though the parser-build test is arguably the better release check.


Acceptance Criteria

  • Both altis-cli --help and altis-cli --version work without returning error code 1
  • Test if both work regardless of the configuration state

For Altis Team Use

Ready for Work Checklist

Is this ticket ready to be worked on? See
the Play Book Definition of Ready

  • Is the title clear?
  • Is the description clear and detailed enough?
  • Are acceptance criteria listed?
  • If this is a bug, has a regression test been defined?
  • Have any dependencies been identified? (Optional)
  • Have any documentation/playbook changes been identified? (Optional)
  • Is an estimate or time box assigned?
  • Is a priority label assigned?
  • Is this ticket added to a milestone?
  • Is this ticket added to an epic? (Optional)

Completion Checklist

Is this ticket done? See
the Play Book Definition of Done

  • Has the acceptance criteria been met?
  • Is the documentation updated (including README)?
  • Do any code/documentation changes meet project standards?
  • Are automatic tests in place to verify the fix or new functionality?
    • Or are manual tests documented (at least on this ticket)?
  • Are any Playbook/Handbook pages updated?
  • Has a new module release (patch/minor) been created/scheduled?
  • Have the appropriate backport labels been added to the PR?
  • Is there a roll-out (and roll-back) plan if required?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions