Files
wehub-resource-sync 9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:48 +08:00

56 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MDN Web Docs
**Mode**: 🌐 Public · **Domain**: `developer.mozilla.org`
Search the official Mozilla Developer Network web docs without auth or browser. One command.
## Commands
| Command | Description |
|---------|-------------|
| `opencli mdn search <query>` | Search MDN Web Docs by keyword |
## Usage Examples
```bash
# Web platform feature search
opencli mdn search fetch --limit 10
opencli mdn search flexbox --limit 5
# JS reference lookups
opencli mdn search "Array.prototype.map"
# Localized search (default: en-US)
opencli mdn search fetch --locale ja --limit 5
opencli mdn search fetch --locale zh-CN --limit 5
# JSON output
opencli mdn search fetch -f json
```
## Output Columns
| Command | Columns |
|---------|---------|
| `search` | `rank, title, slug, locale, summary, url` |
The `slug` column round-trips into MDN's URL space (`https://developer.mozilla.org/<locale>/docs/<slug>`).
## Options
| Option | Description |
|--------|-------------|
| `query` (positional) | Free-text query |
| `--limit` | Max results (150, default: 10) |
| `--locale` | Doc locale (default: `en-US`). Allowed: `en-US`, `de`, `es`, `fr`, `ja`, `ko`, `pt-BR`, `ru`, `zh-CN`, `zh-TW`. |
## Caveats
- Only the locales MDN actually publishes are accepted; passing anything else raises `ArgumentError`.
- The `summary` field is MDN's pre-computed search excerpt with whitespace collapsed; it is **not** the full document body.
- MDN throttles aggressive bursts; `HTTP 429` surfaces as a typed `CommandExecutionError` with a retry hint.
## Prerequisites
- No browser required — uses `developer.mozilla.org/api/v1/search`.