Add multi-profile support for switching between accounts#5
Conversation
Allows users with multiple Krónan accounts (e.g., personal + shared family group) to store and switch between named profiles. New commands: - `kronan token <token> --name <name>` - save a named profile - `kronan profiles` - list saved profiles - `kronan profile <name>` - switch active profile - `kronan profile remove <name>` - remove a profile Profiles stored in ~/.kronan/profiles.json with backward compat for the legacy ~/.kronan/token file.
arnif
left a comment
There was a problem hiding this comment.
Thanks for this great contribution! The multi-profile support is a really useful feature. I've tested it and overall it works well with full backwards compatibility.
One issue to fix before merge:
There's a duplicate 'profile' case label in src/index.ts that causes a lint error. See inline comment on the specific line.
Once that's fixed, this is ready to merge!
|
Inline review note: File: The line: case "me":
case "profile": {creates a duplicate case error because Fix: Change line 542 to just: case "me": {(remove the |
|
@arnif Issue fixed |
arnif
left a comment
There was a problem hiding this comment.
Thanks for the quick fix! All checks pass now:
✅ Lint passes
✅ TypeScript typecheck passes
✅ All 13 tests passing
✅ Backwards compatibility maintained - existing token works
✅ New profile commands work correctly
✅ 'me' command works without duplicate case error
This is a great addition to the CLI. Approving for merge!
|
Ég lét laga þessa format villu bara :) Þetta er komið í nýjustu útgáfu. Takk kærlega fyrir þetta framlag! |
Summary
kronan token <token> --name <name>saves tokens as named profileskronan profileslists all saved profiles with active indicatorkronan profile <name>switches the active profilekronan profile remove <name>removes a profile~/.kronan/tokenfileMotivation
Krónan supports shared customer groups (family/household accounts). Each group has its own access token. This feature lets users store multiple tokens and switch between them without re-entering credentials.
Test plan
kronan token <t1> --name personalandkronan token <t2> --name familykronan profilesshows both with active indicatorkronan profile <name>switches and subsequent commands use the new profilekronan profile remove <name>removes correctlykronan token <t>(without --name) still works, uses identity name as profile name