spotube/gh_2.76.2_macOS_amd64/share/man/man1/gh-extension-install.1

94 lines
2.7 KiB
Groff

.nh
.TH "GH-EXTENSION-INSTALL" "1" "Jul 2025" "GitHub CLI 2.76.2" "GitHub CLI manual"
.SH NAME
gh-extension-install - Install a gh extension from a repository
.SH SYNOPSIS
\fBgh extension install <repository> [flags]\fR
.SH DESCRIPTION
Install a GitHub CLI extension from a GitHub or local repository.
.PP
For GitHub repositories, the repository argument can be specified in
\fBOWNER/REPO\fR format or as a full repository URL.
The URL format is useful when the repository is not hosted on \fBgithub.com\fR\&.
.PP
For remote repositories, the GitHub CLI first looks for the release artifacts assuming
that it's a binary extension i.e. prebuilt binaries provided as part of the release.
In the absence of a release, the repository itself is cloned assuming that it's a
script extension i.e. prebuilt executable or script exists on its root.
.PP
The \fB--pin\fR flag may be used to specify a tag or commit for binary and script
extensions respectively, the latest version is used otherwise.
.PP
For local repositories, often used while developing extensions, use \fB\&.\fR as the
value of the repository argument. Note the following:
.IP \(bu 2
After installing an extension from a locally cloned repository, the GitHub CLI will
manage this extension as a symbolic link (or equivalent mechanism on Windows) pointing
to an executable file with the same name as the repository in the repository's root.
For example, if the repository is named \fBgh-foobar\fR, the symbolic link will point
to \fBgh-foobar\fR in the extension repository's root.
.IP \(bu 2
When executing the extension, the GitHub CLI will run the executable file found
by following the symbolic link. If no executable file is found, the extension
will fail to execute.
.IP \(bu 2
If the extension is precompiled, the executable file must be built manually and placed
in the repository's root.
.PP
For the list of available extensions, see
\[la]https://github.com/topics/gh\-extension\[ra]\&.
.SH OPTIONS
.TP
\fB--force\fR
Force upgrade extension, or ignore if latest already installed
.TP
\fB--pin\fR \fB<string>\fR
Pin extension to a release tag or commit ref
.SH EXIT CODES
0: Successful execution
.PP
1: Error
.PP
2: Command canceled
.PP
4: Authentication required
.PP
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.
.SH EXAMPLE
.EX
# Install an extension from a remote repository hosted on GitHub
$ gh extension install owner/gh-extension
# Install an extension from a remote repository via full URL
$ gh extension install https://my.ghes.com/owner/gh-extension
# Install an extension from a local repository in the current working directory
$ gh extension install .
.EE
.SH SEE ALSO
\fBgh-extension(1)\fR