Skip to content

feat: whoami: updated whoami to show the path to the config if that is what is being used#84

Open
kevkevinpal wants to merge 3 commits intoresend:mainfrom
kevkevinpal:addConfigPathToWhoAmI
Open

feat: whoami: updated whoami to show the path to the config if that is what is being used#84
kevkevinpal wants to merge 3 commits intoresend:mainfrom
kevkevinpal:addConfigPathToWhoAmI

Conversation

@kevkevinpal
Copy link
Contributor

@kevkevinpal kevkevinpal commented Mar 13, 2026

Summary

I wanted a way to know where my config/api keys were stored other than on login/logout. So I added a new output to whoami to show the config path if we are using a config.

Example

$ pnpm dev whoami --json

> resend-cli@1.4.1 dev /mnt/shared_drive/DEVDIR/resend-cli
> tsx src/cli.ts whoami --json

{
  "authenticated": true,
  "profile": "default",
  "api_key": "re_...JMBH",
  "source": "config",
  "config_path": "/home/kevkevin/.config/resend/credentials.json"
}

With no --json

$ pnpm dev whoami

> resend-cli@1.4.1 dev /mnt/shared_drive/DEVDIR/resend-cli
> tsx src/cli.ts whoami


  Profile: default
  API Key: re_...JMBH
  Source:  config file
  Config:  /home/kevkevin/.config/resend/credentials.json

Summary by cubic

Updated whoami to show the full path to the credentials file when the API key comes from config. This makes it easy to find where keys are stored.

  • New Features
    • Adds config_path in JSON output and a "Config:" line in standard output when the source is config, showing the full path to credentials.json from getConfigDir.

Written for commit f8cacb2. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@kevkevinpal kevkevinpal force-pushed the addConfigPathToWhoAmI branch from 3dcb707 to c0bdae3 Compare March 13, 2026 19:11
@kevkevinpal kevkevinpal force-pushed the addConfigPathToWhoAmI branch from c0bdae3 to 7e73419 Compare March 13, 2026 23:54
@felipefreitag
Copy link
Contributor

Thanks for this contribution!

Since this was opened, we've landed secure credential storage (#97), which stores API keys in the OS keychain (macOS Keychain, Linux secret-service, Windows Credential Manager) rather than in credentials.json. With that change, pointing users to the credentials file wouldn't be accurate for keychain users.
With that in mind, do you feel the need for the path to the file?

@kevkevinpal
Copy link
Contributor Author

Since this was opened, we've landed secure credential storage (#97), which stores API keys in the OS keychain (macOS Keychain, Linux secret-service, Windows Credential Manager) rather than in credentials.json.

Awesome, that looks like a significant improvement.

With that change, pointing users to the credentials file wouldn't be accurate for keychain users. With that in mind, do you feel the need for the path to the file?

Is there a chance that it can be still saved to a credentials.json file? I think just in that case we should show it. If there is no chance of that happening then we can close this PR.

@felipefreitag
Copy link
Contributor

Since this was opened, we've landed secure credential storage (#97), which stores API keys in the OS keychain (macOS Keychain, Linux secret-service, Windows Credential Manager) rather than in credentials.json.

Awesome, that looks like a significant improvement.

With that change, pointing users to the credentials file wouldn't be accurate for keychain users. With that in mind, do you feel the need for the path to the file?

Is there a chance that it can be still saved to a credentials.json file? I think just in that case we should show it. If there is no chance of that happening then we can close this PR.

We still use the config file for storing profiles, and it's possible for users to choose insecure storage manually

@kevkevinpal
Copy link
Contributor Author

We still use the config file for storing profiles, and it's possible for users to choose insecure storage manually

I think it then makes sense to still display this in those cases where the config is used

@kevkevinpal kevkevinpal changed the title whoami: updated whoami to show the path to the config if that is what is being used feat: whoami: updated whoami to show the path to the config if that is what is being used Mar 17, 2026
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.

2 participants