npx githits@latest unless you are inside an MCP config that already uses the JSON command form.
Global options
Global options can appear before any command.Setup and configuration
npx githits@latest init
Authenticate and configure GitHits for supported AI coding tools.
npx githits@latest init
Authenticate and configure GitHits for supported AI coding tools.
init runs the browser login flow first, then auto-detects which supported tools are installed and writes MCP configuration for each one.init performs a guided MCP setup: alongside the MCP server config, it drops the four GitHits Agent Skills (githits-onboarding, githits-mcp, githits-code, and githits-package) and a managed instruction block (delimited by <!-- githits --> markers in files like AGENTS.md, CLAUDE.md, or GEMINI.md) into each selected tool. The skills and instructions help the agent decide when to reach for GitHits without bloating its base context. Rerunning guided init repairs any missing skill files. Interactive setup, --yes, and staged --install-agents all default to guided MCP unless --no-guidance is passed. Pass --no-guidance for a plain MCP-only install.After init completes, each detected tool is configured to start the GitHits MCP server automatically. No further manual configuration is needed.Flags--no-guidance is set.--detect-agents. Defaults to guided MCP unless --no-guidance is set.--detect-agents or --install-agents.8765). Useful when running init on a remote machine and forwarding the callback over SSH, for example ssh -N -L 8765:127.0.0.1:8765 user@remote-host.npx githits@latest uninstall
Remove GitHits MCP configuration and guidance from detected coding tools.
npx githits@latest uninstall
Remove GitHits MCP configuration and guidance from detected coding tools.
<!-- githits --> markers) is removed from files like AGENTS.md, CLAUDE.md, and GEMINI.md, and all four GitHits skills (githits-code, githits-mcp, githits-onboarding, and githits-package) are deleted from tool-native and shared skill folders, including stale copies left by earlier versions. Unrelated skills and directories are preserved. Stored credentials are preserved — only MCP config, guidance blocks, and skill files are removed.uninstall first asks whether to remove user-level or project-level configuration. githits init uninstall remains supported as a compatibility alias with the same flags and behavior.Flags--project for non-interactive project-level removal.npx githits@latest logout separately after uninstalling.npx githits@latest doctor
Diagnose GitHits configuration and authentication state.
npx githits@latest doctor
Diagnose GitHits configuration and authentication state.
Authentication
npx githits@latest login
Log in to your GitHits account with browser OAuth.
npx githits@latest login
Log in to your GitHits account with browser OAuth.
--port and an SSH tunnel.npx githits@latest logout
Remove stored OAuth credentials from this machine.
npx githits@latest logout
Remove stored OAuth credentials from this machine.
npx githits@latest auth status
Check the current authentication status and credential source.
npx githits@latest auth status
Check the current authentication status and credential source.
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.npx githits@latest auth token
Print the current bearer token for scripts and command substitution.
npx githits@latest auth token
Print the current bearer token for scripts and command substitution.
- If
GITHITS_API_TOKENis set, its value is printed as-is without reading local OAuth storage. - Otherwise, the stored OAuth token is read from the system keychain. If it is expired, GitHits refreshes it on demand and prints the new access token.
GITHITS_API_TOKEN nor stored OAuth credentials), the command exits non-zero with a clear message instead of starting an interactive login. This keeps automated scripts predictable — run npx githits@latest login once on the machine before relying on auth token.Scripting exampleUse command substitution to hand the current session token off to another tool:npx githits@latest settings
View and update account preferences, privacy, terms, and limits.
npx githits@latest settings
View and update account preferences, privacy, terms, and limits.
settings show print the full canonical settings object: preferences (default language, license mode, blocked license IDs), privacy and terms (marketing emails, Terms of Service acceptance state), and account limits.get, set, and clear subcommands to read or update individual settings using their public CLI names. Every mutation sends exactly one selective PATCH, so unrelated settings are never touched.Supported keysdefault-language-id and blocked-license-ids can be cleared. clear default-language-id unsets the default; clear blocked-license-ids replaces the list with an empty list.npx githits@latest settings get
Read one writable account setting.
npx githits@latest settings get
Read one writable account setting.
npx githits@latest settings set
Update one account setting.
npx githits@latest settings set
Update one account setting.
default-language-id, license-mode, blocked-license-ids, or marketing-emails.blocked-license-ids accepts one or more UUIDs and replaces the stored list atomically; all other keys take exactly one value.npx githits@latest settings clear
Clear the default language or blocked license IDs.
npx githits@latest settings clear
Clear the default language or blocked license IDs.
clear default-language-id sends an explicit null; clear blocked-license-ids replaces the list with an empty list.default-language-id or blocked-license-ids. Other keys cannot be cleared and must be updated with settings set.npx githits@latest settings terms
Show Terms of Service acceptance status.
npx githits@latest settings terms
Show Terms of Service acceptance status.
{"terms_required": boolean} as JSON.npx githits@latest settings terms accept
Accept the current Terms of Service.
npx githits@latest settings terms accept
Accept the current Terms of Service.
--yes for non-interactive use.ghi-* API tokens set via GITHITS_API_TOKEN. When acceptance succeeds on an OAuth session, GitHits force-refreshes the stored session so subsequent requests carry the updated terms claim. Static API tokens are not refreshed; their acceptance state is re-evaluated server-side on the next request.If acceptance succeeds but the OAuth refresh fails, the command reports the saved acceptance and asks you to run npx githits@latest login --force before retrying other commands.Flagsaccepted, token_refreshed, and the updated settings object.MCP server
npx githits@latest mcp
Show manual MCP setup instructions or start stdio mode in non-TTY contexts.
npx githits@latest mcp
Show manual MCP setup instructions or start stdio mode in non-TTY contexts.
npx githits@latest mcp start
Start the GitHits MCP server over stdio for coding tool configs.
npx githits@latest mcp start
Start the GitHits MCP server over stdio for coding tool configs.
Search, code, package, and docs tools
npx githits@latest search
Search indexed package or repository code, docs, and symbols.
npx githits@latest search
Search indexed package or repository code, docs, and symbols.
searchRef you can pass to npx githits@latest search-status to poll for additional results from an async index scan.Flagsnpm:react@18.2.0 or npm:react. Repository formats include github:owner/repo#ref and https://github.com/owner/repo#ref.docs, code, or symbol. Omit to let GitHits choose the best indexed sources.function, method, class, interface, module, or doc_section.callable, type, module, data, or documentation.production, test, benchmark, example, generated, fixture, build, or vendor.searchRef (0-60, default 20).npx githits@latest search-status
Poll a prior async indexed search by its searchRef.
npx githits@latest search-status
Poll a prior async indexed search by its searchRef.
npx githits@latest code files
List files in an indexed package or repository.
npx githits@latest code files
List files in an indexed package or repository.
--repo-url.npx githits@latest code read
Read a specific indexed source file by path.
npx githits@latest code read
Read a specific indexed source file by path.
--repo-url.120-200. You can also append :120-200 to the file path.npx githits@latest code grep
Search indexed source files with literal text or regex.
npx githits@latest code grep
Search indexed source files with literal text or regex.
--repo-url.npx githits@latest pkg info
Inspect package metadata, popularity, downloads, and vulnerability status.
npx githits@latest pkg info
Inspect package metadata, popularity, downloads, and vulnerability status.
npx githits@latest pkg vulns
List known CVE and OSV advisories for a package or version.
npx githits@latest pkg vulns
List known CVE and OSV advisories for a package or version.
low, medium, high, or critical.affected (default), non_affecting, or all.npx githits@latest pkg deps
Show direct dependencies and optional transitive dependency details.
npx githits@latest pkg deps
Show direct dependencies and optional transitive dependency details.
runtime, development, build, peer, optional, or all.npx githits@latest pkg changelog
Retrieve release notes or changelog entries for packages and repos.
npx githits@latest pkg changelog
Retrieve release notes or changelog entries for packages and repos.
--to or latest. Range mode has no count cap and cannot be combined with --limit.--from is set.npx githits@latest pkg upgrade-review
Compare package versions with security, changelog, and dependency evidence.
npx githits@latest pkg upgrade-review
Compare package versions with security, changelog, and dependency evidence.
<registry>:<name>@<current>..<target> format. Repeat the flag for multiple packages.low, medium, high, or critical.npx githits@latest docs list
List hosted and repo-backed documentation pages for a package.
npx githits@latest docs list
List hosted and repo-backed documentation pages for a package.
Code examples
npx githits@latest example
Find implementation examples from real open-source usage.
npx githits@latest example
Find implementation examples from real open-source usage.
npx githits@latest languages first.strict (default), yolo, or custom.result and, when available, solution_id.npx githits@latest languages
List or filter supported programming language names.
npx githits@latest languages
List or filter supported programming language names.
Feedback
npx githits@latest feedback
Rate a specific result or submit generic session feedback.
npx githits@latest feedback
Rate a specific result or submit generic session feedback.
--accept for positive feedback and --reject for negative. A --message is recommended, especially for generic session feedback.get_example result. When provided, feedback is anchored to that specific result. Omit to submit generic session feedback.code_grep, search).Experimental (opt-in)
The commands in this section are disabled and hidden from help by default. Enable them by settingtools = true under the [experimental] section of config.toml. See Experimental tools for the full description, availability constraints, and issue-reporting guidance.
npx githits@latest resolve
Rank canonical package, repository, or documentation-site targets for a fuzzy name.
npx githits@latest resolve
Rank canonical package, repository, or documentation-site targets for a fuzzy name.
npm:express, github:openai/codex, or site:docs.example.com/sdk. Use it before calling another GitHits command when the input is not already canonical. Already-canonical package, repository, and site targets are rejected locally with INVALID_ARGUMENT guidance; pass them directly to the next GitHits command instead.EXACT or HIGH confidence, and its latest-version malicious-content status is clear or not_applicable. Non-ambiguous MEDIUM or LOW results are labeled as unconfirmed ranked candidates. Ambiguous results preserve the existing choose-or-narrow guidance.Affected or uncertain malicious-content decisions render a red warning that links the relevant MAL-* advisories on OSV and suppress the normal next-command handoff. See malicious-content gating for the full status semantics.Flagspackage, repository, or site. Soft preference, not a filter.--query.{best?, ambiguous, ambiguousReason?, candidates, protectedMatches}. best is absent whenever there are no candidates.1 when there are no candidates because the command did not resolve a target.npx githits@latest code diff
Compare repository trees resolved from two package versions or refs.
npx githits@latest code diff
Compare repository trees resolved from two package versions or refs.
<from>..<to> range.--patch, --name-only, and --name-status.--patch view. No client default.-- to narrow paths without changing scope. Three-dot merge-base syntax and --git-ref are rejected.Empty authoritative diffs and caller-selected truncations exit 0 with warnings on stderr. Unexpectedly incomplete plain patches are suppressed and exit 1; the --stat, --name-only, --name-status, and JSON views preserve their structured partial evidence.