feat(installer): check Asana auth status and prompt to sign in - #44
Merged
Conversation
CODE-1205: install.sh always printed a static "sign in to Asana" hint regardless of whether credentials were already configured, and never offered to help. Add a local, offline `auth status` CLI subcommand (no network call, unlike `doctor`) and have the installer check it at the end of the run: skip the hint entirely when already signed in, offer to run `auth login` on the spot when interactive and not signed in, and fall back to today's static hint (now with an --oauth mention) when non-interactive. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements CODE-1205: the installer should check auth status and prompt if needed, instead of always printing a static hint regardless of whether the user is already signed in.
auth statusCLI subcommand (src/cli.ts) — local-only, no network call (unlikedoctor, which validates against the live Asana API). Reuses the exact same keychain-read/loadConfiglogic already run at CLI startup. Exit 0 when configured, exit 1 (with the existinginvalid_configurationerror) when not.install.shnow checksauth statusat the end of the run:auth login </dev/ttyif accepted, re-validates, reports the outcome. Reuses the exact[ -t 1 ] && [ -r /dev/tty ]//dev/ttyidiom already used by the existingremove_old_packageprompt.--oauth.README.md: new "Quick setup" section up top, one new installer bullet, and a clarifying edit to the existing "nothing prompts" claim (which is now only true of client selection, not auth).tests/installer.test.tswithauth status/auth loginbranches and aauthConfiguredoption onrunInstaller; added 2 new tests covering the already-configured and non-interactive-not-configured paths. The interactive TTY-prompt-and-login branch is not unit tested — same as the pre-existingremove_old_packageprompt, spawnSync's piped stdio is never a TTY — and should be verified manually in a real terminal before merging.Asana task: https://app.asana.com/1/15793206719/dev/space/1211850000337894/ticket/1218286979008581
Test plan
npx tsc --noEmitnpm run lintnpm test— 382 passing, including 2 new installer testssh -n install.shnpm run check(typecheck + lint + test + build)auth statusagainst this machine's actual keychain state (correctly reportspatconfigured)🤖 Generated with Claude Code