Hack Day 2025
A command-line tool for analyzing GitHub and GitLab repositories.
- Authenticate with GitHub or GitLab using personal access tokens
- List and select repositories from your account
- Interactive command-line interface
- HTTP server with JSON API endpoints
- Support for git-blame and git-log analysis
- Token caching for improved user experience
- Go 1.24 or later
- GitHub or GitLab personal access token
- Clone the repository:
git clone https://github.com/yourusername/repo-analyzer.git
cd repo-analyzer- Build the tool:
go build -o repo-analyzer cmd/cli/main.goRun the tool without any flags to start the interactive mode:
./repo-analyzerYou can also provide the provider and token as flags:
./repo-analyzer --provider github --token your-tokenStart the HTTP server:
./repo-analyzer serverBy default, the server runs on port 8080. You can specify a different port:
./repo-analyzer server --port 3000Returns a list of available prompts with their descriptions and required arguments.
Example response:
[
{
"name": "git-blame",
"description": "Analyzes the blame information for files in a pull request, showing which authors modified which lines.",
"arguments": [
{
"name": "provider",
"description": "The Git provider (github or gitlab)",
"required": true
},
{
"name": "token",
"description": "Personal access token for authentication",
"required": true
},
{
"name": "repository",
"description": "Full repository name in the format owner/repo",
"required": true
},
{
"name": "pullRequest",
"description": "Pull request number",
"required": true
}
]
},
{
"name": "git-log",
"description": "Returns a success response for the specified repository and pull request.",
"arguments": [
{
"name": "provider",
"description": "The Git provider (github or gitlab)",
"required": true
},
{
"name": "token",
"description": "Personal access token for authentication",
"required": true
},
{
"name": "repository",
"description": "Full repository name in the format owner/repo",
"required": true
},
{
"name": "pullRequest",
"description": "Pull request number",
"required": true
}
]
}
]Example using curl:
curl http://localhost:8080/promptsAccepts JSON requests with the following format:
{
"name": "git-blame" | "git-log",
"arguments": {
"provider": "github" | "gitlab",
"token": "your-token",
"repository": "owner/repo",
"pullRequest": 1
}
}Example using curl:
curl -X POST -H "Content-Type: application/json" -d '{
"name": "git-blame",
"arguments": {
"provider": "github",
"token": "your-token",
"repository": "owner/repo",
"pullRequest": 1
}
}' http://localhost:8080/messagesYou can set your tokens as environment variables:
export GITHUB_TOKEN=your-github-token
export GITLAB_TOKEN=your-gitlab-tokenAnalyzes the blame information for files in a pull request, showing which authors modified which lines.
Returns a success response for the specified repository and pull request.
- Go to GitHub Settings > Developer Settings > Personal Access Tokens
- Generate a new token with the
reposcope
- Go to GitLab Settings > Access Tokens
- Generate a new token with the
read_apiscope
MIT