Files
skillshare/website/docs/reference/commands/search.md
T
Willie 49a52498e9 docs: add current screenshots and diagrams to the guides
The dashboard screenshots predated the Projects page and showed codex at
its old path, and the guides for dashboard-only features (AGENTS.md
sharing, MCP, plugins, backups, hubs) had no pictures at all.

- Re-shoot the dashboard screenshots (docs and README copies) and add
  ones for targets, extras, shared AGENTS.md, MCP, project MCP, plugins,
  backups, hubs and project mode.
- Add diagrams for sharing AGENTS.md, MCP sync and migrating with
  collect; fix codex's path in the getting-started diagram.
- Replace terminal screenshots with real output as text, and remove
  images nothing referenced.
- Fix text that no longer matched the dashboard (project mode, hub
  navigation, backup list output).
2026-09-28 21:02:12 +08:00

339 lines
10 KiB
Markdown

---
sidebar_position: 5
---
# search
Discover and install skills from GitHub repositories.
## When to Use
- Discover community skills from hub indexes
- Find skills by name, tag, or description
- Browse available skills before installing
## Quick Start
```bash
skillshare search vercel # Search by keyword
skillshare search # Browse popular skills
```
This searches GitHub for repositories containing `SKILL.md` files that match your query.
## Browse Mode
When no query is provided, `search` browses popular skills on GitHub:
```bash
skillshare search # Browse popular skills
skillshare search --list # List popular skills
```
This uses `filename:SKILL.md` as the GitHub query and sorts results by star count, showing the most popular skill repositories first.
## How It Works
```
skillshare search [query]
│
▼
GitHub Code Search API (filename:SKILL.md + query)
│
▼
Fetch star counts for each repository
│
▼
Sort by stars (most popular first)
│
▼
Interactive selector → Install selected skill
```
## Preview
```text
$ skillshare search runkids
▸ Searching runkids
│
├─ Found 20 skill(s) (12.0s)
Select skills to install (0/20 selected)
▌ [ ] skillshare ★ 2.7k
▌ runkids/skillshare/skills/skillshare
▌ [ ] skill-sharing ★ 654
▌ majiayu000/claude-skill-registry/skills/skills/skill-sharing
▌ [ ] skillshare-changelog ★ 2.7k
▌ runkids/skillshare/.skillshare/skills/skillshare-changelog
…
20 skills · Page 1 of 2
─────────────────────────────────────────
Description: Manage skills, agents, extras, plugins, and MCP connection settings with the Skillshare CLI.
Use when the user asks to configure or run Skillshare, install or sync resources across AI
tools, import MCP settings, manage targets, audit skills, recover backups, or troubleshoot...
Source: runkids/skillshare/skills/skillshare
Stars: 2.7k
↑↓ navigate ←→ page space toggle a all enter install s search again / filter esc cancel
```
**Controls:**
- `↑` `↓` — Navigate results; `←` `→` — change page
- `Space` — Select or clear a skill; `a` — select all visible
- `Enter` — Install the selected skills (with nothing selected, it cancels)
- `/` — Filter results; `s` — search again
- `Esc` or `Ctrl+C` — Cancel and exit
After installing, you can search again or press `Enter` to quit.
## Options
| Flag | Description |
|------|-------------|
| `--project`, `-p` | Install to project-level config (`.skillshare/`) |
| `--global`, `-g` | Install to global config (`~/.config/skillshare`) |
| `--hub [URL]` | Search from a hub index (default: [skillshare-hub](https://github.com/runkids/skillshare-hub); or custom URL/path) |
| `--list`, `-l` | List results only, no install prompt |
| `--json` | Output as JSON (for scripting) |
| `--limit N`, `-n N` | Maximum results (default: 20, max: 100) |
| `--help`, `-h` | Show help |
:::tip Auto-detection
If neither `--project` nor `--global` is specified, skillshare auto-detects: if `.skillshare/config.yaml` exists in the current directory, it defaults to project mode; otherwise global mode.
:::
## Examples
### Browse Popular
```bash
skillshare search # Browse popular skills (no query)
```
### Basic Search
```bash
skillshare search pdf # Interactive search and install
skillshare search "code review" # Multi-word search
```
### List Mode
```bash
skillshare search commit --list
```
Output:
```
1. fix facebook/react/.claude/skills/fix ★ 242.7k
Use when you have lint errors, formatting issues...
2. verify facebook/react/.claude/skills/verify ★ 242.7k
Use when you want to validate changes before committing...
3. commit-helper cockroachdb/cockroach/.claude/skills/commit-helper ★ 31.8k
Help create git commits and PRs with properly formatted messages...
```
### JSON Output
```bash
skillshare search react --json --limit 5
```
```json
[
{
"Name": "react-patterns",
"Description": "React and Next.js performance optimization...",
"Source": "facebook/react/.claude/skills/react-patterns",
"Stars": 242700,
"Owner": "facebook",
"Repo": "react",
"Path": ".claude/skills/react-patterns"
}
]
```
### Project Mode
```bash
skillshare search pdf -p # Search and install to project
skillshare search react --project # Same thing, long flag
```
Installed skills go to `.skillshare/skills/` and the project config is updated automatically. If the project hasn't been initialized yet, skillshare will run `init -p` first.
### Limit Results
```bash
skillshare search frontend -n 5 # Show only top 5 results
```
## Authentication {#authentication}
GitHub Code Search API requires authentication. skillshare automatically detects your credentials:
1. **GitHub CLI** (recommended) — If you're logged in with `gh`:
```bash
gh auth login
```
2. **Environment variable** — Set `GITHUB_TOKEN` or `GH_TOKEN`:
```bash
export GITHUB_TOKEN=ghp_your_token_here
```
### Creating a Token
If you don't use `gh` CLI:
1. Go to [GitHub Settings → Tokens](https://github.com/settings/tokens)
2. Generate new token (classic)
3. No scopes needed for public repos
4. Set the token:
```bash
export GITHUB_TOKEN=ghp_your_token_here
```
## How Results are Ranked
1. **Search** — GitHub Code Search finds `SKILL.md` files matching your query
2. **Filter** — Removes forked repositories (duplicates)
3. **Fetch Stars** — Gets star count for each unique repository
4. **Sort** — Orders by stars (most popular first)
5. **Limit** — Returns top N results
This ensures high-quality, popular skills appear first.
## Community Hub
Browse and install community-curated skills from [skillshare-hub](https://github.com/runkids/skillshare-hub):
```bash
skillshare search --hub # Browse all skills in skillshare-hub
skillshare search react --hub # Search "react" in skillshare-hub
```
When `--hub` is used without a URL, it defaults to the community [skillshare-hub](https://github.com/runkids/skillshare-hub) index.
Want to share your skill with the community? [Open a PR](https://github.com/runkids/skillshare-hub) to add your skill — CI runs `skillshare audit` on every submission.
## Saved Hub Labels
Save hubs with [`hub add`](./hub.md#hub-add) and search by label instead of typing full URLs:
```bash
# Save a hub once
skillshare hub add https://internal.corp/hub.json --label team
# Search by label
skillshare search react --hub team
# Set as default for bare --hub
skillshare hub default team
skillshare search --hub # Uses "team" hub
```
Resolution order for `--hub <value>`:
1. URL or path (starts with `http`, `/`, `.`, `~`, `file://`, or an SSH URL such as `git@…`/`ssh://…`) → used directly
2. Otherwise → label lookup from saved hubs
3. Bare `--hub` (no value) → config default → community hub fallback
See [`hub`](./hub.md) for managing saved hubs.
## Private Index Search {#private-index-search}
Search from a private hub index instead of GitHub:
```bash
# Local file
skillshare search react --hub ./skillshare-hub.json
# HTTP URL
skillshare search react --hub https://internal.corp/skills/skillshare-hub.json
# SSH URL — clones the repo and reads the index (works with private/GHE hosts)
skillshare search react --hub git@github.com:org/skills.git
skillshare search react --hub git@ghe.corp.com:team/skills.git//hubs/team.json
# Browse all skills (empty query)
skillshare search --hub ./skillshare-hub.json --json
# Equals syntax also works
skillshare search react --hub=./skillshare-hub.json
```
:::note SSH hub sources
An SSH `--hub` value is resolved by shallow-cloning the repo (using your SSH agent/keys) and reading the index file from it. The file path inside the repo comes from the `//path` suffix — `git@host:org/repo.git//hubs/team.json` — and defaults to `skillshare-hub.json` at the repo root when omitted. Both scp-style (`git@host:org/repo.git`) and scheme-style (`ssh://git@host/org/repo.git`) URLs are accepted.
In the [web dashboard](./ui.md), SSH hub sources must be [saved first](./hub.md#hub-add); the server only clones saved hubs.
:::
Build an index with [`hub index`](./hub.md):
```bash
skillshare hub index # Generate skillshare-hub.json
skillshare search --hub ./skillshare-hub.json # Search it
```
:::tip Default hub
`skillshare search --hub` (without a URL) defaults to the community [skillshare-hub](https://github.com/runkids/skillshare-hub) index, so you don't need to type the full URL every time. Or set your own default with `skillshare hub default <label>`.
:::
For more details, see the [Hub Index Guide](/docs/how-to/sharing/hub-index).
## Tips
### Find Official Skills
Search for well-known organizations:
```bash
skillshare search anthropic # Anthropic's skills
skillshare search facebook # Meta/Facebook skills
skillshare search vercel # Vercel's skills
```
### Find Specific Functionality
Search by what you want to do:
```bash
skillshare search "pull request"
skillshare search deployment
skillshare search testing
skillshare search database
```
### Continuous Search
In interactive mode, after installing a skill (or canceling), you can search again without restarting:
```
? Search again (or press Enter to quit): react
```
## Troubleshooting
### "GitHub Code Search API requires authentication"
Run `gh auth login` or set `GITHUB_TOKEN`. See [Authentication](#authentication).
### "GitHub API rate limit exceeded"
- Authenticated users: 30 requests/minute for Code Search
- Wait a minute and try again
- Use `--limit` to reduce API calls
### New Repository Not Found
GitHub indexes new repositories with a delay (hours to days). If your repo isn't found:
- Install directly: `skillshare install owner/repo/path/to/skill`
- Wait for GitHub to index the repository
### Results Don't Match Query
GitHub Code Search matches content inside `SKILL.md` files. A skill mentioning "vercel" in its description will appear in vercel searches, even if the skill isn't specifically about Vercel.
Use `--list` to review results before installing.