Dump contextual information to aid debugging.
Dump contextual information about the current environment, repository, and configuration to aid debugging.
ghup debug [flags]
The debug
command provides detailed information about the current ghup
configuration, environment, and repository context. This is useful for troubleshooting issues with the tool or understanding the environment in which it's running.
The command displays information such as:
- Repository details
- Current branch and commit
- Authentication status
- Commit message and trailers that would be used
- Local repository status
This command is particularly helpful when:
- Diagnosing issues with authentication
- Confirming environment variables are being picked up correctly
- Verifying the correct repository is being targeted
- Testing commit message formatting before making actual commits
-b, --branch string target branch name
-m, --message string commit message (default "Commit via API")
--user-trailer string key for commit author trailer (blank to disable) (default "Co-Authored-By")
--user-name string name for commit author trailer
--user-email string email for commit author trailer
--trailer stringToString extra key=value commit trailers
-h, --help help for debug
# Show basic debug information
ghup debug
# Show debug information for a specific branch
ghup debug -b feature-branch
# Preview commit message formatting
ghup debug -m "Testing commit message" --trailer "Reviewed-By=Jane Doe"
The command returns a JSON (or YAML) object with the following structure:
{
"remote": {
"owner": "example-org",
"name": "example-repo"
},
"has_token": true,
"branch": "main",
"commit": "current-head-commit-sha",
"clean": true,
"message": {
"headline": "Testing commit message",
"body": ""
},
"trailers": [
"Co-Authored-By: Jane Doe <[email protected]>",
"Reviewed-By: Jane Doe"
]
}
remote
: Information about the target repositoryhas_token
: Whether a GitHub token is availablebranch
: The current or specified branchcommit
: The current HEAD commit SHA (if in a git repository)clean
: Whether the working directory is clean (no uncommitted changes)message
: The formatted commit message that would be usedtrailers
: The commit trailers that would be included
If an error occurs, the output will include an error message explaining the issue.