A Go application built with Cobra CLI that tracks stargazers for your GitHub repositories over time. It helps you monitor the growth and changes in your repository's stargazers.
- Track stargazers for all your GitHub repositories
- Store historical stargazer data in SQLite database
- Identify new and lost stargazers between runs
- Simple configuration with environment variables
- Lightweight and fast execution
- Modern CLI interface with subcommands
- Easy to extend with new commands
- Go 1.25 or higher
- GitHub Personal Access Token with
public_reposcope - Git
-
Clone the repository:
git clone https://github.com/dbunt1tled/github-stargazers.git cd github-stargazers -
Build the application:
go build -o github-stargazers ./cmd/main.go
go install github.com/dbunt1tled/github-stargazers/cmd/github-stargazers@latest-
Copy the example environment file:
cp .env.example .env
-
Edit the
.envfile with your GitHub credentials:GITHUB_USERNAME="your-github-username" GITHUB_TOKEN="your-github-token" DATABASE_PATH="./data.db"
Fetch and track stargazers for all your repositories:
./github-stargazers stargazersThis command will:
- Fetch all repositories for the specified GitHub user
- Get current stargazers for each repository
- Store the data in the SQLite database
- Show new and lost stargazers compared to the previous run
List users who have unstarred your repositories:
./github-stargazers unstarGet help about any command:
./github-stargazers helpOr for a specific command:
./github-stargazers help stargazers
./github-stargazers help unstar.
├── cmd/
│ └── main.go # Main application entry point
├── internal/
│ ├── cli/ # CLI command implementations using Cobra
│ │ ├── root.go # Root command and command setup
│ │ ├── stat.go # Stargazers statistics command
│ │ └── unstargazer.go # Unstargazer tracking command
│ ├── config/ # Configuration management
│ ├── db/ # Database operations
│ └── github/ # GitHub API client
├── .env.example # Example environment variables
├── go.mod # Go module definition
└── go.sum # Go module checksums
go build -o github-stargazers ./cmd/main.go./github-stargazersGITHUB_USERNAME=your-username GITHUB_TOKEN=your-token ./github-stargazersContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.