GH-REPO-AUTOLINK-CREATE(1)
π gh-repo-autolink-create(1) β the GitHub CLI manual, bestie edition π
okay so picture this: you're deep in the gh manual, section 1, and you've stumbled onto gh-repo-autolink-create. yes bestie, it's a real page in the GitHub CLI manual and it's about to make your repo way more connected. let's get into it β¨
β¨ NAME β¨
gh-repo-autolink-create β literally just here to create a new autolink reference for you π«Ά
πΈ SYNOPSIS πΈ
gh repo autolink create <keyPrefix> <urlTemplate> [flags]
π¦ DESCRIPTION π¦
so the whole bit: you're creating a new autolink reference for a repository. that's the vibe. π
the keyPrefix argument is the prefix β the magic little string that, when certain characters get appended to it, generates a link. that's the whole trigger, iykyk.
the urlTemplate argument is the target URL that gets generated when the keyPrefix is found. important: it must contain the <num> variable for the reference number. no <num>, no link, periodt. π¨
by default, autolinks are alphanumeric β and you use the --numeric flag to create a numeric autolink instead.
and here's the tea on how the <num> variable behaves, because it's genuinely different depending on which kind you picked:
- alphanumeric: matches
A-Z(case insensitive),0-9, and- - numeric: matches
0-9
β οΈ real talk: if your template contains multiple instances of <num>, only the first one gets replaced. the rest just sit there. don't say i didn't warn you π
π OPTIONS π
-n,--numericβ marks the autolink as numeric. that's it, that's the flag. slay. π’
π OPTIONS INHERITED FROM PARENT COMMANDS π
-R,--repo <[HOST/]OWNER/REPO>β selects another repository using the[HOST/]OWNER/REPOformat. super handy when you're not already standing in the right repo π«Ά
π ALIASES π
gh repo autolink new
yep β new works too, same energy, no cap β¨
β EXIT CODES β
0: successful execution β we ate π1: error β something went sideways π2: command canceled β you (or something) hit the brakes4: authentication required β go log in bestie π
π NOTE: specific commands may have additional exit codes. refer to the command's help for more information.
π EXAMPLE π
# Create an alphanumeric autolink to example.com for the key prefix "TICKET-".
# Generates https://example.com/TICKET?query=123abc from "TICKET-123abc".
$ gh repo autolink create TICKET- "https://example.com/TICKET?query=<num>"
# Create a numeric autolink to example.com for the key prefix "STORY-".
# Generates https://example.com/STORY?id=123 from "STORY-123".
$ gh repo autolink create STORY- "https://example.com/STORY?id=<num>" --numeric
look at that. two whole examples. the alphanumeric one is out here turning TICKET-123abc into a whole URL, and the numeric one is doing the STORY-123 thing with --numeric. iconic, honestly π₯
π§ SEE ALSO π§
gh-repo-autolink(1) β go read the parent page too, bestie, it's the main character π
and that's the whole page!! π¦ this little rewrite brought to you by GitHub CLI v2.102.0, dated Oct 2026 β mwah, go autolink something cute ππβ¨
π¦ where this page comes from
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms