Bug Description
When running altis-cli config setup the pop-out auth doesn't occur. You need to run a command to get the auth to pop-out into a browser.
It's also been reported that running altis-cli config reset first is required, then rerunning altis-cli config setup, again, and finally running an arbitrary command seems to force the auth pop-out to happen.
Steps to Reproduce and Code Sample
- Run
altis-cli config setup
- observe nothing happens.
- run
altis-cli config reset
- Run
altis-cli config setup again
- run an arbitrary command
- observe auth pop-out to browser occurs
- success
Expected Behaviour
Running altis-cli config setup should force the popout
Additional Info
Claude Findings:
F1. Root cause. lib/commands/config/setup.js never calls the login flow. It only asks "Reset?" when a token already exists, then writes config.json and prints "Saved configuration!". The OAuth browser flow lives in VantageAPI.authenticate() in lib/vantage.js and only runs on the first API request. That is why stack list opened the browser. Same code in the published 1.0.0-beta.1 (which Goh has, hence the "hm-cli" banner) and in unreleased 1.1.0.
F2. The double "Saved configuration!" Goh saw comes from config reset clearing didSetup, so the next altis-cli config setup runs the first-run wizard (which calls the setup handler) and then runs the setup command again.
Fix (2 files, +24/-12)
- setup.js: after saving, if no token is stored, call authenticate(), wait for the callback, then print "Logged in to Altis Dashboard." Also sets didSetup itself.
- bin/altis-cli.js: skip the first-run wizard when the invoked command is config setup, so reset-then-setup runs login once instead of wizard, login, then a "Reset?" prompt.
Bug Description
When running
altis-cli config setupthe pop-out auth doesn't occur. You need to run a command to get the auth to pop-out into a browser.It's also been reported that running
altis-cli config resetfirst is required, then rerunningaltis-cli config setup, again, and finally running an arbitrary command seems to force the auth pop-out to happen.Steps to Reproduce and Code Sample
altis-cli config setupaltis-cli config resetaltis-cli config setupagainExpected Behaviour
Running
altis-cli config setupshould force the popoutAdditional Info
Claude Findings:
F1. Root cause. lib/commands/config/setup.js never calls the login flow. It only asks "Reset?" when a token already exists, then writes config.json and prints "Saved configuration!". The OAuth browser flow lives in VantageAPI.authenticate() in lib/vantage.js and only runs on the first API request. That is why stack list opened the browser. Same code in the published 1.0.0-beta.1 (which Goh has, hence the "hm-cli" banner) and in unreleased 1.1.0.
F2. The double "Saved configuration!" Goh saw comes from config reset clearing didSetup, so the next altis-cli config setup runs the first-run wizard (which calls the setup handler) and then runs the setup command again.
Fix (2 files, +24/-12)