Skip to content

feat: add multi-user profile support#3

Merged
gricha merged 2 commits intomainfrom
feature/multi-user-profiles
Jan 25, 2026
Merged

feat: add multi-user profile support#3
gricha merged 2 commits intomainfrom
feature/multi-user-profiles

Conversation

@gricha
Copy link
Owner

@gricha gricha commented Jan 24, 2026

Summary

  • Add profile-based multi-user support so multiple people can track workouts independently on the same machine
  • Exercises are shared across profiles, while templates/workouts/config are per-user
  • Auto-migrates existing data to 'default' profile on first use

Changes

  • New profile command group: profile list, profile create <name>, profile delete <name>
  • Global --profile <name> flag for all commands
  • Storage class updated to be profile-aware with per-user data isolation
  • Single profile works automatically (backwards compatible)
  • Multiple profiles require explicit --profile flag

Test plan

  • Run bun run validate - all tests pass
  • Test fresh start creates default profile automatically
  • Test creating second profile requires --profile flag
  • Test concurrent sessions work with different profiles
  • Verify data isolation between profiles
  • Test migration from single-user to multi-profile

🤖 Generated with Claude Code

Add profile-based multi-user support so multiple people can track
their workouts independently on the same machine.

- Add profile management module (src/data/profiles.ts) with CRUD operations
- Update Storage class to be profile-aware with per-user data isolation
- Add global --profile flag for explicit profile selection
- Add profile commands: list, create, delete
- Exercises are shared across profiles, templates/workouts/config are per-user
- Auto-migrate existing data to 'default' profile on first use
- Single profile works automatically (backwards compatible)
- Multiple profiles require explicit --profile flag
- Replace imperative loop with declarative some() in hasLegacyData()
- Remove redundant fs.existsSync checks in ensureDir() (mkdirSync recursive is idempotent)
- Extract requireProfileDir() helper to consolidate duplicate checks
- Remove redundant null check in updateExercise()
- Remove redundant profileExists check in delete command
@gricha gricha merged commit 43c45c0 into main Jan 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant