Summary
All distance formatting in gccli is hardcoded to metric (km). The CLI should respect the user's Garmin Connect display preferences (metric, statute, statute UK) when formatting distances, paces, and weights.
Current behavior
formatDistance() in internal/cmd/activities.go always converts meters to km. This affects all commands that display distances: activities list, activities search, calendar, etc.
Desired behavior
- Fetch user settings from
GET /userprofile-service/userprofile/user-settings/ (has a displayFormat field)
- Format distances as km or miles based on the preference
- Format paces as min/km or min/mi
- Format weights as kg or lbs where applicable
- Support
metric, statute, and statute_uk display formats
- Cache the preference per session to avoid repeated API calls
Scope
formatDistance() — meters → km or mi
formatDuration() / pace formatting — where applicable
- Calendar event details (completion target, goal pace)
- Activity listing, search, details
- Body composition / weight display
- Any other commands that format physical units
Notes
Discovered while implementing the calendar command — the event detail API returns completionTarget with explicit units (meter or kilometer), but the CLI always renders in km regardless of user preference.
Summary
All distance formatting in gccli is hardcoded to metric (km). The CLI should respect the user's Garmin Connect display preferences (metric, statute, statute UK) when formatting distances, paces, and weights.
Current behavior
formatDistance()ininternal/cmd/activities.goalways converts meters to km. This affects all commands that display distances:activities list,activities search,calendar, etc.Desired behavior
GET /userprofile-service/userprofile/user-settings/(has adisplayFormatfield)metric,statute, andstatute_ukdisplay formatsScope
formatDistance()— meters → km or miformatDuration()/ pace formatting — where applicableNotes
Discovered while implementing the
calendarcommand — the event detail API returnscompletionTargetwith explicit units (meterorkilometer), but the CLI always renders in km regardless of user preference.