githits 0.1.11 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.plugin/plugin.json +1 -1
- package/GEMINI.md +13 -5
- package/README.md +14 -8
- package/commands/example.md +23 -0
- package/commands/help.md +8 -3
- package/commands/search.md +6 -4
- package/dist/cli.js +2314 -4704
- package/dist/index.js +1 -1
- package/dist/shared/chunk-1t81jdax.js +4303 -0
- package/dist/shared/chunk-cdx2gnrs.js +11 -0
- package/dist/shared/chunk-fa4571ch.js +6 -0
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/example.md +23 -0
- package/plugins/claude/commands/help.md +8 -3
- package/plugins/claude/commands/search.md +6 -4
- package/plugins/claude/skills/search/SKILL.md +4 -1
- package/skills/search/SKILL.md +4 -1
- package/dist/shared/chunk-hyfjv9fg.js +0 -4
package/.plugin/plugin.json
CHANGED
package/GEMINI.md
CHANGED
|
@@ -4,7 +4,7 @@ Code examples from global open source for developers and AI assistants.
|
|
|
4
4
|
|
|
5
5
|
## Available Tools
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### get_example
|
|
8
8
|
|
|
9
9
|
Find code examples from open source repositories.
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ Find code examples from open source repositories.
|
|
|
16
16
|
|
|
17
17
|
### search_language
|
|
18
18
|
|
|
19
|
-
Look up supported programming language names. Use this before calling `
|
|
19
|
+
Look up supported programming language names. Use this before calling `get_example` to get the correct language identifier.
|
|
20
20
|
|
|
21
21
|
**Parameters:**
|
|
22
22
|
|
|
@@ -34,14 +34,14 @@ Rate a search result. Submit feedback after each search to improve future result
|
|
|
34
34
|
|
|
35
35
|
## When to Use
|
|
36
36
|
|
|
37
|
-
Use `
|
|
37
|
+
Use `get_example` when:
|
|
38
38
|
|
|
39
39
|
- You are stuck or blocked on an implementation problem
|
|
40
40
|
- You need up-to-date examples for an API, library, or framework
|
|
41
41
|
- The user mentions GitHits or asks you to search for code examples
|
|
42
42
|
- You encounter an error you cannot resolve from your training data
|
|
43
43
|
|
|
44
|
-
Do not use `
|
|
44
|
+
Do not use `get_example` for:
|
|
45
45
|
|
|
46
46
|
- General knowledge questions that do not require code examples
|
|
47
47
|
- Problems you can already solve confidently
|
|
@@ -60,12 +60,20 @@ Do not use `search` for:
|
|
|
60
60
|
|
|
61
61
|
## How to Search Well
|
|
62
62
|
|
|
63
|
-
- Call `search_language` first to confirm the correct language name before calling `
|
|
63
|
+
- Call `search_language` first to confirm the correct language name before calling `get_example`
|
|
64
64
|
- Formulate queries as natural language questions (e.g., "How to stream responses with the Vercel AI SDK in Next.js")
|
|
65
65
|
- Include specific error messages, library names, or API names when relevant
|
|
66
66
|
- Keep queries focused: 3-4 technical terms maximum
|
|
67
67
|
- Submit `feedback` after every search result you use or discard
|
|
68
68
|
|
|
69
|
+
## Feature-Gated Tools
|
|
70
|
+
|
|
71
|
+
When the authenticated token carries the `code_navigation` feature flag, GitHits
|
|
72
|
+
also exposes indexed dependency/package tools such as `search`,
|
|
73
|
+
`search_status`, `package_summary`, `package_vulnerabilities`,
|
|
74
|
+
`package_dependencies`, `package_changelog`, `list_files`, `read_file`, and
|
|
75
|
+
`grep_repo`.
|
|
76
|
+
|
|
69
77
|
## License Filtering
|
|
70
78
|
|
|
71
79
|
Results respect license filtering by default. Three modes:
|
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ For plugin-based hosts, install from npm/GitHub using your agent's plugin workfl
|
|
|
82
82
|
- **GitHub Copilot**: supports Open Plugin components
|
|
83
83
|
- **Gemini CLI**: supports `gemini-extension.json` and `GEMINI.md`
|
|
84
84
|
|
|
85
|
-
That's it. Your assistant now has GitHits search tools, and on accounts with package/source access enabled it also gets dependency inspection tools.
|
|
85
|
+
That's it. Your assistant now has GitHits example-search tools, and on accounts with package/source access enabled it also gets indexed dependency/package inspection tools.
|
|
86
86
|
|
|
87
87
|
## How It Works
|
|
88
88
|
|
|
@@ -92,7 +92,7 @@ Core tools available in every authenticated session:
|
|
|
92
92
|
|
|
93
93
|
| Tool | Purpose |
|
|
94
94
|
|---|---|
|
|
95
|
-
| `
|
|
95
|
+
| `get_example` | Find canonical code examples by describing what you need in natural language |
|
|
96
96
|
| `search_language` | Look up supported programming language names |
|
|
97
97
|
| `feedback` | Rate search results to improve future quality |
|
|
98
98
|
|
|
@@ -102,16 +102,17 @@ When package/source access is enabled for the current token, GitHits also expose
|
|
|
102
102
|
|
|
103
103
|
| Tool | Purpose |
|
|
104
104
|
|---|---|
|
|
105
|
+
| `search` | Unified indexed search across dependency/repository code, docs, and symbols |
|
|
106
|
+
| `search_status` | Follow up a prior indexed `search` by `searchRef` |
|
|
105
107
|
| `package_summary` | Quick package overview: version, license, downloads, quickstart, advisories |
|
|
106
108
|
| `package_vulnerabilities` | CVE / OSV advisories for a package or specific version |
|
|
107
109
|
| `package_dependencies` | Direct dependencies, dependency groups, and optional transitive graph |
|
|
108
110
|
| `package_changelog` | Release notes / changelog entries for a package or GitHub repo |
|
|
109
|
-
| `search_symbols` | Exact-token search inside indexed dependency source |
|
|
110
111
|
| `list_files` | Discover what files a dependency or repo contains |
|
|
111
112
|
| `read_file` | Read a dependency file by path |
|
|
112
|
-
| `
|
|
113
|
+
| `grep_repo` | Deterministic text grep across indexed dependency or repo files |
|
|
113
114
|
|
|
114
|
-
These advanced tools remain feature-gated. The MCP server advertises them only when the authenticated token
|
|
115
|
+
These advanced tools remain feature-gated. The MCP server advertises them only when the authenticated token explicitly carries the `code_navigation` feature flag.
|
|
115
116
|
|
|
116
117
|
### License Filtering
|
|
117
118
|
|
|
@@ -156,11 +157,16 @@ githits logout Remove stored credentials
|
|
|
156
157
|
githits mcp Show setup instructions in a terminal; starts MCP server when piped
|
|
157
158
|
githits mcp start Always start MCP server (for use in MCP config files)
|
|
158
159
|
githits auth status Show current authentication status
|
|
160
|
+
githits example Get canonical code examples from global open source
|
|
161
|
+
githits languages List or filter supported language names
|
|
162
|
+
githits feedback Send feedback on a returned example
|
|
159
163
|
```
|
|
160
164
|
|
|
161
|
-
When
|
|
165
|
+
When the current token explicitly carries `code_navigation`, these extra commands are also available:
|
|
162
166
|
|
|
163
167
|
```
|
|
168
|
+
githits search ... Unified indexed dependency/repository search
|
|
169
|
+
githits search-status Follow up a prior indexed search
|
|
164
170
|
githits pkg ... Package metadata: overview, advisories, deps, changelog
|
|
165
171
|
githits code ... Dependency source inspection: search, files, read, grep
|
|
166
172
|
```
|
|
@@ -173,14 +179,14 @@ githits code ... Dependency source inspection: search, files, read, grep
|
|
|
173
179
|
| `GITHITS_MCP_URL` | Override MCP server URL | `https://mcp.githits.com` |
|
|
174
180
|
| `GITHITS_API_URL` | Override REST API URL | `https://api.githits.com` |
|
|
175
181
|
| `GITHITS_CODE_NAV_URL` | Override package/source service URL | environment-specific |
|
|
176
|
-
| `GITHITS_CODE_NAVIGATION` | Expose hidden `pkg` / `code`
|
|
182
|
+
| `GITHITS_CODE_NAVIGATION` | Expose hidden `search` / `pkg` / `code` CLI surfaces locally for development | — |
|
|
177
183
|
| `GITHITS_TELEMETRY` | Emit end-of-run timing spans to stderr for local profiling | — |
|
|
178
184
|
|
|
179
185
|
## Manual Setup
|
|
180
186
|
|
|
181
187
|
If your tool is not in the supported `githits init` list, configure GitHits manually.
|
|
182
188
|
|
|
183
|
-
The same MCP server command exposes both the core search tools and, when your token
|
|
189
|
+
The same MCP server command exposes both the core example-search tools and, when your token carries `code_navigation`, the indexed package/source inspection tools. No separate install is required.
|
|
184
190
|
|
|
185
191
|
Use this MCP server command in your tool's MCP config (the host/agent runs this command):
|
|
186
192
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Search for canonical code examples from open source via GitHits
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Example
|
|
6
|
+
|
|
7
|
+
Search for code examples using GitHits for the query: "$ARGUMENTS"
|
|
8
|
+
|
|
9
|
+
Use the GitHits MCP `get_example` tool with the user's query. The tool requires two
|
|
10
|
+
parameters:
|
|
11
|
+
|
|
12
|
+
- **query**: The user's search query, formulated in natural language.
|
|
13
|
+
- **language**: The programming language. If the language is unclear from
|
|
14
|
+
context, use the `search_language` tool first to find the correct language
|
|
15
|
+
name.
|
|
16
|
+
|
|
17
|
+
Optional parameter:
|
|
18
|
+
|
|
19
|
+
- **license_mode**: `"strict"` (default, excludes copyleft), `"yolo"` (all
|
|
20
|
+
licenses), or `"custom"` (user's blocklist).
|
|
21
|
+
|
|
22
|
+
Present the results clearly. After the user has reviewed the result, use the
|
|
23
|
+
`feedback` tool to report whether the example was helpful.
|
package/commands/help.md
CHANGED
|
@@ -16,7 +16,8 @@ context summary:
|
|
|
16
16
|
|
|
17
17
|
## Slash Commands
|
|
18
18
|
|
|
19
|
-
- `/githits:
|
|
19
|
+
- `/githits:example <query>` — Search for canonical code examples from open source.
|
|
20
|
+
- `/githits:search <query>` — Legacy alias for `/githits:example`.
|
|
20
21
|
- `/githits:login` — Authenticate with your GitHits account.
|
|
21
22
|
- `/githits:status` — Show your current authentication status.
|
|
22
23
|
- `/githits:logout` — Remove stored credentials.
|
|
@@ -24,14 +25,18 @@ context summary:
|
|
|
24
25
|
|
|
25
26
|
## MCP Tools
|
|
26
27
|
|
|
27
|
-
This plugin connects to the GitHits MCP server and exposes three tools:
|
|
28
|
+
This plugin connects to the GitHits MCP server and always exposes three core tools:
|
|
28
29
|
|
|
29
|
-
- **
|
|
30
|
+
- **get_example** — Find code examples by describing what you need in natural
|
|
30
31
|
language. Requires `query` and `language` parameters.
|
|
31
32
|
- **search_language** — Look up supported programming language names before
|
|
32
33
|
searching.
|
|
33
34
|
- **feedback** — Rate a search result to improve future quality.
|
|
34
35
|
|
|
36
|
+
Additional indexed dependency/package tools such as `search`, `package_summary`,
|
|
37
|
+
`list_files`, and `grep_repo` stay hidden unless the authenticated token carries
|
|
38
|
+
the `code_navigation` feature flag.
|
|
39
|
+
|
|
35
40
|
## Authentication
|
|
36
41
|
|
|
37
42
|
Run `npx -y githits login` to authenticate via browser, or set the
|
package/commands/search.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Legacy alias for GitHits example search
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Search
|
|
5
|
+
# Search (Legacy Alias)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Use GitHits example search for the query: "$ARGUMENTS"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This slash command is the older alias for `/githits:example`.
|
|
10
|
+
|
|
11
|
+
Use the GitHits MCP `get_example` tool with the user's query. The tool requires two
|
|
10
12
|
parameters:
|
|
11
13
|
|
|
12
14
|
- **query**: The user's search query, formulated in natural language.
|