Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.githits.com/llms.txt

Use this file to discover all available pages before exploring further.

The GitHits CLI exposes commands for tool setup, code example search, source navigation, package inspection, and feedback. Run commands through npx githits@latest unless you are inside an MCP config that already uses the JSON command form.

Setup and configuration

Authenticate and configure all detected AI coding tools with the GitHits MCP server. init runs the browser login flow first, then auto-detects which supported tools are installed and writes MCP configuration for each one.
npx githits@latest init
Automatic install support: Claude Code, Cursor, Windsurf, VS Code / Copilot, Cline, Claude Desktop, Codex CLI, Gemini CLI, Google Antigravity, and OpenCode.After init completes, each detected tool is configured to start the GitHits MCP server automatically. No further manual configuration is needed.Flags
-y, --yes
flag
Skip interactive prompts and configure all detected tools automatically.
--skip-login
flag
Skip the authentication step. Useful if you are already authenticated and only want to reconfigure tool integrations.
init is the default way to get started. It configures supported tools and handles authentication for common local setup.
Remove GitHits MCP configuration from all detected coding tools. Stored credentials are preserved — only the MCP config entries are removed.
npx githits@latest init uninstall
To also remove stored credentials, run npx githits@latest logout separately after uninstalling.

Authentication

Authenticate with your GitHits account via browser OAuth. Opens your default browser to complete the login flow. Tokens are stored in the system keychain by default and refreshed automatically on next use.
npx githits@latest login
Flags
--no-browser
flag
Print the authorization URL instead of opening the browser. Use this in SSH sessions, CI environments, or containers where a browser isn’t available.
--force
flag
Re-authenticate even if a valid token already exists.
--port
number
Use a specific port for the local OAuth callback server. Defaults to a random port in the 8000–9999 range.
npx githits@latest login
If authentication times out (after 5 minutes), the browser link expires. Run the command again to get a fresh link.
Remove stored OAuth credentials. After logging out, tool calls that require authentication will fail until you log in again.
npx githits@latest logout
Show current authentication status, including the credential source, storage location, and token expiry.
npx githits@latest auth status
If GITHITS_API_TOKEN is set in your environment, the command reports that source without reading local OAuth storage. If the stored token is expired, GitHits attempts to refresh it before reporting.

MCP server

Show MCP setup instructions when run interactively in a terminal. When piped or run in a non-TTY context, starts the MCP server over stdio instead.
npx githits@latest mcp
Use this command to see the JSON snippet you need to add to your tool’s MCP configuration manually.
Always start the MCP server over stdio, regardless of whether the output is a TTY. Use this command in MCP configuration files so your coding tool can launch the server reliably.
npx githits@latest mcp start
A typical MCP config entry looks like this:
MCP config
{
  "mcpServers": {
    "githits": {
      "command": "npx",
      "args": ["-y", "githits@latest", "mcp", "start"]
    }
  }
}

Code examples

Search for canonical code examples from global open-source repositories using a natural-language query.
npx githits@latest example "<query>"
Flags
--language
string
Force a specific programming language. Omit to let GitHits infer the language from your query. If you’re unsure of the exact language name, run npx githits@latest languages first.
--license-mode
string
default:"strict"
Control license filtering for Code Examples. Options: strict (default), yolo, or custom.
--explain
flag
Include an AI-generated explanation alongside the code example.
--json
flag
Output the result as JSON for piping or scripting. The envelope includes result and, when available, solution_id.
npx githits@latest example "connect to postgres with connection pooling"
List all supported programming language names. Optionally filter by a substring.
npx githits@latest languages [filter]
# List all supported languages
npx githits@latest languages

# Filter by substring
npx githits@latest languages type

Search and package navigation

Follow up on a prior npx githits@latest search using the searchRef returned in the initial response.
npx githits@latest search-status <searchRef>
Show a package overview including version, license, repository popularity, download counts, and vulnerability summary.
npx githits@latest pkg info <registry>:<package>
npx githits@latest pkg info npm:express
npx githits@latest pkg info pypi:requests --verbose
See Package Inspection for the full parameter reference.
List CVE and OSV vulnerability advisories for a package or a specific version.
npx githits@latest pkg vulns <registry>:<package>
npx githits@latest pkg vulns npm:lodash
npx githits@latest pkg vulns npm:lodash@4.17.20 --severity high
Show direct dependencies, dependency groups, and optionally the full transitive dependency graph.
npx githits@latest pkg deps <registry>:<package>
npx githits@latest pkg deps npm:express
npx githits@latest pkg deps npm:webpack --include-transitive
Retrieve release notes and changelog entries for a package or GitHub repository, newest-first.
npx githits@latest pkg changelog <registry>:<package>
npx githits@latest pkg changelog npm:express --limit 5
npx githits@latest pkg changelog --repo-url https://github.com/expressjs/express
List documentation pages available for a package.
npx githits@latest docs list <spec>
npx githits@latest docs list npm:express
npx githits@latest docs list pypi:requests --limit 20
Read a specific documentation page by its page ID.
npx githits@latest docs read <pageId>
npx githits@latest docs read <pageId> --start-line 50 --end-line 150
List the files included in an indexed package or repository.
npx githits@latest code files <spec>
npx githits@latest code files npm:express
npx githits@latest code files npm:express --path-prefix src/ --extensions ts js
Read a specific file from an indexed package or repository by path.
npx githits@latest code read <spec> <path>
npx githits@latest code read npm:express src/application.js
npx githits@latest code read npm:express src/application.js --start-line 120 --end-line 200
Search for a text pattern across the indexed files of a package or repository.
npx githits@latest code grep <spec> <pattern>
npx githits@latest code grep npm:express "Router"
npx githits@latest code grep npm:express "use\(.*middleware" --regex

Feedback

Submit feedback on a specific result or on your overall session. Use --accept for positive feedback and --reject for negative. A --message is recommended, especially for generic session feedback.
npx githits@latest feedback [solution_id] --accept | --reject [options]
Arguments
solution_id
string
Optional. The solution ID from a prior get_example result. When provided, feedback is anchored to that specific result. Omit to submit generic session feedback.
Flags
--accept
flag
Mark the result as helpful.
--reject
flag
Mark the result as unhelpful.
--message, -m
string
An explanation to accompany the feedback rating.
--tool
string
The command or MCP tool name being rated (e.g. code_grep, search).
--json
flag
Output the result as JSON for scripting or piping.
npx githits@latest feedback abc123 --accept