Skip to content

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 status command to profile and resolved a duplicated decorator issue.
  • Detailed Identity Profile: Enriched the Session Status table to fetch and display comprehensive user identity fields including User ID, Email, Gender, Date of Birth, Current Place, Profession, Organisation, and Short Bio.
  • Dynamic Dashboard: Fetches live user stats by calling /api/v1/auth/me and /api/v1/users/{username}/contributions via 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:SS duration format.
  • UI Enhancements: Uses the rich library 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

image image

Edited by Vaishnavi Prabhala

Merge request reports

Loading