https://github.com/thumbrise/ghset
ghset init my-repo --from your-repo — declarative GitHub repository settings as YAML
https://github.com/thumbrise/ghset
cli declarative devops github github-api github-settings golang repository-management yaml
Last synced: 29 days ago
JSON representation
ghset init my-repo --from your-repo — declarative GitHub repository settings as YAML
- Host: GitHub
- URL: https://github.com/thumbrise/ghset
- Owner: thumbrise
- License: apache-2.0
- Created: 2026-04-05T17:34:25.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-04-14T08:08:24.000Z (about 1 month ago)
- Last Synced: 2026-04-14T08:08:49.981Z (about 1 month ago)
- Topics: cli, declarative, devops, github, github-api, github-settings, golang, repository-management, yaml
- Language: Go
- Homepage: https://thumbrise.github.io/ghset/
- Size: 902 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ghset
[](https://github.com/thumbrise/ghset/actions/workflows/ci.yml)
[](https://pkg.go.dev/github.com/thumbrise/ghset)
[](/LICENSE)
Declarative GitHub repository settings. Describe an existing repo into YAML, spin up a new repo from that YAML.
## Why
Every new GitHub repo starts with the same ritual: click through settings, toggle security options, recreate labels, set up branch protection. Multiply that by 10 repos and it's a whole afternoon. **ghset** turns all of that into one command.
## Quick start
Prerequisites: [gh CLI](https://cli.github.com/) installed and authenticated (`gh auth login`).
### Install
**macOS / Linux**
```bash
curl -sfL https://raw.githubusercontent.com/thumbrise/ghset/main/install.sh | sh
```
**Go**
```bash
go install github.com/thumbrise/ghset@latest
```
**Manual** — grab a binary from [Releases](https://github.com/thumbrise/ghset/releases/latest).
### Run
```bash
ghset init my-new-repo --from thumbrise/ghset
```
That's it. The new repo gets everything copied:
- **Settings** — visibility, merge strategies, wiki, issues, projects, discussions
- **Security** — secret scanning, push protection, vulnerability alerts, automated fixes
- **Labels** — create custom, skip existing
- **Rulesets** — branch and tag protection rules
## Commands
```bash
# Snapshot repo settings → YAML
ghset describe thumbrise/ghset > config.yml
# Create new repo from config
ghset init my-new-repo --from config.yml
# Or directly from another repo — no intermediate file
ghset init my-new-repo --from thumbrise/ghset
# Apply config to an existing repo
ghset apply thumbrise/ghset --from config.yml
# Pipe — describe one, create another
ghset describe thumbrise/ghset | ghset init my-new-repo
```
| Command | What it does |
|---------|-------------|
| `describe` | Snapshot repo → YAML to stdout |
| `init` | Create new repo + apply settings |
| `apply` | Apply settings to existing repo |
## How it works
All GitHub API calls go through `gh` CLI as a subprocess. No tokens in the tool, no OAuth — `gh` handles auth entirely.
## Docs & rationale
**[thumbrise.github.io/ghset](https://thumbrise.github.io/ghset/)** — full docs, [why not Terraform / Probot / safe-settings](https://thumbrise.github.io/ghset/why), devlog.
## License
Apache 2.0