feat: add whoami command#12
Conversation
Add a `hrvst whoami` command that shows the currently authenticated user. It reuses the existing users/me request definition and the shared httpRequest helper, then prints name, email, user id, account id, timezone, and access roles in a table. Pass `-o json` to print the full user object instead. Wire it into the command barrel, the generator's command dictionary, the README reference, the docs, and a --help regression test so it matches the existing commands.
|
@claude Review this PR |
|
Claude finished @kgajera's task in 2m 1s —— View job PR Review: feat: add whoami command
OverviewThe implementation is clean and integrates well with the existing codebase patterns. It reuses Issues1.
Since 2.
describe: "The output format: json, table",The command only has a special case for describe: "The output format (json)",This matches the actual behavior and avoids implying 3.
# Whoami
Display the currently authenticated user:
hrvst whoami hrvst whoami -o json Minor Observations (no action needed)
SummaryGood, idiomatic implementation. The three issues above are minor; the most impactful is the misleading |
| }) | ||
| .version(false); | ||
|
|
||
| export const handler = async (args: WhoamiArguments): Promise<void> => { |
There was a problem hiding this comment.
From within this handler, do you think we could replace the current implementation with a call to the handler from the me command.
Here's an example where we do that for another command and specifying a subset of fields to output: https://github.com/kgajera/hrvst-cli/blob/main/src/commands/stop-timer.ts#L56
Add a
hrvst whoamicommand that shows the currently authenticated user. It reuses the existing users/me request definition and the shared httpRequest helper, then prints name, email, user id, account id, timezone, and access roles in a table. Pass-o jsonto print the full user object instead.Wire it into the command barrel, the generator's command dictionary, the README reference, the docs, and a --help regression test so it matches the existing commands.