Add Issue Templates
Add one or more Issue templates to the repository.
Usage
gh-templates issue add [OPTIONS] [TEMPLATE]...
Arguments
| Argument | Description |
|---|---|
[TEMPLATE]... | Template names to add (e.g., rust, python, global/windows) |
Options
| Option | Description |
|---|---|
--dir <DIR> | Directory to save the issue templates |
--force | Force overwrite existing issue template files |
--all | Download all available templates |
-o, --output <OUTPUT>... | Output file names for the templates (in order of templates) |
-h, --help | Print help |
Examples
Add a Single Template
gh-templates issue add bug
Downloads the bug issue template and saves it to .github/ISSUE_TEMPLATE/.
Add Multiple Templates
gh-templates issue add bug feature enhancement
Downloads multiple templates in one command.
Custom Output Directory
gh-templates issue add rust --dir templates/issues/
Saves the template to a custom directory.
Custom File Names
gh-templates issue add bug feature -o bug_report.md -o feature_request.md
Specify custom output file names for each template.
Force Overwrite
gh-templates issue add rust --force
Overwrites existing template files without prompting.
Add All Templates
gh-templates issue add --all
Downloads all available issue templates.
Complex Example
gh-templates issue add bug feature --dir .github/ISSUE_TEMPLATE/ --force -o bug_report.md -o feature_request.md
This command:
- Adds Bug and Feature templates
- Saves to
.github/ISSUE_TEMPLATE/ - Forces overwrite of existing files
- Uses custom output file names
Default Behavior
- Output Directory:
.github/ISSUE_TEMPLATE/ - File Names: Based on template names (e.g.
bug.md) - Overwrite: Prompts before overwriting existing files (unless
--forceis used)
Tips
- Preview First: Use
gh-templates issue preview <template>to see the content before adding. - Organize Templates: Use the
--diroption to organize templates in custom directories. - Batch Operations: Add multiple related templates in a single command.
- Backup Existing: Consider backing up existing templates before using
--force.