Skip to main content Skills Marketplace Découvrez et explorez les compétences IA créées par la communauté.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Copier le promptAfficher les détails du prompt Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
npx skills add https://github.com/tomevault-io/skills-registry --skill gh-repo-createLa commande reste sur une seule ligne. Faites défiler horizontalement pour la vérifier avant de la copier.
Vous préférez une copie locale ? Téléchargez les fichiers actuellement disponibles dans SkillsMP.
Télécharger Zip Téléchargement... Métiers associés SOC
Basé sur la classification professionnelle SOC
Explorateur de fichiers
2 fichiers name gh-repo-create description Create a GitHub repository, configure SSH deployment keys, and set up git remote for the current folder. Works on macOS, Linux, and Unix systems. Use when this capability is needed. metadata {"author":"extractumio"}
GitHub Repository Creation & Setup
Security Note
⚠️ Important : This skill generates SSH keys without passphrases for convenience. This is suitable for:
Personal projects on encrypted systems
Development workstations with full disk encryption enabled
Not recommended for : Shared systems, production servers, or CI/CD pipelines.
For enhanced security, consider adding a passphrase when prompted during key generation, or use GitHub Personal Access Tokens (PAT) for automated systems.
Instructions
When this skill is invoked, follow these steps to initialize a git repository, create it on GitHub, configure SSH deployment keys, and prepare for pushing code:
Step 1: Get Repository Name from User
Ask the user for the desired GitHub repository name
Validate the repository name (no spaces, valid GitHub naming conventions)
Store the repository name for use in subsequent steps
Example prompt: "What would you like to name the GitHub repository?"
Step 2: Verify GitHub CLI Installation & Authentication
Before proceeding, ensure the GitHub CLI (gh) is properly installed and authenticated:
Check if gh exists :
which gh || command -v gh
If not found, inform the user to install GitHub CLI:
Check authentication status :
gh auth status
If not authenticated, guide user to run:
gh auth login
Verify the output shows authenticated status with proper scopes
Verify required permissions :
Ensure the authentication includes repo scope for creating repositories
If scope is missing, re-authenticate with proper permissions
Step 3: Create Repository on GitHub
Create the repository using GitHub CLI:
Determine repository visibility (ask user: public or private):
gh repo create <repo-name> --public --source =. --remote=origin
gh repo create <repo-name> --private --source =. --remote=origin
Add repository description (optional, ask user):
gh repo create <repo-name> --public --description "Repository description" --source =. --remote=origin
Verify repository creation :
gh repo view <owner>/<repo-name>
Confirm the repository exists on GitHub
Note the repository owner (username or organization)
Step 4: Generate SSH Deployment Keys
Generate dedicated SSH key pair for this repository:
Create SSH directory if it doesn't exist :
mkdir -p ~/.ssh
chmod 700 ~/.ssh
Generate SSH key pair :
ssh-keygen -t ed25519 -C "deploy-key-<repo-name>" -f ~/.ssh/deploy_<repo-name> -N ""
Use Ed25519 algorithm (modern, secure, fast)
No passphrase (-N "") for automated deployments
Key files: ~/.ssh/deploy_<repo-name> (private) and ~/.ssh/deploy_<repo-name>.pub (public)
Set proper permissions :
chmod 600 ~/.ssh/deploy_<repo-name>
chmod 644 ~/.ssh/deploy_<repo-name>.pub
Verify key generation :
ls -la ~/.ssh/deploy_<repo-name>*
ssh-keygen -l -f ~/.ssh/deploy_<repo-name>.pub
Step 5: Configure SSH Host in ~/.ssh/config
Add a custom SSH host configuration for this repository:
Create or update ~/.ssh/config :
touch ~/.ssh/config
chmod 600 ~/.ssh/config
Add host configuration :
# GitHub Deploy Key for <repo-name>
Host github.com-<repo-name>
HostName github.com
User git
IdentityFile ~/.ssh/deploy_<repo-name>
IdentitiesOnly yes
AddKeysToAgent yes
Append to config file safely :
cat >> ~/.ssh/config << 'EOF'
Host github.com-<repo-name>
HostName github.com
User git
IdentityFile ~/.ssh/deploy_<repo-name>
IdentitiesOnly yes
AddKeysToAgent yes
EOF
Verify configuration :
cat ~/.ssh/config | grep -A 5 "github.com-<repo-name>"
Step 6: Deploy SSH Key to GitHub Repository
Add the public key to the GitHub repository as a deploy key with write permissions:
Read the public key :
DEPLOY_KEY=$(cat ~/.ssh/deploy_<repo-name>.pub)
Add deploy key via GitHub CLI :
gh repo deploy-key add ~/.ssh/deploy_<repo-name>.pub \
--title "Deploy key for <repo-name> (no expiration)" \
--allow-write \
--repo <owner>/<repo-name>
--allow-write: Enables read/write operations (required for pushing)
--title: Descriptive name for the key
No expiration by default (deploy keys don't expire unless revoked)
Verify deploy key installation :
gh repo deploy-key list --repo <owner>/<repo-name>
Confirm the key appears in the list
Check that "Allow write access" is enabled
Test SSH connection :
ssh -T github.com-<repo-name>
Expected output: "Hi ! You've successfully authenticated..."
Step 7: Configure Git Remote URLs
Set up git remotes to use the custom SSH host:
Initialize git repository (if not already done):
git init
Check existing remotes :
git remote -v
Update origin remote to use custom SSH host :
git remote remove origin 2>/dev/null || true
git remote add origin git@github.com-<repo-name>:<owner>/<repo-name>.git
Set upstream tracking :
git branch -M main
Verify remote configuration :
git remote -v
git remote show origin
Step 8: Verify Setup (Non-Intrusive Check)
Perform validation checks without making changes to ensure everything is ready:
Check git status :
git status
Verify git is initialized
Check current branch (should be main or master)
Verify SSH key is accessible :
test -f ~/.ssh/deploy_<repo-name> && echo "✓ Private key exists"
test -f ~/.ssh/deploy_<repo-name>.pub && echo "✓ Public key exists"
Test SSH authentication (non-intrusive):
ssh -T github.com-<repo-name> 2>&1 | grep -q "successfully authenticated" && echo "✓ SSH authentication works"
Verify remote configuration :
git remote get-url origin | grep -q "github.com-<repo-name>" && echo "✓ Remote URL configured correctly"
Check deploy key on GitHub :
gh repo deploy-key list --repo <owner>/<repo-name> | grep -q "Deploy key" && echo "✓ Deploy key is installed"
Test repository accessibility (fetch without pulling):
git ls-remote origin 2>&1 | grep -q "HEAD" && echo "✓ Repository is accessible"
Summary report :
✓ Git repository initialized
✓ GitHub repository created: https://github.com/<owner>/<repo-name>
✓ SSH deployment key generated: ~/.ssh/deploy_<repo-name>
✓ SSH config updated: github.com-<repo-name>
✓ Deploy key added to repository (read/write, no expiration)
✓ Git remote configured: git@github.com-<repo-name>:<owner>/<repo-name>.git
✓ SSH authentication successful
Ready to commit and push! Next steps:
1. git add .
2. git commit -m "Initial commit"
3. git push -u origin main
Examples
Example 1: Create Public Repository for New Project
Scenario : You have a local project folder and want to create a new public GitHub repository.
Execution :
cd ~/projects/my-awesome-app
Actions Performed :
Checks gh is installed and authenticated ✓
Creates repository: gh repo create my-awesome-app --public --source=. --remote=origin
Generates SSH keys: ~/.ssh/deploy_my-awesome-app and ~/.ssh/deploy_my-awesome-app.pub
Updates ~/.ssh/config with host alias github.com-my-awesome-app
Adds deploy key to GitHub: gh repo deploy-key add ... --allow-write
Configures git remote: git@github.com-my-awesome-app:username/my-awesome-app.git
Verifies setup with non-intrusive checks
Output :
✓ GitHub CLI authenticated
✓ Git repository initialized
✓ GitHub repository created: https://github.com/username/my-awesome-app
✓ SSH deployment key generated: ~/.ssh/deploy_my-awesome-app
✓ SSH config updated: github.com-my-awesome-app
✓ Deploy key added to repository (read/write, no expiration)
✓ Git remote configured
✓ SSH authentication successful
Ready to push! Run:
git add .
git commit -m "Initial commit"
git push -u origin main
Example 2: Create Private Repository with Description
Scenario : You want to create a private repository with a custom description.
Execution :
cd ~/projects/secret-project
Actions Performed :
Creates private repository with description
Generates dedicated SSH keys for this project
Configures custom SSH host in ~/.ssh/config
Deploys key with write access (no expiration)
Sets up git remote with custom SSH host
Validates all configurations
Result :
Private repository created on GitHub
SSH keys isolated per project
Git remote ready for secure push operations
User can commit and push code securely
Example 3: Setup Repository in Organization
Scenario : You want to create a repository under a GitHub organization.
Execution :
cd ~/projects/company-project
Actions Performed :
Creates repository under organization: gh repo create my-company/company-project --private
Generates SSH keys: ~/.ssh/deploy_company-project
Configures SSH host: github.com-company-project
Adds deploy key to my-company/company-project
Sets git remote: git@github.com-company-project:my-company/company-project.git
Verifies organization repository access
Benefits :
Works seamlessly with personal accounts and organizations
Deploy keys work regardless of account type
SSH configuration isolates credentials per project
Implementation Reference
Below is a complete bash script that implements this skill. This can be used as a reference or executed directly:
#!/usr/bin/env bash
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
print_success () {
echo -e "${GREEN} ✓${NC} $1 "
}
print_error () {
echo -e "${RED} ✗${NC} $1 "
}
print_info () {
echo -e "${YELLOW} →${NC} $1 "
}
read -p "Enter the GitHub repository name: " REPO_NAME
if [[ -z "$REPO_NAME " ]]; then
print_error "Repository name cannot be empty"
exit 1
fi
if [[ ! "$REPO_NAME " =~ ^[a-zA-Z0-9_-]+$ ]]; then
print_error "Invalid repository name. Use only letters, numbers, hyphens, and underscores."
exit 1
fi
print_success "Repository name: $REPO_NAME "
print_info
! -v gh &> /dev/null;
print_error
1
print_success
print_info
! gh auth status &> /dev/null;
print_error
1
print_success
GH_USERNAME=$(gh api user -q .login)
print_info
-p VISIBILITY
[[ != && != ]];
VISIBILITY=
-p REPO_DESC
print_info
[[ -n ]];
gh repo create --description -- =. --remote=origin
gh repo create -- =. --remote=origin
print_success
print_info
-p ~/.ssh
700 ~/.ssh
SSH_KEY_PATH=
[[ -f ]];
print_error
-p OVERWRITE
[[ != ]];
print_info
-f
ssh-keygen -t ed25519 -C -f -N
print_success
ssh-keygen -t ed25519 -C -f -N
print_success
600
644
print_success
print_success
print_info
SSH_CONFIG=
600
HOST_ALIAS=
grep -q ;
print_info
>> <<
print_success
print_info
gh repo deploy-key add \
--title \
--allow-write \
--repo
print_success
print_info
ssh -T 2>&1 | grep -q ;
print_success
print_error
print_info
[[ ! -d .git ]];
git init
print_success
git remote remove origin 2>/dev/null ||
REMOTE_URL=
git remote add origin
print_success
git branch -M main 2>/dev/null ||
print_info
git status &> /dev/null;
print_success
[[ -f ]];
print_success
[[ -f ]];
print_success
git remote get-url origin | grep -q ;
print_success
gh repo deploy-key list --repo | grep -q ;
print_success
git ls-remote origin &> /dev/null;
print_success
---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/extractumio) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->
"Checking GitHub CLI installation..."
if
command
then
"GitHub CLI (gh) is not installed"
echo
"Install it from: https://github.com/cli/cli#installation"
exit
fi
"GitHub CLI found: $(gh --version | head -1) "
"Checking authentication status..."
if
then
"Not authenticated with GitHub CLI"
echo
"Run: gh auth login"
exit
fi
"Authenticated with GitHub"
"GitHub username: $GH_USERNAME "
read
"Should this be a public or private repository? (public/private): "
if
"$VISIBILITY "
"public"
"$VISIBILITY "
"private"
then
"public"
fi
read
"Enter repository description (optional): "
"Creating GitHub repository..."
if
"$REPO_DESC "
then
"$REPO_NAME "
"--$VISIBILITY "
"$REPO_DESC "
source
else
"$REPO_NAME "
"--$VISIBILITY "
source
fi
"Repository created: https://github.com/$GH_USERNAME /$REPO_NAME "
"Generating SSH deployment keys..."
mkdir
chmod
"$HOME /.ssh/deploy_$REPO_NAME "
if
"$SSH_KEY_PATH "
then
"SSH key already exists: $SSH_KEY_PATH "
read
"Overwrite? (yes/no): "
if
"$OVERWRITE "
"yes"
then
"Using existing SSH key"
else
rm
"$SSH_KEY_PATH "
"$SSH_KEY_PATH .pub"
"deploy-key-$REPO_NAME "
"$SSH_KEY_PATH "
""
"New SSH key generated"
fi
else
"deploy-key-$REPO_NAME "
"$SSH_KEY_PATH "
""
"SSH key generated"
fi
chmod
"$SSH_KEY_PATH "
chmod
"$SSH_KEY_PATH .pub"
"Private key: $SSH_KEY_PATH "
"Public key: $SSH_KEY_PATH .pub"
"Configuring SSH host in ~/.ssh/config..."
"$HOME /.ssh/config"
touch
"$SSH_CONFIG "
chmod
"$SSH_CONFIG "
"github.com-$REPO_NAME "
if
"Host $HOST_ALIAS "
"$SSH_CONFIG "
then
"Host $HOST_ALIAS already exists in SSH config"
else
cat
"$SSH_CONFIG "
EOF
# GitHub Deploy Key for $REPO_NAME
Host $HOST_ALIAS
HostName github.com
User git
IdentityFile $SSH_KEY_PATH
IdentitiesOnly yes
AddKeysToAgent yes
EOF
"SSH host configured: $HOST_ALIAS "
fi
"Adding deploy key to GitHub repository..."
"$SSH_KEY_PATH .pub"
"Deploy key for $REPO_NAME (no expiration)"
"$GH_USERNAME /$REPO_NAME "
"Deploy key added with read/write access"
"Testing SSH connection..."
if
"$HOST_ALIAS "
"successfully authenticated"
then
"SSH authentication successful"
else
"SSH authentication test inconclusive (this may be normal)"
fi
"Configuring git remote..."
if
then
"Git repository initialized"
fi
true
"git@$HOST_ALIAS :$GH_USERNAME /$REPO_NAME .git"
"$REMOTE_URL "
"Git remote added: $REMOTE_URL "
true
"Verifying setup..."
if
then
"Git repository initialized"
fi
if
"$SSH_KEY_PATH "
then
"Private key exists: $SSH_KEY_PATH "
fi
if
"$SSH_KEY_PATH .pub"
then
"Public key exists: $SSH_KEY_PATH .pub"
fi
if
"$HOST_ALIAS "
then
"Remote URL configured correctly"
fi
if
"$GH_USERNAME /$REPO_NAME "
"Deploy key"
then
"Deploy key is installed on GitHub"
fi
if
then
"Repository is accessible"
fi
echo
""
echo
"========================================="
echo
" Setup Complete!"
echo
"========================================="
echo
""
echo
"Repository: https://github.com/$GH_USERNAME /$REPO_NAME "
echo
"SSH Key: $SSH_KEY_PATH "
echo
"SSH Host: $HOST_ALIAS "
echo
"Git Remote: $REMOTE_URL "
echo
""
echo
"Next steps:"
echo
" 1. git add ."
echo
" 2. git commit -m \"Initial commit\""
echo
" 3. git push -u origin main"
echo
""