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

Open Beginner friendly
#47 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript
Domain
cli

Research direction

Start in bin/altis-cli.js, reading configure() and main() around parser.parse(...), config-load, and the setup gate. Run altis-cli --help and altis-cli --version in an unconfigured non-TTY environment, then verify both flags and their short forms bypass configuration and exit without error code 1.

Written by the indexing model from the issue text.

Description

bug good first issue should have

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?
Dominant language
JavaScript
Stars
0
Forks
2
Avg merge
7d 9h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from humanmade/altis-cli

All issues in humanmade/altis-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.