githits 0.1.7 → 0.1.8
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 +26 -0
- package/.claude-plugin/plugin.json +12 -0
- package/.mcp.json +8 -0
- package/.plugin/plugin.json +12 -0
- package/GEMINI.md +75 -0
- package/README.md +93 -0
- package/commands/help.md +46 -0
- package/commands/login.md +36 -0
- package/commands/logout.md +16 -0
- package/commands/search.md +23 -0
- package/commands/status.md +22 -0
- package/dist/cli.js +3 -8
- package/dist/index.js +1 -1
- package/dist/shared/{chunk-hg653b0a.js → chunk-6w8an8m7.js} +1 -1
- package/gemini-extension.json +12 -0
- package/package.json +10 -2
- package/plugins/claude/.claude-plugin/plugin.json +12 -0
- package/plugins/claude/.mcp.json +8 -0
- package/plugins/claude/commands/help.md +46 -0
- package/plugins/claude/commands/login.md +36 -0
- package/plugins/claude/commands/logout.md +16 -0
- package/plugins/claude/commands/search.md +23 -0
- package/plugins/claude/commands/status.md +22 -0
- package/plugins/claude/skills/search/SKILL.md +36 -0
- package/skills/search/SKILL.md +36 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "githits-plugins",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "GitHits",
|
|
5
|
+
"email": "support@githits.com"
|
|
6
|
+
},
|
|
7
|
+
"metadata": {
|
|
8
|
+
"description": "GitHits plugins for Claude Code - code examples from global open source",
|
|
9
|
+
"version": "0.1.8"
|
|
10
|
+
},
|
|
11
|
+
"plugins": [
|
|
12
|
+
{
|
|
13
|
+
"name": "githits",
|
|
14
|
+
"source": "./plugins/claude",
|
|
15
|
+
"description": "Code examples from global open source for developers and AI assistants",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "GitHits"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://githits.com",
|
|
20
|
+
"repository": "https://github.com/githits-com/githits-cli",
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
|
+
"keywords": ["code-search", "open-source", "examples"],
|
|
23
|
+
"category": "developer-tools"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "githits",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Code examples from global open source for developers and AI assistants",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "GitHits"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://githits.com",
|
|
9
|
+
"repository": "https://github.com/githits-com/githits-cli",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"keywords": ["githits", "code-examples", "search", "mcp", "ai"]
|
|
12
|
+
}
|
package/.mcp.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "githits",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Code examples from global open source for developers and AI assistants",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "GitHits"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://githits.com",
|
|
9
|
+
"repository": "https://github.com/githits-com/githits-cli",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"keywords": ["githits", "code-examples", "search", "mcp", "ai"]
|
|
12
|
+
}
|
package/GEMINI.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# GitHits
|
|
2
|
+
|
|
3
|
+
Code examples from global open source for developers and AI assistants.
|
|
4
|
+
|
|
5
|
+
## Available Tools
|
|
6
|
+
|
|
7
|
+
### search
|
|
8
|
+
|
|
9
|
+
Find code examples from open source repositories.
|
|
10
|
+
|
|
11
|
+
**Parameters:**
|
|
12
|
+
|
|
13
|
+
- `query` (string, required) - natural language description of what you need
|
|
14
|
+
- `language` (string, required) - programming language name (use `search_language` to verify)
|
|
15
|
+
- `license_mode` (string, optional) - one of `strict` (default), `yolo`, or `custom`
|
|
16
|
+
|
|
17
|
+
### search_language
|
|
18
|
+
|
|
19
|
+
Look up supported programming language names. Use this before calling `search` to get the correct language identifier.
|
|
20
|
+
|
|
21
|
+
**Parameters:**
|
|
22
|
+
|
|
23
|
+
- `query` (string, required) - partial or full language name to look up
|
|
24
|
+
|
|
25
|
+
### feedback
|
|
26
|
+
|
|
27
|
+
Rate a search result. Submit feedback after each search to improve future result quality.
|
|
28
|
+
|
|
29
|
+
**Parameters:**
|
|
30
|
+
|
|
31
|
+
- `solution_id` (string, required) - the ID of the search result
|
|
32
|
+
- `accepted` (boolean, required) - whether the result was useful
|
|
33
|
+
- `feedback_text` (string, optional) - additional context about why the result was or was not helpful
|
|
34
|
+
|
|
35
|
+
## When to Use
|
|
36
|
+
|
|
37
|
+
Use `search` when:
|
|
38
|
+
|
|
39
|
+
- You are stuck or blocked on an implementation problem
|
|
40
|
+
- You need up-to-date examples for an API, library, or framework
|
|
41
|
+
- The user mentions GitHits or asks you to search for code examples
|
|
42
|
+
- You encounter an error you cannot resolve from your training data
|
|
43
|
+
|
|
44
|
+
Do not use `search` for:
|
|
45
|
+
|
|
46
|
+
- General knowledge questions that do not require code examples
|
|
47
|
+
- Problems you can already solve confidently
|
|
48
|
+
|
|
49
|
+
## Authentication
|
|
50
|
+
|
|
51
|
+
- If any GitHits tool returns an authentication error, immediately run
|
|
52
|
+
`npx -y githits login` in the terminal. This opens the user's browser for
|
|
53
|
+
quick OAuth approval. Wait for the command to complete, then retry the
|
|
54
|
+
original tool call.
|
|
55
|
+
- If the environment has no display (SSH, containers), use
|
|
56
|
+
`npx -y githits login --no-browser` instead, which prints a URL for the
|
|
57
|
+
user to open on another device.
|
|
58
|
+
- Do NOT ask the user to run login manually - handle it automatically.
|
|
59
|
+
- If login fails, inform the user of the error.
|
|
60
|
+
|
|
61
|
+
## How to Search Well
|
|
62
|
+
|
|
63
|
+
- Call `search_language` first to confirm the correct language name before calling `search`
|
|
64
|
+
- Formulate queries as natural language questions (e.g., "How to stream responses with the Vercel AI SDK in Next.js")
|
|
65
|
+
- Include specific error messages, library names, or API names when relevant
|
|
66
|
+
- Keep queries focused: 3-4 technical terms maximum
|
|
67
|
+
- Submit `feedback` after every search result you use or discard
|
|
68
|
+
|
|
69
|
+
## License Filtering
|
|
70
|
+
|
|
71
|
+
Results respect license filtering by default. Three modes:
|
|
72
|
+
|
|
73
|
+
- **strict** (default) - excludes copyleft licenses
|
|
74
|
+
- **yolo** - includes all licenses
|
|
75
|
+
- **custom** - uses the user's blocklist configured at githits.com
|
package/README.md
CHANGED
|
@@ -14,6 +14,74 @@ npx githits init
|
|
|
14
14
|
|
|
15
15
|
Supported tools: Claude Code, Cursor, Windsurf, VS Code / Copilot, Cline, Claude Desktop, Codex CLI, Gemini CLI, and Google Antigravity.
|
|
16
16
|
|
|
17
|
+
If you are using a tool that is not listed above, use the manual MCP setup instructions near the end of this README.
|
|
18
|
+
|
|
19
|
+
### Plugin Installation (Open Plugin standard)
|
|
20
|
+
|
|
21
|
+
The npm package includes Open Plugin-compatible files:
|
|
22
|
+
|
|
23
|
+
- `.plugin/plugin.json` (vendor-neutral, used by Cursor/Codex/Copilot-compatible hosts)
|
|
24
|
+
- `.claude-plugin/plugin.json` (Claude Code compatibility)
|
|
25
|
+
- `.claude-plugin/marketplace.json` (Claude Code marketplace catalog)
|
|
26
|
+
- `.mcp.json` (Open Plugin MCP server config for plugin hosts)
|
|
27
|
+
- `plugins/claude/` (Claude plugin runtime payload: `.claude-plugin/plugin.json`, `.mcp.json`, `skills/`, and `commands/`)
|
|
28
|
+
|
|
29
|
+
Root `.claude-plugin/marketplace.json` provides marketplace metadata. Claude Code
|
|
30
|
+
loads the plugin runtime payload from `plugins/claude/`.
|
|
31
|
+
|
|
32
|
+
**Claude Code Plugin (Marketplace)**
|
|
33
|
+
|
|
34
|
+
Install from terminal (recommended):
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
claude plugin marketplace add githits-com/githits-cli
|
|
38
|
+
claude plugin install githits@githits-plugins
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This is preferred over in-session install so the plugin is loaded cleanly on
|
|
42
|
+
next `claude` launch.
|
|
43
|
+
|
|
44
|
+
Alternative (inside Claude input):
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
/plugin marketplace add githits-com/githits-cli
|
|
48
|
+
/plugin install githits@githits-plugins
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If installed inside a running Claude session, reload/restart Claude if the
|
|
52
|
+
plugin is not immediately available.
|
|
53
|
+
|
|
54
|
+
For unpublished/local testing of this repository:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
claude plugin marketplace add "$PWD"
|
|
58
|
+
claude plugin install githits@githits-plugins
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
By default, the plugin starts MCP with `npx -y githits@latest mcp start` so installs track the latest published GitHits CLI.
|
|
62
|
+
|
|
63
|
+
For unpublished/local testing, install from your local repository path and verify behavior in your host before publishing.
|
|
64
|
+
|
|
65
|
+
In Claude Code, run `/mcp` and confirm `plugin:githits:githits` is listed for the plugin path.
|
|
66
|
+
|
|
67
|
+
Note: when running Claude in this repository directory, root `.mcp.json` can also register `githits` for project-level MCP. For plugin-only attribution during testing, run Claude from a different working directory.
|
|
68
|
+
|
|
69
|
+
**Gemini CLI extension install**
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
gemini extensions install https://github.com/githits-com/githits-cli
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
For plugin-based hosts, install from npm/GitHub using your agent's plugin workflow and enable plugin `githits`.
|
|
76
|
+
|
|
77
|
+
### Agent Coverage
|
|
78
|
+
|
|
79
|
+
- **Cursor**: reads vendor-neutral `.plugin/` for Open Plugin installs
|
|
80
|
+
- **Claude Code**: supports `.claude-plugin/` and Open Plugin components
|
|
81
|
+
- **Codex**: supports Open Plugin components
|
|
82
|
+
- **GitHub Copilot**: supports Open Plugin components
|
|
83
|
+
- **Gemini CLI**: supports `gemini-extension.json` and `GEMINI.md`
|
|
84
|
+
|
|
17
85
|
That's it. Your assistant now has a `search` tool it will use automatically when it needs code examples.
|
|
18
86
|
|
|
19
87
|
## How It Works
|
|
@@ -81,6 +149,31 @@ githits auth status Show current authentication status
|
|
|
81
149
|
| `GITHITS_MCP_URL` | Override MCP server URL | `https://mcp.githits.com` |
|
|
82
150
|
| `GITHITS_API_URL` | Override REST API URL | `https://api.githits.com` |
|
|
83
151
|
|
|
152
|
+
## Manual Setup
|
|
153
|
+
|
|
154
|
+
If your tool is not in the supported `githits init` list, configure GitHits manually.
|
|
155
|
+
|
|
156
|
+
Use this MCP server command in your tool's MCP config (the host/agent runs this command):
|
|
157
|
+
|
|
158
|
+
```sh
|
|
159
|
+
npx -y githits@latest mcp start
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
A typical MCP config looks like this (check your tool's docs for exact schema/key names):
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"mcpServers": {
|
|
167
|
+
"githits": {
|
|
168
|
+
"command": "npx",
|
|
169
|
+
"args": ["-y", "githits@latest", "mcp", "start"]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
If you'd like another tool to be included in `githits init` for auto-configuration, open an issue or PR.
|
|
176
|
+
|
|
84
177
|
## Development
|
|
85
178
|
|
|
86
179
|
```sh
|
package/commands/help.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show available GitHits commands and usage
|
|
3
|
+
disable-model-invocation: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitHits Help
|
|
7
|
+
|
|
8
|
+
Run the GitHits CLI help command in the terminal:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npx -y githits help
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then display the command output clearly to the user, followed by this plugin
|
|
15
|
+
context summary:
|
|
16
|
+
|
|
17
|
+
## Slash Commands
|
|
18
|
+
|
|
19
|
+
- `/githits:search <query>` — Search for code examples from open source.
|
|
20
|
+
- `/githits:login` — Authenticate with your GitHits account.
|
|
21
|
+
- `/githits:status` — Show your current authentication status.
|
|
22
|
+
- `/githits:logout` — Remove stored credentials.
|
|
23
|
+
- `/githits:help` — Show this help message.
|
|
24
|
+
|
|
25
|
+
## MCP Tools
|
|
26
|
+
|
|
27
|
+
This plugin connects to the GitHits MCP server and exposes three tools:
|
|
28
|
+
|
|
29
|
+
- **search** — Find code examples by describing what you need in natural
|
|
30
|
+
language. Requires `query` and `language` parameters.
|
|
31
|
+
- **search_language** — Look up supported programming language names before
|
|
32
|
+
searching.
|
|
33
|
+
- **feedback** — Rate a search result to improve future quality.
|
|
34
|
+
|
|
35
|
+
## Authentication
|
|
36
|
+
|
|
37
|
+
Run `npx -y githits login` to authenticate via browser, or set the
|
|
38
|
+
`GITHITS_API_TOKEN` environment variable for headless environments.
|
|
39
|
+
|
|
40
|
+
If users want to verify MCP tools loaded, suggest `/mcp`.
|
|
41
|
+
|
|
42
|
+
If the command fails, report the error and suggest running:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npx -y githits login
|
|
46
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Log in to your GitHits account
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Login
|
|
6
|
+
|
|
7
|
+
Authenticate the user with GitHits by running the CLI login command in the
|
|
8
|
+
terminal:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npx -y githits login
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This opens the user's browser for secure OAuth authentication. Tokens are stored
|
|
15
|
+
locally and refreshed automatically.
|
|
16
|
+
|
|
17
|
+
If the environment has no display (SSH, CI, containers), use the `--no-browser`
|
|
18
|
+
flag instead:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npx -y githits login --no-browser
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This prints a URL the user can open on another device.
|
|
25
|
+
|
|
26
|
+
Other useful flags:
|
|
27
|
+
|
|
28
|
+
- `--force` — re-authenticate even if already logged in.
|
|
29
|
+
- `--port <port>` — use a specific port for the local callback server.
|
|
30
|
+
|
|
31
|
+
After running the command, inform the user of the result. If login succeeds,
|
|
32
|
+
confirm they are authenticated. If it fails, provide the error and suggest they
|
|
33
|
+
try again.
|
|
34
|
+
|
|
35
|
+
Alternative: the user can set the `GITHITS_API_TOKEN` environment variable
|
|
36
|
+
instead of using browser login.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Log out of your GitHits account
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Logout
|
|
6
|
+
|
|
7
|
+
Sign the user out of GitHits by running the CLI logout command in the terminal:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npx -y githits logout
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This removes the locally stored authentication tokens.
|
|
14
|
+
|
|
15
|
+
Confirm to the user that they have been logged out successfully. If the logout
|
|
16
|
+
fails, provide the error details.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Search for code examples from open source via GitHits
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Search
|
|
6
|
+
|
|
7
|
+
Search for code examples using GitHits for the query: "$ARGUMENTS"
|
|
8
|
+
|
|
9
|
+
Use the GitHits MCP `search` 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.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show your GitHits authentication status
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Status
|
|
6
|
+
|
|
7
|
+
Check the user's current GitHits authentication status by running the CLI
|
|
8
|
+
command in the terminal:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npx -y githits auth status
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This shows whether the user is authenticated, where credentials are sourced
|
|
15
|
+
from, and token expiry details when available.
|
|
16
|
+
|
|
17
|
+
After running the command, report the status clearly. If the user is not
|
|
18
|
+
authenticated, suggest running:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npx -y githits login
|
|
22
|
+
```
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
version
|
|
4
|
-
} from "./shared/chunk-
|
|
4
|
+
} from "./shared/chunk-6w8an8m7.js";
|
|
5
5
|
|
|
6
6
|
// src/cli.ts
|
|
7
7
|
import { Command } from "commander";
|
|
@@ -1534,12 +1534,7 @@ var claudeCode = {
|
|
|
1534
1534
|
commands: [
|
|
1535
1535
|
{
|
|
1536
1536
|
command: "claude",
|
|
1537
|
-
args: [
|
|
1538
|
-
"plugin",
|
|
1539
|
-
"marketplace",
|
|
1540
|
-
"add",
|
|
1541
|
-
"githits-com/githits-claude-code-plugin"
|
|
1542
|
-
]
|
|
1537
|
+
args: ["plugin", "marketplace", "add", "githits-com/githits-cli"]
|
|
1543
1538
|
},
|
|
1544
1539
|
{
|
|
1545
1540
|
command: "claude",
|
|
@@ -1692,7 +1687,7 @@ var geminiCli = {
|
|
|
1692
1687
|
args: [
|
|
1693
1688
|
"extensions",
|
|
1694
1689
|
"install",
|
|
1695
|
-
"https://github.com/githits-com/githits-
|
|
1690
|
+
"https://github.com/githits-com/githits-cli"
|
|
1696
1691
|
]
|
|
1697
1692
|
}
|
|
1698
1693
|
],
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "githits",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Code examples from global open source for developers and AI assistants.",
|
|
5
|
+
"mcpServers": {
|
|
6
|
+
"githits": {
|
|
7
|
+
"command": "npx",
|
|
8
|
+
"args": ["-y", "githits@latest", "mcp", "start"]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"contextFileName": "GEMINI.md"
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "githits",
|
|
3
3
|
"description": "CLI companion for GitHits - code examples from global open source for developers and AI assistants",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
8
|
-
"LICENSE"
|
|
8
|
+
"LICENSE",
|
|
9
|
+
".plugin",
|
|
10
|
+
".claude-plugin",
|
|
11
|
+
".mcp.json",
|
|
12
|
+
"gemini-extension.json",
|
|
13
|
+
"GEMINI.md",
|
|
14
|
+
"plugins",
|
|
15
|
+
"skills",
|
|
16
|
+
"commands"
|
|
9
17
|
],
|
|
10
18
|
"module": "./dist/index.js",
|
|
11
19
|
"types": "./dist/index.d.ts",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "githits",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Code examples from global open source for developers and AI assistants",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "GitHits"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://githits.com",
|
|
9
|
+
"repository": "https://github.com/githits-com/githits-cli",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"keywords": ["githits", "code-examples", "search", "mcp", "ai"]
|
|
12
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show available GitHits commands and usage
|
|
3
|
+
disable-model-invocation: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitHits Help
|
|
7
|
+
|
|
8
|
+
Run the GitHits CLI help command in the terminal:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npx -y githits help
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then display the command output clearly to the user, followed by this plugin
|
|
15
|
+
context summary:
|
|
16
|
+
|
|
17
|
+
## Slash Commands
|
|
18
|
+
|
|
19
|
+
- `/githits:search <query>` — Search for code examples from open source.
|
|
20
|
+
- `/githits:login` — Authenticate with your GitHits account.
|
|
21
|
+
- `/githits:status` — Show your current authentication status.
|
|
22
|
+
- `/githits:logout` — Remove stored credentials.
|
|
23
|
+
- `/githits:help` — Show this help message.
|
|
24
|
+
|
|
25
|
+
## MCP Tools
|
|
26
|
+
|
|
27
|
+
This plugin connects to the GitHits MCP server and exposes three tools:
|
|
28
|
+
|
|
29
|
+
- **search** — Find code examples by describing what you need in natural
|
|
30
|
+
language. Requires `query` and `language` parameters.
|
|
31
|
+
- **search_language** — Look up supported programming language names before
|
|
32
|
+
searching.
|
|
33
|
+
- **feedback** — Rate a search result to improve future quality.
|
|
34
|
+
|
|
35
|
+
## Authentication
|
|
36
|
+
|
|
37
|
+
Run `npx -y githits login` to authenticate via browser, or set the
|
|
38
|
+
`GITHITS_API_TOKEN` environment variable for headless environments.
|
|
39
|
+
|
|
40
|
+
If users want to verify MCP tools loaded, suggest `/mcp`.
|
|
41
|
+
|
|
42
|
+
If the command fails, report the error and suggest running:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npx -y githits login
|
|
46
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Log in to your GitHits account
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Login
|
|
6
|
+
|
|
7
|
+
Authenticate the user with GitHits by running the CLI login command in the
|
|
8
|
+
terminal:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npx -y githits login
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This opens the user's browser for secure OAuth authentication. Tokens are stored
|
|
15
|
+
locally and refreshed automatically.
|
|
16
|
+
|
|
17
|
+
If the environment has no display (SSH, CI, containers), use the `--no-browser`
|
|
18
|
+
flag instead:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npx -y githits login --no-browser
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This prints a URL the user can open on another device.
|
|
25
|
+
|
|
26
|
+
Other useful flags:
|
|
27
|
+
|
|
28
|
+
- `--force` — re-authenticate even if already logged in.
|
|
29
|
+
- `--port <port>` — use a specific port for the local callback server.
|
|
30
|
+
|
|
31
|
+
After running the command, inform the user of the result. If login succeeds,
|
|
32
|
+
confirm they are authenticated. If it fails, provide the error and suggest they
|
|
33
|
+
try again.
|
|
34
|
+
|
|
35
|
+
Alternative: the user can set the `GITHITS_API_TOKEN` environment variable
|
|
36
|
+
instead of using browser login.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Log out of your GitHits account
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Logout
|
|
6
|
+
|
|
7
|
+
Sign the user out of GitHits by running the CLI logout command in the terminal:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npx -y githits logout
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This removes the locally stored authentication tokens.
|
|
14
|
+
|
|
15
|
+
Confirm to the user that they have been logged out successfully. If the logout
|
|
16
|
+
fails, provide the error details.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Search for code examples from open source via GitHits
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Search
|
|
6
|
+
|
|
7
|
+
Search for code examples using GitHits for the query: "$ARGUMENTS"
|
|
8
|
+
|
|
9
|
+
Use the GitHits MCP `search` 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.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show your GitHits authentication status
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Status
|
|
6
|
+
|
|
7
|
+
Check the user's current GitHits authentication status by running the CLI
|
|
8
|
+
command in the terminal:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npx -y githits auth status
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This shows whether the user is authenticated, where credentials are sourced
|
|
15
|
+
from, and token expiry details when available.
|
|
16
|
+
|
|
17
|
+
After running the command, report the status clearly. If the user is not
|
|
18
|
+
authenticated, suggest running:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npx -y githits login
|
|
22
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search
|
|
3
|
+
description:
|
|
4
|
+
Use GitHits MCP tools to find real-world code examples when model knowledge
|
|
5
|
+
is insufficient.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use GitHits when:
|
|
9
|
+
|
|
10
|
+
- You are blocked, uncertain about an API, or need up-to-date OSS usage.
|
|
11
|
+
- You have attempted a solution twice and it still fails - search for a working example before trying again.
|
|
12
|
+
- The user asks to search for examples or explicitly mentions GitHits.
|
|
13
|
+
- You are implementing non-trivial code in languages where confidence is lower.
|
|
14
|
+
|
|
15
|
+
Authentication:
|
|
16
|
+
|
|
17
|
+
- If any GitHits tool returns an authentication error, immediately run
|
|
18
|
+
`npx -y githits login` in the terminal. This opens the user's browser for
|
|
19
|
+
quick OAuth approval. Wait for the command to complete, then retry the
|
|
20
|
+
original tool call.
|
|
21
|
+
- If the environment has no display (SSH, containers), use
|
|
22
|
+
`npx -y githits login --no-browser` instead, which prints a URL for the
|
|
23
|
+
user to open on another device.
|
|
24
|
+
- Do NOT ask the user to run login manually -- handle it automatically.
|
|
25
|
+
- If login fails, inform the user of the error and suggest they set the
|
|
26
|
+
`GITHITS_API_TOKEN` environment variable as an alternative.
|
|
27
|
+
|
|
28
|
+
Guidelines:
|
|
29
|
+
|
|
30
|
+
- Prefer existing search context if it already answers the problem.
|
|
31
|
+
- Use `search_language` first when language naming is uncertain.
|
|
32
|
+
- Use `search` for one focused question at a time.
|
|
33
|
+
- After using results, send `feedback` with helpful/unhelpful outcome.
|
|
34
|
+
|
|
35
|
+
Tool argument details and rich query guidance are provided directly in the MCP
|
|
36
|
+
tool descriptions; follow those descriptions as the source of truth.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search
|
|
3
|
+
description:
|
|
4
|
+
Use GitHits MCP tools to find real-world code examples when model knowledge
|
|
5
|
+
is insufficient.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use GitHits when:
|
|
9
|
+
|
|
10
|
+
- You are blocked, uncertain about an API, or need up-to-date OSS usage.
|
|
11
|
+
- You have attempted a solution twice and it still fails - search for a working example before trying again.
|
|
12
|
+
- The user asks to search for examples or explicitly mentions GitHits.
|
|
13
|
+
- You are implementing non-trivial code in languages where confidence is lower.
|
|
14
|
+
|
|
15
|
+
Authentication:
|
|
16
|
+
|
|
17
|
+
- If any GitHits tool returns an authentication error, immediately run
|
|
18
|
+
`npx -y githits login` in the terminal. This opens the user's browser for
|
|
19
|
+
quick OAuth approval. Wait for the command to complete, then retry the
|
|
20
|
+
original tool call.
|
|
21
|
+
- If the environment has no display (SSH, containers), use
|
|
22
|
+
`npx -y githits login --no-browser` instead, which prints a URL for the
|
|
23
|
+
user to open on another device.
|
|
24
|
+
- Do NOT ask the user to run login manually -- handle it automatically.
|
|
25
|
+
- If login fails, inform the user of the error and suggest they set the
|
|
26
|
+
`GITHITS_API_TOKEN` environment variable as an alternative.
|
|
27
|
+
|
|
28
|
+
Guidelines:
|
|
29
|
+
|
|
30
|
+
- Prefer existing search context if it already answers the problem.
|
|
31
|
+
- Use `search_language` first when language naming is uncertain.
|
|
32
|
+
- Use `search` for one focused question at a time.
|
|
33
|
+
- After using results, send `feedback` with helpful/unhelpful outcome.
|
|
34
|
+
|
|
35
|
+
Tool argument details and rich query guidance are provided directly in the MCP
|
|
36
|
+
tool descriptions; follow those descriptions as the source of truth.
|