githits 0.1.7 → 0.1.9
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 +123 -2
- 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 +7802 -695
- package/dist/index.js +1 -1
- package/dist/shared/{chunk-hg653b0a.js → chunk-ey1zffpv.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
package/dist/index.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "githits",
|
|
3
|
+
"version": "0.1.9",
|
|
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.9",
|
|
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.9",
|
|
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.
|