GH-REPO-AUTOLINK-CREATE(1) GitHub CLI manual GH-REPO-AUTOLINK-CREATE(1)

# [NAME](#NAME)

gh-repo-autolink-create - Create a new autolink reference

# [SYNOPSIS](#SYNOPSIS)

**gh repo autolink create &lt;keyPrefix&gt; &lt;urlTemplate&gt; \[flags]**

# [DESCRIPTION](#DESCRIPTION)

Create a new autolink reference for a repository.

The **keyPrefix** argument specifies the prefix that will generate a link when it is appended by certain characters.

The **urlTemplate** argument specifies the target URL that will be generated when the keyPrefix is found, which must contain **&lt;num&gt;** variable for the reference number.

By default, autolinks are alphanumeric with **--numeric** flag used to create a numeric autolink.

The **&lt;num&gt;** variable behavior differs depending on whether the autolink is alphanumeric or numeric:

- alphanumeric: matches **A-Z** (case insensitive), **0-9**, and **-**
- numeric: matches **0-9**

If the template contains multiple instances of **&lt;num&gt;**, only the first will be replaced.

# [OPTIONS](#OPTIONS)

[**-n**, **--numeric**](#n)

Mark autolink as numeric

# [OPTIONS INHERITED FROM PARENT COMMANDS](#OPTIONS_INHERITED_FROM_PARENT_COMMANDS)

[**-R**, **--repo** **&lt;\[HOST/\]OWNER/REPO&gt;**](#R)

Select another repository using the \[HOST/]OWNER/REPO format

# [ALIASES](#ALIASES)

gh repo autolink new

# [EXIT CODES](#EXIT_CODES)

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

# [EXAMPLE](#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
```

# [SEE ALSO](#SEE_ALSO)

[**gh-repo-autolink(1)**](/man/os/gh/gh-repo-autolink.1)

Oct 2026

---

Document: gh-repo-autolink-create(1) from gh 2.102.0-r2 (Chainguard OS)
Source: https://github.com/cli/cli
