Overview
Implement interactive login, logout, and credential management.
Tasks
Acceptance Criteria
- Full login/logout cycle works against
make dev backend
stackctl whoami shows current user after login
- API key auth works when configured
- Expired token produces a clear error message
Depends On
API Endpoints
| Method |
Path |
Description |
| POST |
/api/v1/auth/login |
{ username, password } → { token } |
| GET |
/api/v1/auth/me |
Current user info |
Overview
Implement interactive login, logout, and credential management.
Tasks
stackctl login— prompt for username/password, callPOST /api/v1/auth/login, store JWTstackctl logout— clear stored token for current contextstackctl whoami— callGET /api/v1/auth/me, display user info~/.stackmanager/tokens/<context>.jsonwith expiry metadata (file perms0600)config set api-key sk_...— skips JWT when presentAcceptance Criteria
make devbackendstackctl whoamishows current user after loginDepends On
API Endpoints
/api/v1/auth/login{ username, password }→{ token }/api/v1/auth/me