Skip to main content

Automated GitHub repository starring with batch processing, scheduling, caching, and advanced filtering

Project description

gh-autostar

Automated GitHub repository starring — batch-star repos on a schedule, run on OS startup, cache everything in SQLite, and filter with precision.


Features

Feature Details
Batch starring Star up to N repos per run with configurable per-request delay
Multiple discovery sources Trending, Explore, Following-starred, Topic search, Manual list
Advanced filtering Stars, forks, language, topics (require-all / any-of), owner exclusions
SQLite cache Discovered repos + current starred-list cached with TTL
Rate-limit aware Tracks remaining API quota; backs off automatically
Background daemon APScheduler-powered, runs every N minutes
OS startup Registers itself via systemd (Linux), launchd (macOS), Task Scheduler (Windows)
Retry logic Tenacity exponential back-off on transient failures
Rich CLI Full-featured Typer CLI with coloured tables and progress

Installation

pip install gh-autostar
# or, for development:
git clone https://github.com/NgoHuuLoc0612/gh-autostar
cd gh-autostar
pip install -e ".[dev]"

Quick start

# 1. Save your GitHub PAT (needs repo + read:user scopes)
gh-autostar auth login

# 2. Run one batch immediately
gh-autostar run

# 3. Start the daemon (runs every 60 min by default)
gh-autostar daemon start

Configuration

All settings can be set via environment variables (GH_AUTOSTAR_*), a .env file (in the platform config dir), or gh-autostar config set.

Variable Default Description
GH_AUTOSTAR_GITHUB_TOKEN (required) GitHub Personal Access Token
GH_AUTOSTAR_BATCH_SIZE 30 Repos to star per batch
GH_AUTOSTAR_BATCH_DELAY_SECONDS 1.5 Delay between star requests
GH_AUTOSTAR_SOURCES trending,following_starred Discovery strategies
GH_AUTOSTAR_LANGUAGES (all) Language whitelist (comma-separated)
GH_AUTOSTAR_MIN_STARS 0 Minimum star count
GH_AUTOSTAR_MAX_STARS (none) Maximum star count
GH_AUTOSTAR_EXCLUDE_FORKS false Skip forked repos
GH_AUTOSTAR_EXCLUDE_ARCHIVED true Skip archived repos
GH_AUTOSTAR_REQUIRE_TOPICS (none) Must have ALL these topics
GH_AUTOSTAR_ANY_TOPICS (none) Must have at least one topic
GH_AUTOSTAR_EXCLUDE_OWNERS (none) Skip these owner logins
GH_AUTOSTAR_TOPIC_SEARCH_TERMS (none) Search terms for topic_search source
GH_AUTOSTAR_MANUAL_REPOS (none) owner/repo slugs to always star
GH_AUTOSTAR_SCHEDULER_INTERVAL_MINUTES 60 Daemon run interval
GH_AUTOSTAR_RUN_ON_STARTUP true Register OS startup entry
GH_AUTOSTAR_CACHE_TTL_HOURS 6 Cache time-to-live
GH_AUTOSTAR_LOG_LEVEL INFO DEBUG / INFO / WARNING / ERROR

Discovery sources

  • trending — GitHub trending repos (star-sorted search heuristic)
  • explore — Popular recently-updated repos
  • following_starred — Repos starred by people you follow
  • topic_search — Repos matching TOPIC_SEARCH_TERMS
  • manual_list — Explicit MANUAL_REPOS slugs

CLI reference

gh-autostar --help

Commands:
  auth      Manage GitHub authentication
    login       Save a GitHub PAT
    logout      Remove the saved token
    whoami      Show authenticated user

  run         Execute one batch run immediately
    --dry-run   Discover but do not star
    --batch-size Override batch size for this run

  status      Rate limits, DB stats, startup status

  star        Star / unstar individual repos
    add <owner/repo ...>
    remove <owner/repo ...>
    check <owner/repo ...>

  history     Browse logs
    runs        Recent batch runs
    starred     Repos that were starred
    failed      Star failures
    all         All records (filterable by --status)

  cache       Manage local cache
    show        List cached repos
    prune       Remove expired entries
    clear       Clear all cache
    vacuum      SQLite VACUUM

  config      Configuration
    show        Print all settings
    set <key> <value>
    path        Print .env file location

  daemon      Background scheduler
    start       Start daemon (blocks in foreground)
    stop        Send SIGTERM to running daemon
    enable-startup   Register OS login entry
    disable-startup  Remove OS login entry
    status      Check startup registration

Programmatic usage

from gh_autostar import GitHubClient, AutoStarEngine, Database
from gh_autostar.config import Settings

settings = Settings(
    github_token="ghp_...",
    batch_size=20,
    sources=["trending", "topic_search"],
    topic_search_terms=["machine-learning", "llm"],
    min_stars=100,
    exclude_archived=True,
    languages=["python", "rust"],
)

db = Database(settings.database_path)

with GitHubClient(token=settings.github_token) as client:
    engine = AutoStarEngine(settings=settings, client=client, db=db)
    result = engine.run_batch()

print(f"Starred: {result.total_starred}")
print(f"Success rate: {result.success_rate:.0%}")

Data storage

All data is stored in an SQLite database at:

  • Linux: ~/.local/share/gh-autostar/autostar.db
  • macOS: ~/Library/Application Support/gh-autostar/autostar.db
  • Windows: %APPDATA%\gh-autostar\autostar.db

Tables: star_records, batch_runs, repo_cache, starred_names_cache, settings_kv


Development

pip install -e ".[dev]"
pytest                          # run all tests
pytest --cov=gh_autostar        # with coverage
ruff check gh_autostar tests    # lint
mypy gh_autostar                # type-check

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gh_autostar-1.0.1.tar.gz (66.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gh_autostar-1.0.1-py3-none-any.whl (68.9 kB view details)

Uploaded Python 3

File details

Details for the file gh_autostar-1.0.1.tar.gz.

File metadata

  • Download URL: gh_autostar-1.0.1.tar.gz
  • Upload date:
  • Size: 66.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for gh_autostar-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9db2916dd60511b4ade0a5598c74e233fdf4501099a78e3893c3efd129535a0d
MD5 5ffeb3e2f62ea6709081f352e213cb4a
BLAKE2b-256 f7dcb2f11a15fb62892cb48a9856e8aa07c9d0d5ea0702f0a9eec065dc5fdbc0

See more details on using hashes here.

File details

Details for the file gh_autostar-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: gh_autostar-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 68.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for gh_autostar-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 092f1a452c89281598b190c5768cea778e6190f8a88a8ae07d4c7c5422c3a4a3
MD5 05809bdf4ddfa14ebb7ac24e01d9595d
BLAKE2b-256 104433dfa3832be66b8b18bbc7300228f701535fb74656cd7c30774076f45e8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page