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/gh-autostar/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 reposfollowing_starred— Repos starred by people you followtopic_search— Repos matchingTOPIC_SEARCH_TERMSmanual_list— ExplicitMANUAL_REPOSslugs
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gh_autostar-1.0.0.tar.gz.
File metadata
- Download URL: gh_autostar-1.0.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f4ff19346cbde11e7fdc388004b33aa71172fe8e49f9ab6e21e47440b03e744
|
|
| MD5 |
66efc50f8828d7358fd56207d3d8e6a7
|
|
| BLAKE2b-256 |
7b6dd123cbe9c20d3d073ce8cc7eeb59f9246bcb86dfe61bae7d794ac4562377
|
File details
Details for the file gh_autostar-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gh_autostar-1.0.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65f3614245dcee6e646d15be8d55123f90e8fa5fb29fc008f9c902e68a504bf7
|
|
| MD5 |
cbc2663a0b28401654e1c50237917aae
|
|
| BLAKE2b-256 |
e674b730917c9e542915c50c34c1578be4c87b5c4a81cf48129d5f0ce7e58f2b
|