Skip to main content

Commands Overview

gh-templates provides four main subcommands for managing different types of GitHub templates. Each subcommand follows a consistent pattern with add, list, and preview actions.

Main Commands

Issue Templates (issue)

Manage GitHub issue templates to standardize bug reports and feature requests.

gh-templates issue <action> [options] [templates...]

Common Actions:

  • add - Add issue templates to .github/ISSUE_TEMPLATE/
  • list - Show available issue templates
  • preview - Preview template content

Example:

gh-templates issue add rust python --dir templates/

→ Full Issue Documentation


License Templates (license)

Add popular open-source licenses to your repository.

gh-templates license <action> [options] [licenses...]

Common Actions:

  • add - Add license files to your repository
  • list - Show available licenses
  • preview - Preview license text

Example:

gh-templates license add mit apache-2.0 -o LICENSE

→ Full License Documentation


Pull Request Templates (pr)

Create standardized pull request templates for better code review workflows.

gh-templates pr <action> [options] [templates...]

Common Actions:

  • add - Add PR templates to .github/
  • list - Show available PR templates
  • preview - Preview template content

Example:

gh-templates pr add default detailed --force

→ Full PR Documentation


Gitignore Templates (gitignore)

Generate language and framework-specific .gitignore files.

gh-templates gitignore <action> [options] [templates...]

Common Actions:

  • add - Add .gitignore files to repository root
  • list - Show available gitignore templates
  • preview - Preview gitignore content

Example:

gh-templates gitignore add rust node python

→ Full Gitignore Documentation

Universal Options

These options work across all commands:

OptionDescription
--help, -hShow help information
--version, -VDisplay version number
--build-infoShow detailed build information

Common Patterns

List Available Templates

gh-templates issue list
gh-templates license list
gh-templates pr list
gh-templates gitignore list

Preview Before Adding

gh-templates issue preview rust
gh-templates license preview mit
gh-templates pr preview default
gh-templates gitignore preview python

Add Multiple Templates

gh-templates issue add bug feature enhancement
gh-templates gitignore add python javascript docker

Force Overwrite Existing Files

gh-templates license add mit --force
gh-templates pr add default --force

Quick Reference

TaskCommand
Add Rust issue templategh-templates issue add rust
Add MIT licensegh-templates license add mit
Add default PR templategh-templates pr add default
Add Python gitignoregh-templates gitignore add python
Preview any templategh-templates <type> preview <name>
List all templatesgh-templates <type> list
Custom output locationgh-templates <type> add <name> --dir path/
Custom file namegh-templates <type> add <name> -o filename

Getting Help

For detailed help on any command:

# General help
gh-templates --help

# Subcommand help
gh-templates issue --help

# Action-specific help
gh-templates issue add --help