-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-github-cli.sh
More file actions
32 lines (25 loc) · 964 Bytes
/
install-github-cli.sh
File metadata and controls
32 lines (25 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Install GitHub CLI (gh)
echo "Installing GitHub CLI..."
# Install prerequisites
apt-get update
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg
# Add GitHub CLI repository
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
# Update and install gh
apt-get update
apt-get install -y gh
# Verify installation
echo "Verifying GitHub CLI installation..."
if ! command -v gh &> /dev/null; then
echo "ERROR: gh command not found after installation"
exit 1
fi
echo "GitHub CLI version:"
gh --version
echo "GitHub CLI installation completed successfully!"