summaryrefslogtreecommitdiff
path: root/external_plugins/context7/commands/docs.md
blob: 8a2df7818ca00b3badd92a8eec9c4752ddabd2b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
description: Look up documentation for any library
argument-hint: <library> [query]
---

# /context7:docs

Fetches up-to-date documentation and code examples for a library.

## Usage

```
/context7:docs <library> [query]
```

- **library**: The library name, or a Context7 ID starting with `/`
- **query**: What you're looking for (optional but recommended)

## Examples

```
/context7:docs react hooks
/context7:docs next.js authentication
/context7:docs prisma relations
/context7:docs /vercel/next.js/v15.1.8 app router
/context7:docs /supabase/supabase row level security
```

## How It Works

1. If the library starts with `/`, it's used directly as the Context7 ID
2. Otherwise, `resolve-library-id` finds the best matching library
3. `query-docs` fetches documentation relevant to your query
4. Results include code examples and explanations

## Version-Specific Lookups

Include the version in the library ID for pinned documentation:

```
/context7:docs /vercel/next.js/v15.1.8 middleware
/context7:docs /facebook/react/v19.0.0 use hook
```

This is useful when you're working with a specific version and want docs that match exactly.