Generate a beautiful GitHub profile README with one click. Automatically detect repositories, analyze the tech stack, and intelligently recommend projects and themes.
Overview
Based on the user's GitHub data (repositories, languages, stars), automatically generate a profile README with stats cards, project showcases, and tech stack badges. Depends on gh CLI to fetch data, and outputs a complete README.md file. Provides 5 themes and 3 sorting methods.
When to Use
- User wants to create a GitHub profile page (with or without existing README)
- User wants to generate a new GitHub profile README
- User wants to beautify an existing README
- User wants to showcase projects and tech stack
- User inputs
/github-profile-beautifier [username] - User wants to improve their GitHub profile for job applications
- User wants to add stats cards and contribution graphs
- User wants to highlight specific projects for recruiters
- User wants a professional-looking profile with tech stack visualization
When NOT to Use:
- User only wants to make small edits to an existing README
- User already has a perfect README and just wants minor tweaks
- User wants to create a personal page on a non-GitHub platform (e.g., personal website, blog)
- User wants to generate a resume or CV (different tooling)
- User wants to create a portfolio website (use GitHub Pages or Netlify)
Core Pattern
Step 0: Parse parameters
Extract from user input username、--sort(default smart),--theme(default radical). If parameters are missing, ask interactively.
Step 1: Fetch user information
# 检查 gh CLI
if ! command -v gh >/dev/null 2>&1; then
echo "⚠️ gh CLI 未安装"
echo "安装方式: brew install gh"
echo "或使用 GitHub API 作为备选方案"
# 备选方案:使用 GitHub API
if command -v curl >/dev/null 2>&1 && command -v python3 >/dev/null 2>&1; then
echo "使用 GitHub API 获取用户信息..."
curl -s "https://api.github.com/users/$USERNAME" | python3 -c "
import sys,json
data=json.load(sys.stdin)
print(f'Login: {data.get(\"login\",\"N/A\")}')
print(f'Name: {data.get(\"name\",\"N/A\")}')
print(f'Bio: {data.get(\"bio\",\"N/A\")}')
"
else
echo "❌ 无法获取用户信息,请安装 gh CLI,或 curl + python3"
exit 1
fi
else
# 验证用户存在
gh api users/$USERNAME > /dev/null 2>&1 || { echo "用户不存在"; exit 1; }
# 捕获用户信息和仓库到变量(供 Step 3 模板填充)
USER_JSON=$(gh api users/$USERNAME)
LOGIN=$(echo "$USER_JSON" | jq -r '.login // ""')
NAME=$(echo "$USER_JSON" | jq -r '.name // ""')
BIO=$(echo "$USER_JSON" | jq -r '.bio // ""')
REPOS_JSON=$(gh repo list $USERNAME --limit 50 --json name,description,primaryLanguage,url,updatedAt,stargazerCount,isFork)
fi
Step 2: Analyze repositories
- Filter out forked repositories (if all are forks, use all repositories)
- Sorting methods:
stars(by stars),updated(by update time),smart(combines stars + update time + description quality) - Count language distribution
Step 3: Prepare template data
Shared by all templates:username, name, bio, typing_lines, website, blog, email, linkedin
Project variables:projects(name, description, url, stars, tech)
Tech stack variables are distinguished by:
- radical / tokyonight / dracula / minimalist →
languages+tools - professional →
frontend+backend+tools(needs to classify frontend and backend by language)
Language/tool colors are obtained from templates/themes.json . Contact fields are optional; templates use {{#if}} to handle empty values.
Step 4: Generate README
Read the corresponding theme template, fill in variables, and output the complete README.md.
Available theme templates:templates/radical.md(colorful),templates/tokyonight.md(blue-purple),templates/dracula.md(dark purple),templates/minimalist.md(minimalist),templates/professional.md(business). All themes share templates/themes.json color configuration and templates/README.md template documentation.
Snake contribution graph: The dark theme includes a snake contribution graph; the user must first fork platane/snk and configure GitHub Actions, otherwise it will show 404.
Quick Reference
| Parameter | Description | Default value |
|---|---|---|
username |
GitHub username | Ask interactively |
--sort |
stars / smart / updated | smart |
--theme |
radical / tokyonight / dracula / minimalist / professional | radical |
/github-profile-beautifier username
/github-profile-beautifier username --sort stars --theme tokyonight
Common Mistakes
| Error | Correct approach | Reason |
|---|---|---|
| Use an external API to fetch statistics | Use gh command to fetch locally |
The API may be unstable |
| Hardcode theme colors | Read from themes.json | Convenient for user customization |
| Show all repositories | Intelligently recommend Top 5 | Avoid information overload |
| Do not check whether gh CLI is installed | Check first, then execute | Avoid runtime errors |
| Do not handle the case where the user does not exist | Verify user existence first | Avoid invalid operations |
| List forked repositories as main projects | Filter out forked repositories | Forks do not represent personal ability |
| Forget to configure the snake contribution graph | Prompt the user to fork platane/snk | The dark theme will show a 404 image |
| Confuse frontend and backend language classification | The professional theme classifies by function | Classifying only by language cannot demonstrate architectural ability |
| Do not handle empty bio fields | Templates use {{#if}} Skip empty values |
Empty fields display as strange placeholders |