Skip to content

Add whoami command using GET /v3/me - #326

Merged
salmanfarisvp merged 6 commits into
masterfrom
feature/whoami-command
Sep 23, 2026
Merged

salmanfarisvp merged 6 commits into
masterfrom
feature/whoami-command

Conversation

@salmanfarisvp

@salmanfarisvp salmanfarisvp commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds a top-level screenly whoami command that calls GET /v3/me in a single request
  • Displays user email, name, IDs, and workspace details in table, JSON, and CSV output formats
  • Updates CLI help docs and adds unit tests with non-personal fixtures

Local build test

  • Values are redacted
> screenly whoami   

+---------------+-----------------------------+
| Field         | Value                       |
+---------------+-----------------------------+
| Email         | name@screenly.io            |
+---------------+-----------------------------+
| Name          | Salman Faris                |
+---------------+-----------------------------+
| User ID       | xxxxxxxxxxxxxxxxxxxxxxxxxxx |
+---------------+-----------------------------+
| Workspace     | CSS                         |
+---------------+-----------------------------+
| Workspace ID  | xxxxxxxxxxxxxxxxxxxxxxxxxxx |
+---------------+-----------------------------+
| Workspace URL |https://salman.screenlyapp.com|
+---------------+-----------------------------+

Show the authenticated user and workspace from the new me endpoint so users can verify which account the CLI is using.
Copilot AI lite review requested due to automatic review settings September 22, 2026 05:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sergey-borovkov sergey-borovkov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small things inline, nothing blocking.

Comment thread src/commands/whoami.rs Outdated
Comment thread src/commands/whoami.rs Outdated
Comment thread src/commands/whoami.rs Outdated
Use N/A only in table output and empty cells in CSV so missing data is not confused with real values, and cover empty names / missing URL in tests.
Keep a single rows() list so adding or reordering fields cannot drift between output formats.
The mock server test does not touch HOME or the filesystem, so the tempdir setup was dead code.
Copilot AI review requested due to automatic review settings September 22, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

Keep nightly rustfmt check green after the Option-field review changes.
Copilot AI review requested due to automatic review settings September 22, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Keep API error output off stdout for JSON and CSV modes.

Review effort: Lite
Findings: None

Log failed API bodies with debug! like the other HTTP helpers so JSON/CSV output on stdout stays clean.
Copilot AI review requested due to automatic review settings September 22, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

@sergey-borovkov sergey-borovkov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three comments addressed, plus the stdout fix in commands::get. Checked out the branch: 222 tests pass, clippy and cargo fmt --check are clean, and with a bad token stdout is now empty so -o json stays parseable.

@salmanfarisvp
salmanfarisvp merged commit b23528b into master Sep 23, 2026
12 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.

3 participants