Question: Is there a way to get the name of the user, given only their username?

Something like this output `git show <username>` (I know this doesn't work)

```
username: username
name: First Last
email: email@address

```

I know I can do this with a GitHub api call, but would prefer to keep it within the CLI.

Answer: 
*Git itself* (the command line client, i.e. the ["stupid content tracker"](https://git-scm.com/docs/git)) has no notion of user names, only GitHub does. In other words: there is no mapping of GitHub usernames to author/committer names and e-mails stored in a Git repository.

When creating a commit with Git it uses the configuration values of `user.name` (the real name) and `user.email` (email address). Those config values can be overridden on the console by setting and exporting the environment variables `GIT_{COMMITTER,AUTHOR}_{NAME,EMAIL}`.

Git doesn't know anything about GitHub's users, because GitHub is not part of Git. So you're only left with an API call to GitHub (I guess you could do that from the command line with a little scripting and make that a [Git alias](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases).)
Old thread, but since it's still the first hit on Google search, I'll add my two cents. Most answers are technically not correct. As [@knittl](https://stackoverflow.com/a/7552869/226819) indicated: to get the username, you'll have to query the service hosting your code, as git itself has no notion of users. You can configure variables like the `user.name`, but this can be anything and is not necessarily the user creating the commit.

For Github, a way to get the actual username is through their CLI tool [gh](https://github.com/cli/cli). Once downloaded and authenticated, you can issue the following to get the username (using [jq](https://stedolan.github.io/jq/) to retrieve the name):

`gh api 'https://api.github.com/user' | jq .login`