feat: upgrade status command to profile command which shows live stats
Overview
This MR transforms the CLI from a static credential checker into a real-time activity and identity dashboard by querying live user statistics, fetching detailed user identity profiles, renaming the command to profile, and improving output privacy.
What Does This MR Do?
-
Command Update: Renamed the
statuscommand to profile and resolved a duplicated decorator issue. -
Detailed Identity Profile: Enriched the
Session Statustable to fetch and display comprehensive user identity fields includingUser ID,Email,Gender,Date of Birth,Current Place,Profession,Organisation, andShort Bio. -
Dynamic Dashboard: Fetches live user stats by calling
/api/v1/auth/meand/api/v1/users/{username}/contributionsvia the active environment URL. -
Data Parsing & Formatting: Automatically parses JSON arrays to accurately count audio, video, text, document, and image contributions. Raw seconds are cleanly converted into an
HH:MM:SSduration format. -
UI Enhancements: Uses the
richlibrary to render a color-coded terminal interface (Magenta/Cyan) clearly separating identity data from activity metrics. - Privacy Refinement: Explicitly removed the user's phone number from the CLI terminal output to ensure cleaner, secure logs for volunteers.
Why Are These Changes Necessary?
- Immediate Feedback & Transparency: Contributors previously couldn't view their upload counts, tracked hours, or detailed identity information inside the CLI.
- Parity with Web: Brings the CLI experience closer to the web dashboard, letting volunteers track their impact easily without switching context.
-
Dynamic Environment Support: By relying on
state.get_auth()variables instead of hardcoded URLs, the CLI safely adapts to whichever environment (development or production) the user is currently using.
Type of Change
-
New Feature (Live dashboard integration) -
CLI Command Update (Renamed to profile) -
UI/UX Improvement -
Code Refactoring & Cleanup
Edited by Vaishnavi Prabhala

