Problem
The current CLI requires users to manually run work auth login after creating a context, even when valid GitHub credentials are already available via GitHub CLI or environment variables. This creates poor user experience and contradicts the documented quick-start workflow.
Root Cause Analysis
Primary Issue: CLI architecture requires explicit work auth login but quick-start documentation didn't mention this step, creating mismatch between expected and actual workflow.
Contributing Factors:
- No automatic authentication in CLI commands
- Poor context state management (circular dependency in auth state)
- Tests mask the issue by explicitly calling
authenticate()
Current Workaround
Added work auth login step to quick-start guide in commit fixing documentation.
Proposed Long-term Solutions
Option 1: Auto-authenticate in CLI Commands (Recommended)
- Modify
engine.listWorkItems() and other operations to call authenticate() automatically when not authenticated
- Only auto-authenticate when credentials are available (GitHub CLI, env vars)
- Fail with helpful error message if no credentials found
Option 2: Auto-authenticate During Context Creation
- Modify
work context add to automatically authenticate when credentials are available
- Set
authState: 'authenticated' immediately if successful
Option 3: Lazy Authentication
- Initialize adapter with authentication on first use
- Cache authentication state properly
Acceptance Criteria
Priority
High - This significantly impacts user onboarding experience and contradicts documented workflows.
Labels
- enhancement
- user-experience
- authentication
- cli
Problem
The current CLI requires users to manually run
work auth loginafter creating a context, even when valid GitHub credentials are already available via GitHub CLI or environment variables. This creates poor user experience and contradicts the documented quick-start workflow.Root Cause Analysis
Primary Issue: CLI architecture requires explicit
work auth loginbut quick-start documentation didn't mention this step, creating mismatch between expected and actual workflow.Contributing Factors:
authenticate()Current Workaround
Added
work auth loginstep to quick-start guide in commit fixing documentation.Proposed Long-term Solutions
Option 1: Auto-authenticate in CLI Commands (Recommended)
engine.listWorkItems()and other operations to callauthenticate()automatically when not authenticatedOption 2: Auto-authenticate During Context Creation
work context addto automatically authenticate when credentials are availableauthState: 'authenticated'immediately if successfulOption 3: Lazy Authentication
Acceptance Criteria
work listimmediately afterwork context addwithout manualwork auth loginwork auth loginworkflow continues to workPriority
High - This significantly impacts user onboarding experience and contradicts documented workflows.
Labels