Skip to content

feat(installer): check Asana auth status and prompt to sign in - #44

Merged
uladzislauyermalayeu merged 1 commit into
mainfrom
feat/installer-auth-check
Sep 9, 2026
Merged

feat(installer): check Asana auth status and prompt to sign in#44
uladzislauyermalayeu merged 1 commit into
mainfrom
feat/installer-auth-check

Conversation

@antonisobkowicz-asana

@antonisobkowicz-asana antonisobkowicz-asana commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

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.

  • Add a new auth status CLI subcommand (src/cli.ts) — local-only, no network call (unlike doctor, which validates against the live Asana API). Reuses the exact same keychain-read/loadConfig logic already run at CLI startup. Exit 0 when configured, exit 1 (with the existing invalid_configuration error) when not.
  • install.sh now checks auth status at the end of the run:
    • already configured → prints one line, no prompt.
    • not configured + interactive (TTY) → prompts to sign in now (default yes), runs auth login </dev/tty if accepted, re-validates, reports the outcome. Reuses the exact [ -t 1 ] && [ -r /dev/tty ] / /dev/tty idiom already used by the existing remove_old_package prompt.
    • not configured + non-interactive → falls back to today's static hint, now also mentioning --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: extended the fake CLI stub in tests/installer.test.ts with auth status/auth login branches and a authConfigured option on runInstaller; 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-existing remove_old_package prompt, 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 --noEmit
  • npm run lint
  • npm test — 382 passing, including 2 new installer tests
  • sh -n install.sh
  • npm run check (typecheck + lint + test + build)
  • Sanity-checked the real built CLI's auth status against this machine's actual keychain state (correctly reports pat configured)
  • Manual: run the real installer in an actual terminal with no stored credentials to confirm the interactive prompt appears and completes correctly (not done here — would touch this machine's real Claude Desktop/Code/Cursor config and keychain)

🤖 Generated with Claude Code

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>
@command-by-asana

Copy link
Copy Markdown

@uladzislauyermalayeu uladzislauyermalayeu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@uladzislauyermalayeu
uladzislauyermalayeu merged commit f2a3592 into main Sep 9, 2026
3 checks passed
@uladzislauyermalayeu
uladzislauyermalayeu deleted the feat/installer-auth-check branch September 9, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants