automation

Automate GitHub Repository Creation with a Shell Script

This guide covers a shell script that automates creating and cloning GitHub repositories from templates using the GitHub CLI.

Shipped January 2026

This repository contains a shell script that automates the creation of a new GitHub repository from a specified template and clones it locally. It leverages the GitHub CLI and Git to streamline repository setup.

Features

  • Automates repository creation on GitHub using a predefined template
  • Clones the newly created repository to the local machine
  • Validates required tools (GitHub CLI and Git) are installed
  • Provides error handling for common failure points

Tech Stack

  • Shell scripting (Bash)
  • GitHub CLI (gh)
  • Git

Getting Started

Prerequisites

  • GitHub CLI installed and authenticated
  • Git installed on your system

Installation and Usage

  1. Clone or download this repository.
  2. Make the script executable:
chmod +x gh_create_from_template.sh
  1. Run the script:
./gh_create_from_template.sh
  1. Follow the prompt to enter the new repository name.

The script will create a new public repository on GitHub based on the justin-napolitano/gh_submodule_sync template and then clone it locally.

Project Structure

  • gh_create_from_template.sh: The main shell script that performs repository creation and cloning.
  • README.md: This file.
  • index.md: Documentation with an overview and usage instructions.

Future Work / Roadmap

  • Add support for private repositories and configurable visibility.
  • Parameterize the template repository to allow user selection.
  • Add command-line arguments to bypass interactive prompts.
  • Enhance error handling and logging.
  • Support for additional GitHub repository settings (e.g., topics, descriptions).

Need more context?

Want help adapting this playbook?

Send me the constraints and I'll annotate the relevant docs, share risks I see, and outline the first sprint so the work keeps moving.