Skip to main content

YAML-config-driven GitHub repository manager

Project description

Repo Management

Declarative, YAML-driven management of GitHub repository configuration. Describe how a repo should be configured in a YAML file; repo-management reads the live state, shows you the diff, and reconciles it through the GitHub API (via PyGithub).

It is declarative and idempotent: re-running when nothing has changed does nothing. A section you don't mention is left unmanaged; a section you do declare is authoritative — it's the complete desired set, so anything on the repo not listed in it is removed.

Full documentation lives at nivintw.github.io/repo-management; the source code, issue tracker, and annotated example configs live in the nivintw/repo-management repository on GitHub.

Install

uv tool install repo-management    # or: pip install repo-management

Requires Python 3.14+. Authentication uses a GitHub token, read from $GITHUB_TOKEN (or --token). The token needs the scopes for whatever you manage (repo administration, Actions secrets, etc.).

Usage

export GITHUB_TOKEN=ghp_...

repo-management validate  -c repos.yaml   # check the YAML (no network)
repo-management plan      -c repos.yaml   # show the diff (read-only)
repo-management apply     -c repos.yaml   # reconcile (prompts before writing)

See the CLI reference for every command and flag, the config reference for the full config-file schema and every section it manages, and the rulesets reference for branch/tag ruleset details. The repository's examples/ has a fully-worked base.yaml + repos.yaml pair.

Fleet automation

Beyond the CLI, the nivintw/repo-management repository — the tool's home — is itself a working deployment: a control plane that manages its author's repositories with scheduled GitHub Actions, reconciling them to config/*.yml on every push and running a central Renovate instance scoped to exactly that fleet via repo-management list-repos --format names. See Fleet automation in the docs for how the pieces fit together, and .github/workflows/docs.yml's own header comment for the reusable docs-build workflow other fleet repos call.

Development

Clone the repository, then:

uv sync                      # create the venv + install everything
uv run pytest                # tests + coverage (gate: 90%; currently 100%)
uvx prek@0.4.8 run --all-files     # the full quality gate (ruff, format, REUSE, typos, …)

Quality checks run identically locally and in CI via prek hooks: git hygiene, gitleaks, typos, rumdl, SPDX/REUSE headers, and ruff. Conventional Commits (gitmoji) are enforced at commit-msg time. A few hooks shell out to system tools prek can't bootstrap — install them locally too (most are in Homebrew): hawkeye, taplo, osv-scanner.

Publishing to PyPI

Published to PyPI on each GitHub Release via OIDC Trusted Publishing, dress-rehearsed through TestPyPI first. See .github/workflows/publish.yml's header comment for the flow and the one-time environment/Trusted-Publisher setup.

License

MIT — and REUSE-compliant.

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

repo_management-1.8.0.tar.gz (197.6 kB view details)

Uploaded Source

Built Distribution

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

repo_management-1.8.0-py3-none-any.whl (55.2 kB view details)

Uploaded Python 3

File details

Details for the file repo_management-1.8.0.tar.gz.

File metadata

  • Download URL: repo_management-1.8.0.tar.gz
  • Upload date:
  • Size: 197.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for repo_management-1.8.0.tar.gz
Algorithm Hash digest
SHA256 4ed6b2fed0ab60a83ec84508da03d290a1597c11acf857f3cd67896bc3a9c9ea
MD5 edb4a02e1c121c93323b5bd721289985
BLAKE2b-256 d09b569db0bc7eadf99427af18ff74163a66ddaa49797d8a344676d0439a7084

See more details on using hashes here.

File details

Details for the file repo_management-1.8.0-py3-none-any.whl.

File metadata

  • Download URL: repo_management-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 55.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for repo_management-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da37ce5cb6cd905c6e247615914b7cec76381a63c472e87b0d5c940d66f89b2f
MD5 4ed7385c5904af25febcade634092561
BLAKE2b-256 e5eb96fa1b28bcf1efd2b9f270d62d0eed77d3e5ac0d69aa75340054f8831e60

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