humanmade / humanmade/altis-cli
altis-cli --help / --version should work without configuration
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 7d 9h
- Merged PRs (30d)
- 3
Description
`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](https://playbook.hmn.md/play/product/definition-of-ready/)
- [x] Is the title clear?
- [x] Is the description clear and detailed enough?
- [x] Are acceptance criteria listed?
- [x] If this is a bug, has a regression test been defined?
- [x] Have any dependencies been identified? (Optional)
- [x] Have any documentation/playbook changes been identified? (Optional)
- [x] Is an estimate or time box assigned?
- [x] 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](https://playbook.hmn.md/play/product/definition-of-done-2/)
- [ ] 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?
Contributor guide
No contributing guide indexed for this repository
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.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100