| name | code-explorer |
| description | Search and analyze code repositories on GitHub and Hugging Face (Models, Datasets, Spaces). This skill should be used when exploring open-source projects, finding implementation references, discovering ML models/datasets, or analyzing how others have solved similar problems. |
Code Explorer
Overview
To search and analyze code repositories across GitHub and Hugging Face platforms, use this skill. It enables discovering implementation patterns, finding relevant ML models/datasets, and exploring demo applications (Spaces) for learning and reference.
Supported Platforms
| Platform | Search Targets | Tool |
|---|
| GitHub | Repositories, Code | gh CLI |
| Hugging Face | Models, Datasets, Spaces | uvx hf CLI + huggingface_hub API |
๊ฒ์ ํ์ง ์์น (ํ์)
1. ํ์ฌ ๋ ์ง ํ์ธ
date +%Y-%m-%d
์๋ ์์์ ์ฐ๋๋ ์ฐธ๊ณ ์ฉ. ์ค์ ๊ฒ์ ์ ํ์ฌ ์ฐ๋ ์ฌ์ฉ.
2. Long-tail Keywords ์ ์ฉ
์์์ Short-tail์ ๊ทธ๋๋ก ์ฐ์ง ๋ง๊ณ ํ์ฅ:
| ์์ (์ฐธ๊ณ ์ฉ) | ์ค์ ๊ฒ์ (Long-tail) |
|---|
"object detection" | "open vocabulary object detection pytorch inference {ํ์ฌ์ฐ๋}" |
"gradio demo" | "gradio image segmentation interactive demo huggingface" |
"qwen vl" | "qwen2-vl vision language model zero-shot example code" |
3. Multi-Query ์ ์ฉ
ํ ๋ฒ์ ์ฐพ๊ธฐ ์ด๋ ค์ฐ๋ฉด 2-3๊ฐ ๊ด์ ์ผ๋ก ๊ฒ์:
gh search repos "qwen2-vl" --sort stars
gh search repos "vision language open vocabulary detection" --sort stars
gh search repos "vl model gradio demo inference" --sort stars
4. ํํฐ ํ์ฉ
gh search repos "keyword" stars:>50 pushed:>{ํ์ฌ์ฐ๋-1}-01-01 --language python
5. ๊ฒ์ ์ ์ฒดํฌ๋ฆฌ์คํธ
Workflow Decision Tree
User wants to explore code/resources
|
+-- Looking for code implementations?
| +-- Use GitHub search
| +-- scripts/search_github.py (or gh CLI directly)
| +-- Analyze repo structure, README, key files
|
+-- Looking for ML resources?
+-- Use Hugging Face search
+-- scripts/search_huggingface.py (search via API)
+-- uvx hf download (download files)
Scripts
Always run scripts with --help first to see usage. These scripts handle common search workflows reliably.
Available Scripts
scripts/search_github.py - GitHub repository search using gh CLI
scripts/search_huggingface.py - Hugging Face search (models, datasets, spaces)
Quick Examples
python scripts/search_github.py "object detection" --limit 10 --help
python scripts/search_huggingface.py "qwen vl" --type models --help
GitHub Search
Using gh CLI Directly
gh search repos "open vocabulary detection" --sort stars --limit 10
gh search repos "gradio app" --language python --limit 5
gh repo view owner/repo
gh search code "Qwen2VL" --extension py
Repository Analysis
To analyze a found repository:
- Review README.md for usage instructions
- Identify main entry points (app.py, main.py, inference.py)
- Check dependencies (requirements.txt, pyproject.toml)
- Study implementation patterns in source files
Hugging Face Search
Search (via script or Python API)
python scripts/search_huggingface.py "object detection" --type models --limit 10
python scripts/search_huggingface.py "coco" --type datasets --limit 5
python scripts/search_huggingface.py "gradio demo" --type spaces --limit 10
python scripts/search_huggingface.py "qwen vl" --type all
Download (via uvx hf)
uvx hf download <space_id> --repo-type space --include "*.py" --local-dir /tmp/<space_name>
uvx hf download <repo_id> --include "*.json" --local-dir /tmp/<model_name>
uvx hf download <repo_id> --local-dir ./my-model
Note: Always use --local-dir /tmp/ for temporary code analysis to avoid cluttering the project.
Common Search Patterns
python scripts/search_huggingface.py "open vocabulary detection" --type models
python scripts/search_huggingface.py "qwen2 vl" --type models
python scripts/search_huggingface.py "grounding dino" --type models
python scripts/search_huggingface.py "object detection demo" --type spaces
python scripts/search_huggingface.py "gradio image" --type spaces
Analyzing a Space
To understand how a Space is implemented:
- Find the space:
python scripts/search_huggingface.py "keyword" --type spaces
- Download source:
uvx hf download <space_id> --repo-type space --include "*.py" --include "requirements.txt" --local-dir /tmp/<space_name>
- Or view online:
https://huggingface.co/spaces/{space_id}/tree/main
- Focus on
app.py for main logic
- Check
requirements.txt for dependencies
Example Use Cases
Find Qwen3-VL Open Vocab Detection Code
gh search repos "qwen vl object detection" --sort stars
gh search code "Qwen2VL" --extension py
python scripts/search_huggingface.py "qwen2-vl" --type models
python scripts/search_huggingface.py "qwen vl" --type spaces
Find Gradio Demo Patterns
python scripts/search_huggingface.py "gradio object detection" --type spaces
uvx hf download username/space-name --repo-type space --include "*.py" --local-dir /tmp/space-name
Find Pre-trained Detection Models
python scripts/search_huggingface.py "object-detection" --type models --limit 20
python scripts/search_huggingface.py "grounding-dino" --type models
python scripts/search_huggingface.py "yolo-world" --type models
Resources
scripts/
search_github.py - GitHub repository search wrapper
search_huggingface.py - Hugging Face Hub search wrapper
references/
github_api.md - GitHub CLI detailed reference
huggingface_api.md - Hugging Face Hub API and CLI reference
Tips
- Start broad, then narrow: Begin with general keywords, then add filters
- Check stars/likes: Higher counts often indicate quality
- Review recent activity: Recently updated repos are better maintained
- Use --help first: Scripts have detailed usage information
- Download selectively: Use
uvx hf download --include to download only needed files
- Always cite sources: Include repository URLs, Space links, or model IDs you referenced