https://github.com/rpothin/gh-template
A GitHub CLI extension to snapshot existing repositories' configuration, enhance the experience of provisioning repositories from templates also applying comprehensive configurations, detect configuration drift and apply remediation.
https://github.com/rpothin/gh-template
developer-experience gh-extension github-cli go repository-template
Last synced: about 9 hours ago
JSON representation
A GitHub CLI extension to snapshot existing repositories' configuration, enhance the experience of provisioning repositories from templates also applying comprehensive configurations, detect configuration drift and apply remediation.
- Host: GitHub
- URL: https://github.com/rpothin/gh-template
- Owner: rpothin
- License: mit
- Created: 2026-05-16T02:41:36.000Z (16 days ago)
- Default Branch: main
- Last Pushed: 2026-05-17T20:38:12.000Z (15 days ago)
- Last Synced: 2026-05-17T20:48:14.839Z (15 days ago)
- Topics: developer-experience, gh-extension, github-cli, go, repository-template
- Language: Go
- Homepage:
- Size: 112 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-gh-extensions - rpothin/gh-template - 05-17 | A GitHub CLI extension to snapshot existing repositories' configuration, enhance the experience of provisioning repositories from templates also applying comprehensive configurations, detect configuration drift and apply remediation. | (🆕 Recently Updated)
README
# gh-template
[](LICENSE)
[](go.mod)
A GitHub CLI extension to snapshot repository configuration, create repositories
from template manifests, audit drift, and sync live repositories back to a known
configuration.
`gh-template` helps individual developers and maintainers avoid ClickOps by
capturing repository settings, topics, GitHub Actions environments, variables,
secrets, Actions permissions, and security settings in `template-metadata.yml`.
## Installation
Prerequisites:
- [GitHub CLI](https://cli.github.com/) authenticated with `gh auth login`
- Git, for installing GitHub CLI extensions
Install the extension:
```sh
gh extension install rpothin/gh-template
gh template --help
```
For source builds and troubleshooting, see [Installation](docs/installation.md).
## Quick start
Capture a repository as a reusable manifest:
```sh
gh template snapshot --repo owner/source-repo --output ./template-metadata.yml
```
Review and customize the manifest, then create a new repository from it:
```sh
gh template create my-new-repo --manifest ./template-metadata.yml
```
Audit or reconcile an existing repository:
```sh
gh template audit --repo owner/target-repo --manifest ./template-metadata.yml
gh template sync --repo owner/target-repo --manifest ./template-metadata.yml
```
See the full walkthrough in [Getting started](docs/getting-started.md).
## Commands
| Command | Description |
|---|---|
| `gh template create ` | Create a repository from a template manifest |
| `gh template snapshot` | Capture a live repository's settings as YAML |
| `gh template audit` | Detect configuration drift between a manifest and live state |
| `gh template sync` | Reconcile a live repository to match a manifest |
| `gh template list` | List template repositories you own, with optional org templates |
| `gh template search [query]` | Search public template repositories on GitHub |
| `gh template fetch` | Fetch a template's recommended manifest locally |
| `gh template explain [field]` | Show descriptions for manifest fields |
| `gh template completion [shell]` | Generate shell completion scripts |
Every command and flag is documented in [Commands](docs/commands.md).
## Manifest
The `template-metadata.yml` manifest is the source of truth for `create`,
`audit`, and `sync`. It supports:
- Repository settings and visibility
- Topics
- GitHub Actions environments, reviewers, branch policies, variables, and secrets
- Repository-level Actions variables and secrets
- Actions workflow permissions
- Dependabot and secret-scanning settings
Read [Manifest reference](docs/manifest-reference.md) for the complete schema,
or run:
```sh
gh template explain --all
```
## Examples
Common workflows and manifest examples are available in [Examples](docs/examples.md).
## Contributing
Issues are used for reproducible bugs. Questions and feature ideas belong in
GitHub Discussions. Please read [Contributing](CONTRIBUTING.md) before opening
an issue or proposing changes.
## License
MIT. See [LICENSE](LICENSE).