Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - andrewzillow/git-analyzer: Hack Day 2025
Nothing Special   »   [go: up one dir, main page]

Skip to content

andrewzillow/git-analyzer

Repository files navigation

git-analyzer

Hack Day 2025

A command-line tool for analyzing GitHub and GitLab repositories.

Features

  • 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

Prerequisites

  • Go 1.24 or later
  • GitHub or GitLab personal access token

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/repo-analyzer.git
cd repo-analyzer
  1. Build the tool:
go build -o repo-analyzer cmd/cli/main.go

Usage

Command Line Interface

Run the tool without any flags to start the interactive mode:

./repo-analyzer

Using Flags

You can also provide the provider and token as flags:

./repo-analyzer --provider github --token your-token

HTTP Server

Start the HTTP server:

./repo-analyzer server

By default, the server runs on port 8080. You can specify a different port:

./repo-analyzer server --port 3000

API Endpoints

GET /prompts

Returns 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/prompts

POST /messages

Accepts 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/messages

Environment Variables

You can set your tokens as environment variables:

export GITHUB_TOKEN=your-github-token
export GITLAB_TOKEN=your-gitlab-token

Message Types

git-blame

Analyzes the blame information for files in a pull request, showing which authors modified which lines.

git-log

Returns a success response for the specified repository and pull request.

Getting a Personal Access Token

GitHub

  1. Go to GitHub Settings > Developer Settings > Personal Access Tokens
  2. Generate a new token with the repo scope

GitLab

  1. Go to GitLab Settings > Access Tokens
  2. Generate a new token with the read_api scope

License

MIT

About

Hack Day 2025

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0