
Python CLI that creates GitHub repos with safe defaults — branch protection, Dependabot, secret scanning, and pre-flight security scanning — applied automatically.
Create GitHub repositories with safe defaults applied, in one command.
gh-safe-repo new <owner/repo>
Branch protection, immutable tags, locked-down Actions, Dependabot, secret scanning with push protection, and private vulnerability reporting are all configured before you push your first commit. The same tool audits and fixes repos you already have, and scans local code for secrets before it leaves your machine.
Status: the core workflow is stable and verified end to end, but the CLI is still being polished. Expect occasional breaking changes before 1.0.
push and copyGitHub's defaults favour discoverability over safety: a new repo has no
branch protection, no Dependabot, and Actions that can write to the repo and
approve their own pull requests. gh-safe-repo changes that, and shows you
the plan before it touches anything:
--public to make it public.Every setting is configurable. See Safe defaults for the exact values and Configuration for how to change them.
Requirements:
gh CLI logged in (gh auth login), or
GITHUB_TOKEN set in the environmentuv to install from sourcePATH
or run via podman/docker; without either, a regex scanner is used.Pushing code with push or copy also needs your normal git
credentials for GitHub. See Pushing code.
git clone https://github.com/AriESQ/gh-safe-repo
cd gh-safe-repo
uv tool install .
gh-safe-repo --help
To run without installing:
uv sync
./gh-safe-repo new <owner/repo>
Completion for bash, zsh and fish covers the commands, each command's
options, files after --config and directories for push and scan. The
scripts are generated from the CLI's own argument parser, so they list
exactly the options your installed version accepts. Either load them from
the installed command, which keeps them current across upgrades:
# bash: add to ~/.bashrc
source <(gh-safe-repo --completion bash)
# zsh: add to ~/.zshrc, after compinit
source <(gh-safe-repo --completion zsh)
# fish: add to ~/.config/fish/config.fish
gh-safe-repo --completion fish | source
or copy the pre-generated files in completions/ into each
shell's standard directory (copy them again after upgrading):
# bash (needs the bash-completion package)
cp completions/gh-safe-repo.bash ~/.local/share/bash-completion/completions/gh-safe-repo
# zsh: any directory on $fpath, ahead of compinit
cp completions/_gh-safe-repo ~/.zsh/completions/_gh-safe-repo
# fish
cp completions/gh-safe-repo.fish ~/.config/fish/completions/gh-safe-repo.fish
Completion is registered for the gh-safe-repo command on PATH (as
installed by uv tool install), not for ./gh-safe-repo. --completion
is deliberately left out of --help and out of the completion itself.
For packagers: install the three files from completions/ (in Homebrew,
bash_completion.install "completions/gh-safe-repo.bash" => "gh-safe-repo",
zsh_completion.install "completions/_gh-safe-repo",
fish_completion.install "completions/gh-safe-repo.fish"), or generate them
at build time with generate_completions_from_executable(bin/"gh-safe-repo", shell_parameter_format: "--completion=").
1. Preview. --dry-run makes no API calls and creates nothing.
$ gh-safe-repo new AriESQ/demo-repo --dry-run
Configuring AriESQ/demo-repo...
Planned Changes
Type Category Setting Value / Note
------ ----------------- -------------------------------------- ----------------------------------------------------------------
ADD repo repository AriESQ/demo-repo
DELETE file readme README.md
UPDATE actions allowed_actions 'all' → 'selected'
UPDATE actions verified_allowed False → True
UPDATE actions sha_pinning_required False → True
UPDATE actions default_workflow_permissions 'write' → 'read'
UPDATE actions can_approve_pull_request_reviews True → False
SKIP branch_protection branch_protection Branch protection requires a public repo or paid GitHub plan
SKIP security dependabot_alerts Requires a public repo or paid GitHub plan
SKIP security secret_scanning Requires a public repo or paid GitHub plan
SKIP security dependabot_security_updates Requires a public repo or paid GitHub plan
SKIP security private_vulnerability_reporting Requires a public repo or paid GitHub plan
SKIP security enable_dependency_graph Requires a public repo or paid GitHub plan
SKIP security enable_secret_scanning_push_protection Requires a public repo or paid GitHub plan
SKIP tag_protection tag_protection Tag protection rulesets require a public repo or paid GitHub plan
7 change(s) to apply, 8 skipped
Dry run — no changes made.
The SKIP rows are what a private repo on a free plan looks like. Those
features need a public repo or a paid plan, and the tool says so rather than
failing silently. See GitHub plan limitations.
2. Apply. Drop --dry-run. You see the same plan, then a confirmation
prompt (--yes skips it).
gh-safe-repo new AriESQ/demo-repo
3. Start working. On success you get a Verified section (every setting read back from GitHub) and a banner with ready-to-paste commands:
Scopri gli strumenti più utilizzati dalla nostra community.
Nessun dato di popolarità ancora.