# Compare two exact source trees Source: https://docs.githits.com/api-reference/v1/code-diff/compare-two-exact-source-trees https://api.githits.dev/v1/openapi.json post /v1/code/diff Compare source changes between two package versions or two refs in a public repository. The response lists changed files and can include added and deleted line counts and patches. Use this endpoint to inspect the code behind a release or upgrade. Comparisons cover the whole repository, including when you identify it through a package. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `files` | Identity/status fields and content safety; inventory only | No | | `files.stats` | Adds nullable additions/deletions; implies `files` and requests stats | No | | `files.patch` | Adds nullable patch and omission reason; implies stats and requests patches | Yes | Failures use a stable problem document. When supplied by the source, optional recovery hints identify the failed `side`, retryability, published versions, and ordered source ref/version alternatives. Missing hints are omitted. Classified user-facing errors use nonempty REST-suitable source guidance as detail; otherwise gateway text is used. Internal diagnostics remain private. Detail wording is not stable; use code and recovery fields. Unsupported package registries or repository providers return 422 `UNSUPPORTED_REGISTRY`; legally blocked repositories return 451 `REPOSITORY_LEGALLY_BLOCKED`. A root inventory failure is a problem response, while qualified partial or failed content remains a successful inventory response. For upgrade decisions, combine source changes with dependency, advisory and behavior compatibility evidence. Inventory remains authoritative when patches are truncated, filtered, or unavailable; byte-escaped paths are display identities and cannot be used as exact read tokens. # Generate an example from open-source references Source: https://docs.githits.com/api-reference/v1/examples/generate-an-example-from-open-source-references https://api.githits.dev/v1/openapi.json post /v1/examples/search Generate a code example for a programming task using open-source references. The response contains Markdown with source references, license attribution, and a link to the saved example. Use this endpoint when you want an example tailored to your task. To find existing documentation or code instead, use `POST /v1/searches`. You can rate a saved example with `POST /v1/feedback`. # Compare two dependency snapshots Source: https://docs.githits.com/api-reference/v1/experimental/compare-two-dependency-snapshots https://api.githits.dev/v1/openapi.json post /v1/experimental/dependency-diffs Submit a selected-input dependency comparison as one asynchronous job. Send a string request JSON control and raw base_files[]/head_files[] parts. All v1 controls are required; unknown fields, query controls and repeated controls are rejected. Each side explicitly declares supplied (one or more files) or empty (no files); empty/empty is valid. Duplicate paths within one side are invalid; the same path across sides is valid. Preserve project-relative paths. The aggregate pair is limited to 256 files; each file to 5,242,880 bytes and each UTF-8 path to 1,024 bytes. The entire wire body including MIME headers and framing must fit 8,000,000 bytes. Two snapshots that fit individually may exceed the paired bound; no evidence is trimmed or chunked. Native group availability and file interpretation remain producer-owned. A module-marker-only package.json is currently unusable and returns a side/path-qualified 422. Accepted paths/digests prove only selected inputs, never repository completeness. No URLs/refs, kind/format, excluded path counts or enforcement policy controls are accepted. The gateway reports one provisional operation; authoritative backend admission charges this operation once, weighted as two audits (currently 200 daily units), with no gateway repricing. Follow the shared status/events/result links; reads and execution retries do not repeat admission. Optional analysis failures retain the core diff as HTTP 200 with explicit partial coverage. Recorded/effective ownership, source-local advisory deltas and recorded repository union remain distinct. Backend direct reviews retain all eligible deduplicated tuples in batches of at most 30, with no total first-30 cap. Changelog links are entry-scoped; truncation and missing coverage do not imply safety or a full-history URL. Scan owns policy and exit enforcement. # Compare two exact source trees Source: https://docs.githits.com/api-reference/v1/experimental/compare-two-exact-source-trees https://api.githits.dev/v1/openapi.json post /v1/experimental/code/diff Deprecated alias; use POST /v1/code/diff. Compare source changes between two package versions or two refs in a public repository. The response lists changed files and can include added and deleted line counts and patches. Use this endpoint to inspect the code behind a release or upgrade. Comparisons cover the whole repository, including when you identify it through a package. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `files` | Identity/status fields and content safety; inventory only | No | | `files.stats` | Adds nullable additions/deletions; implies `files` and requests stats | No | | `files.patch` | Adds nullable patch and omission reason; implies stats and requests patches | Yes | Failures use a stable problem document. When supplied by the source, optional recovery hints identify the failed `side`, retryability, published versions, and ordered source ref/version alternatives. Missing hints are omitted. Classified user-facing errors use nonempty REST-suitable source guidance as detail; otherwise gateway text is used. Internal diagnostics remain private. Detail wording is not stable; use code and recovery fields. Unsupported package registries or repository providers return 422 `UNSUPPORTED_REGISTRY`; legally blocked repositories return 451 `REPOSITORY_LEGALLY_BLOCKED`. A root inventory failure is a problem response, while qualified partial or failed content remains a successful inventory response. For upgrade decisions, combine source changes with dependency, advisory and behavior compatibility evidence. Inventory remains authoritative when patches are truncated, filtered, or unavailable; byte-escaped paths are display identities and cannot be used as exact read tokens. # Download a completed lockfile analysis Source: https://docs.githits.com/api-reference/v1/experimental/download-a-completed-lockfile-analysis https://api.githits.dev/v1/openapi.json get /v1/experimental/lockfile-jobs/{id}/result Download the completed document in the format selected at submission. Only state=succeeded indicates that the result is ready. The response format is determined by the upstream's allowlisted media type; Accept does not select it. SBOM uses the same format-specific validation as synchronous /v1/experimental/sbom. Audit JSON receives complete syntax and version-aware envelope validation, preserving original evidence bytes. Version 2 contains compact findings, source paths, duplicate requirement origins and explicit coverage gaps. Retained version 1 reports remain readable; versions 3 and newer remain opaque. Results are bounded to 16,777,216 bytes. Pending jobs return 409 ANALYSIS_PENDING. Failed jobs return 409 ANALYSIS_FAILED with a producer failure_code from an open vocabulary and a fixed safe detail; backend diagnostics are not returned. After authentication, malformed, missing, expired and other-owner job IDs produce the same 404 ANALYSIS_NOT_FOUND response; 400 remains for other invalid request syntax. # Generate an SBOM from uploaded files Source: https://docs.githits.com/api-reference/v1/experimental/generate-an-sbom-from-uploaded-files https://api.githits.dev/v1/openapi.json post /v1/experimental/sbom Generate a dependency inventory from manifest and lockfile uploads without creating a project. Manifest-only inputs resolve concrete versions and transitives. Compatible lockfiles supply recorded versions for associated manifests; uncovered manifests resolve separately. **First request** Use a GitHits Bearer credential for an active account with the required terms accepted. In the example, `private-auth.conf` is a caller-owned protected curl configuration containing `header = "Authorization: Bearer "`; replace the placeholder privately. Run from your repository root: ```sh curl --config /path/to/private-auth.conf \ --fail-with-body --silent --show-error \ --form 'files[]=@Cargo.toml;filename=Cargo.toml' \ --form 'files[]=@Cargo.lock;filename=Cargo.lock' \ --output bom.cdx.json \ 'https://api.githits.dev/v1/experimental/sbom?format=cyclonedx' ``` For npm, replace the two files with `package.json` and `package-lock.json`. For a nested project, use both the actual local path and the repository-relative filename, for example `files[]=@app/package.json;filename=app/package.json`. Repeat `files[]` for each file. Let curl set `Content-Type` and the multipart boundary. Send individual manifests and lockfiles, not an archive, repository URL or base64 data. On success the output file contains the document itself. On an HTTP error, curl exits unsuccessfully and saves a JSON problem in that file; check the exit status before importing it as an SBOM. **Upload rules** Send repeated `files[]` parts with repository-relative filenames and raw UTF-8 contents. Keep directories intact, for example `app/package.json` and `app/package-lock.json`. Only `files[]` and optional `format` are accepted. The complete multipart body, including framing, is limited to 8,000,000 bytes: 1–256 files, each at most 5,242,880 bytes, with filenames at most 1,024 UTF-8 bytes. Empty, dot and parent path segments, backslashes and controls are invalid. Unknown fields, missing filenames and duplicate format values in one location are rejected. A malformed query format is invalid even when multipart supplies a format. Supported manifest examples include `Cargo.toml`, `package.json`, `pyproject.toml`, `Pipfile`, `go.mod`, `mix.exs` and `rebar.config`. This list is non-exhaustive; support depends on the contents, not just the filename. `go.sum` and `requirements.txt` are unsupported: do not include them as companion files. One unusable file rejects the entire upload with 422 `UNUSABLE_MANIFEST`; companion files are not silently ignored. Supported lockfile families include Cargo, npm, pnpm, Yarn classic and Berry, uv, Poetry, PDM, Pipenv, Swift, Gradle, NuGet, Dart, Composer, Mix, Bundler, Rebar, Conan and Go dep. Filename and contents determine recognition; renaming an unsupported file does not add support. Lockfiles can be uploaded alone. A compatible same-directory lockfile supplies recorded versions for its manifest; this does not verify that the lockfile is up to date. For monorepos, preserve all relative paths; a nested manifest does not automatically inherit an ancestor lockfile. **Choose an output** | `format` | Response `Content-Type` | Contents | | --- | --- | --- | | `cyclonedx` (default) | `application/vnd.cyclonedx+json` | CycloneDX 1.7 JSON | | `spdx` | `text/spdx` | SPDX 2.3 tag-value, not JSON | | `text` | `text/plain` | Human-readable inventory report, not a standard SBOM serialization | All outputs use UTF-8 and are limited to 16,777,216 bytes. Change the example's query to `?format=spdx` or `?format=text`, or add `--form 'format=spdx'`; the multipart value wins. `Accept` does not select the format. Success returns HTTP 200 with the direct document, without a JSON wrapper or retrieval URL. No `fields` selector is supported. Standard document fields retain their standard spelling. The response schema describes an extensible subset of CycloneDX 1.7, not a field allowlist: additional standard metadata, component, license, dependency and other fields are accepted at every object level. Clients must preserve or ignore unfamiliar fields. SPDX tag-value documents may likewise include additional standard fields. **Interpret the inventory** One unusable file rejects the upload. Incomplete resolution and missing licenses can still produce a successful partial document. License declarations are evidence, not legal conclusions or artifact verification. Lockfile agreement and platform conditions are not checked. Preserve completeness, provenance, license expression/name variants and optional PURLs when consuming the result. In CycloneDX, find the document-level property named `githits:completeness` by name rather than array position: | Value | Meaning | | --- | --- | | `resolved_manifest_inventory` | Inventory from manifest dependency resolution | | `partial_manifest_inventory` | Resolution is incomplete; the component list can be empty | | `recorded_lockfile_inventory` | Inventory recorded in uploaded lockfiles | | `mixed_dependency_inventory` | Lockfile records plus separately resolved manifests | None guarantees an exact installed inventory or complete license coverage. Inspect `githits:resolutions` and `githits:manifest_associations` for per-manifest evidence. Structured `githits:` property values are JSON encoded inside strings and require a separate decode. Component names are not unique; retain `bom-ref` for document relationships. A missing version, PURL or license means unavailable evidence, not permission to invent a value. **Analysis admission and cost** Synchronous SBOM and asynchronous SBOM/audit submissions share a backend analysis submission bucket. Current defaults allow 2 submissions per personal principal or 5 per organization/project principal in a first-hit fixed 60-second window; project credentials in the same organization share that principal. These are policy defaults, subject to runtime overrides. Backend admission is authoritative: handle 429 `RATE_LIMITED` and respect `Retry-After` when present. At current policy defaults, a normally metered analysis reserves 100 weighted daily units from the same daily budget used by ordinary metered tool requests: one analysis costs as much as 100 ordinary metered calls. Both operation costs can be overridden by runtime policy. Gateway operation telemetry (`githits.cost=1`) is provisional and does not describe this backend debit. The short-rate bucket is checked before parsing. Normal daily admission reserves the 100 units after format/size preflight but before parsing; later parser, resolution or rendering failures do not refund the reservation. Unsupported companion files can therefore reject the entire upload after reservation. Gateway-local validation rejections make no backend call and consume neither backend bucket. A backend 422 can follow reservation; transport or admission-authority failures can leave the charge unknown or unmetered. An error response alone proves neither a refund nor an exact debit. Avoid submitting the same analysis again unless you intend another admission. **Handle errors and retries** Errors use `application/problem+json` in every output format. Branch on `code`, not `detail`, and retain `X-Request-ID` for support. The response definitions below provide problem schemas and examples. | Status / code | Caller action | | --- | --- | | 400 `VALIDATION_ERROR` | Correct multipart fields, filenames or format values before retrying. | | 401 `AUTHENTICATION_REQUIRED` | Supply a valid Bearer credential. | | 403 `FORBIDDEN`, `ACCOUNT_INACTIVE`, `TERMS_ACCEPTANCE_REQUIRED` | Resolve credential access, account eligibility or terms acceptance. | | 408 `UPLOAD_TIMEOUT` | Ensure the upload can finish within 30 seconds. | | 413 `INPUT_TOO_LARGE` | Reduce file count, path length or bytes to the documented limits. | | 415 `UNSUPPORTED_MEDIA_TYPE` | Send multipart/form-data with a valid boundary. | | 422 `UNUSABLE_MANIFEST` | Inspect `files`: each entry identifies the original `path` and `status` (`unsupported`, `invalid_utf8` or `unparsed`). Correct or remove those inputs; the entire upload was rejected. | | 422 `NO_MANIFEST_EVIDENCE` | Supply a manifest with named package evidence or a supported lockfile. | | 422 `UNREPRESENTABLE_SPDX` | Request `cyclonedx` to preserve names or versions that SPDX tag-value cannot represent. | | 422 `SBOM_OUTPUT_TOO_LARGE` | Reduce the requested inventory; the generated document exceeded an output limit. | | 429 `RATE_LIMITED` | Respect `Retry-After` when present. | | 502 `UPSTREAM_ERROR`, 503 `SBOM_UNAVAILABLE` / `UPSTREAM_UNAVAILABLE` | A service failure prevented generation; retry later if appropriate. | | 504 `TIMEOUT` | Generation exceeded a service deadline; a retry may repeat work. | Uploads and documents are not retained for retrieval. Save the response. Repeated requests regenerate the document and consume request quota. Client upload has a 30-second deadline; the gateway allows 150 seconds for the upstream exchange, including the complete response read, in addition to upload time. A timeout does not guarantee processing stopped. Avoid unconditional retries: there is no idempotency key or saved result to resume. # Get dependency licenses for a completed analysis Source: https://docs.githits.com/api-reference/v1/experimental/get-dependency-licenses-for-a-completed-analysis https://api.githits.dev/v1/openapi.json get /v1/experimental/licenses/{id} Retrieve a JSON license report for an analysis job you can access. Use the analysis `id` returned in the HTTP 202 submission response. The synchronous `POST /v1/experimental/licenses` response has no job ID; a component's `bom_ref` cannot be used here. The job must have been submitted with `kind=sbom&format=cyclonedx`. You do not need to parse a CycloneDX document to use this JSON report. An audit job or a job using SPDX/text output returns 409 `INCOMPATIBLE_ANALYSIS`; choose a compatible job or submit a new one with the required parameters. **Create and follow a job** Use a GitHits Bearer credential for an active account with required terms accepted. In these examples, `/path/to/private-auth.conf` is your own protected curl configuration containing `header = "Authorization: Bearer "`; replace the placeholder privately and keep the file outside your repository. ```sh curl --config /path/to/private-auth.conf \ --fail-with-body --silent --show-error \ --form 'files[]=@package.json;filename=package.json' \ --form 'files[]=@package-lock.json;filename=package-lock.json' \ --output job.json \ 'https://api.githits.dev/v1/experimental/lockfile-jobs?kind=sbom&format=cyclonedx' ``` 1. Check for HTTP 202 and read `id` from `job.json`. Keep `expires_at` and the returned links. 2. Resolve `status_url` or `events_url` against the API server URL. Read status or consume the server-sent events until `state=succeeded`. The presence of `result_url` alone does not mean the job is ready. On `state=failed`, inspect the job status's `error` code before deciding whether to submit new work; a licenses read also returns 409 `ANALYSIS_FAILED` with `failure_code`. 3. Replace `{id}` below with the submission response's `id` and request the licenses view: ```sh curl --config /path/to/private-auth.conf \ --fail-with-body --silent --show-error \ --output licenses.json \ 'https://api.githits.dev/v1/experimental/licenses/{id}' ``` On HTTP 200, `licenses.json` contains `schema_version`, `inventory` and `components`. On an HTTP error, curl exits unsuccessfully and saves a JSON problem in that file; check the exit status before treating it as a report. No query parameters or `Accept`-based format selection are supported. Reading this report does not start another analysis or reserve another set of analysis units. Submitting a new job is a new analysis (currently 100 weighted daily units at default policy). The `x-githits-cost` value for this read is 0. Keep using the same ID for reads until the job expires instead of resubmitting just to retrieve the report. **Interpret the response** Every reported project, dependency or file/source entry remains separate, including repeated names, versions or package URLs. Use `bom_ref` for reported relationships and `properties` for input paths. `licenses` gives license choices; `observed_licenses` gives independent observations. `publisher_evidence` retains original publisher statements and release/package/repository context. `source_evidence` retains source-file paths, detected licenses and observation/attempt history. Both evidence fields are JSON objects already. Some named `properties[].value` strings contain extra JSON that you parse separately; the field descriptions identify them. Null means the corresponding information was unavailable. Empty arrays do not prove that no license exists, that all files were checked, or that the dependency graph is complete. Read `inventory.completeness` with the component list. Dependency coverage is in `inventory.compositions` and the `inventory.properties` entry named `githits:dependency_coverage`; parse that entry's `value` as JSON. Notices are properties named `githits:notice`. No chosen license, AND/OR relationship between separate choices, or pass/fail decision is added. New string values and fields can appear; preserve or ignore unfamiliar data instead of rejecting an otherwise usable report. **Handle errors** Problems use `application/problem+json`; branch on `code` and keep `X-Request-ID` for support. | Status / code | What to do | | --- | --- | | 400 `VALIDATION_ERROR` / `INVALID_SESSION_ID` | Remove query parameters or correct the session header/field identified in `detail`. | | 401 / 403 | Check the credential, account access and required terms; use any provided terms/acceptance links. | | 404 `ANALYSIS_NOT_FOUND` | Check the submission ID and credential. Missing, expired and inaccessible jobs have the same response. A result that is no longer stored requires a new submission if you still need it. | | 409 `ANALYSIS_PENDING` | Wait for completion through status/events, then retry this GET; do not submit a second job just to wait. | | 409 `ANALYSIS_FAILED` | Inspect `failure_code` and the job status. Correct the input or cause before deliberately creating another analysis. | | 409 `INCOMPATIBLE_ANALYSIS` | Use a job created with `kind=sbom&format=cyclonedx`; the format of an existing job cannot be changed by this GET. | | 422 `LICENSE_REPORT_TOO_LARGE` | The JSON report exceeds 16,777,216 bytes. Download the job's original CycloneDX document through `result_url`, or create a smaller analysis if appropriate. Jobs do not raise the report-size limit. | | 429 `RATE_LIMITED` | Respect `Retry-After` when provided. | | 502 `UPSTREAM_ERROR` | The analysis result could not be read. Keep the job ID and `X-Request-ID`, and report a persistent failure; do not repeatedly resubmit the same files. | | 503 / 504 | Try reading the same job again later. This does not start another analysis. | Responses must not be cached (`Cache-Control: no-store`). The report does not certify an installed artifact or complete license coverage. # Get lockfile analysis status Source: https://docs.githits.com/api-reference/v1/experimental/get-lockfile-analysis-status https://api.githits.dev/v1/openapi.json get /v1/experimental/lockfile-jobs/{id} Return the latest complete job snapshot. The result_url is present in every state; only state=succeeded means the result is ready. Snapshots are full replacements. The associated events stream sends every update with a nondecreasing but nonunique revision, so state or attempt may change at an equal revision; clients must apply each event and must not deduplicate by ID or revision. Reconnecting returns only the latest snapshot and does not replay earlier events. After authentication, malformed, unknown, expired and other-owner job IDs return the same 404 ANALYSIS_NOT_FOUND response; 400 remains for other invalid request syntax. # Preview a compact dependency-license report Source: https://docs.githits.com/api-reference/v1/experimental/preview-a-compact-dependency-license-report https://api.githits.dev/v1/openapi.json post /v1/experimental/license-reports Create a compact informational license report from manifests and lockfiles. This separate experimental operation returns `schema_version: 2`; the existing `/v1/experimental/licenses` operation continues returning schema 1. The compact report preserves package occurrences, reported choices, publisher context, source observations, input attribution and meaningful gaps, while omitting dependency adjacency, checksums and generic SBOM property containers. It does not evaluate license policy or certify installed artifacts. **First request** Use a Bearer credential for an active account with required terms accepted. `/path/to/private-auth.conf` below is your own protected curl configuration containing your authorization header, kept outside the repository. ```sh curl --config /path/to/private-auth.conf \ --fail-with-body --silent --show-error \ --form 'files[]=@package.json;filename=package.json' \ --form 'files[]=@package-lock.json;filename=package-lock.json' \ --output license-report.json \ 'https://api.githits.dev/v1/experimental/license-reports' ``` Repeat the literal `files[]` field and preserve each repository-relative filename, including directories. Let curl set the multipart content type and boundary. Only files are accepted: no query parameters, format/kind selectors, repository URLs, archives, base64 data or policy files. `Accept` does not select a report version. The existing SBOM upload contract applies: 1–256 UTF-8 files, each at most 5,242,880 bytes, a total multipart request of at most 8,000,000 bytes, and relative filenames of at most 1,024 UTF-8 bytes without control characters, backslashes or dot/parent segments. Uploads have a 30-second deadline and synchronous analysis a 150-second budget. Unsupported or unusable files reject the upload. Supported manifest/lockfile families and companion-file restrictions are the same as **Generate an SBOM** (`POST /v1/experimental/sbom`). Check curl's exit status before treating the output file as a report: errors save an `application/problem+json` body there. Successful output is the report itself, without a job ID or retrieval URL. Repeating POST starts another analysis; a timeout does not establish that processing stopped. **Long-running work and evidence inspection** Use the existing `POST /v1/experimental/lockfile-jobs?kind=sbom&format=cyclonedx` workflow for long-running work or when you need the original SBOM. Follow its status/events until success, then read `GET /v1/experimental/license-reports/{id}`. This is the same analysis and authorized CycloneDX result, not another generation or a new job kind. Existing job links, retention, authorization, quotas and billing apply. Generation uses the same analysis reservation as SBOM; the provisional operation cost is 1. Reading an existing report has operation cost 0 and starts no new analysis. **Read the compact report** - Keep separate component entries even when names, versions or PURLs match. Preserve supplied qualifiers/subpaths, source kinds and recorded source selectors/revisions. A local source does not establish first-party ownership, and a recorded revision does not prove that commit was inspected. - `licenses` contains reported choices; `observed_licenses` contains separate detections. Neither observations nor repository context substitute for reported choices. No AND/OR relation between separate choices or license alias is inferred. - `publisher_evidence` retains original statements, interpretation/issues and applicability. Its capture/coverage fields describe evidence limitations, not inventory or license completeness. `source_evidence` retains detection service/method, module/version/URL, root/nested file paths, observations and latest-attempt history. An older observation can coexist with a failed latest attempt. - `inputs.manifest_paths` and `inputs.lockfile_paths` are ordinary JSON string arrays. Purpose-specific structured fields are already decoded JSON: do not parse them as JSON strings. Reference comments retain original owner/scope context; reference and component digests remain available only in the original SBOM/schema-1 view. - Optional `license_evidence` holds independent acquisition/applicability facts. With canonical publisher evidence, interpretation and statements remain solely with that owner. Without it, manifest/legacy raw text, syntax/status and issues remain available here. No missing fact is filled with an empty or completed stand-in. - Metadata status/reason, resolution basis/limitations and PURL-omission reasons distinguish missing acquisition from ineligible or uncertain identity. Read `inventory.completeness`, `resolutions`, `coverage`, `dependency_coverage`, `lockfiles` and notices together. Missing references, unfamiliar states, empty arrays and HTTP 200 never prove complete license or dependency coverage. - `inventory.declarations` preserves minimal original request names/inputs, including dependencies lost from the package inventory after a whole-manifest resolver failure. Declarations are not resolved package occurrences or graph edges. An absent requirement is unreported or withheld, never an unconstrained range. Agreement summaries retain named outcomes; empty matched-version lists do not prove there was no lock evidence. Detailed provider proofs remain in the original SBOM/schema-1 view. Null means unreported/unavailable information. Empty choices mean no choices were reported, not that no license exists or every file was checked. Accept unfamiliar response strings and additive evidence instead of rejecting otherwise usable data. The report is at most 16,777,216 bytes; over-limit output is rejected without truncation. Jobs do not increase that limit. **Handle errors** Branch on the problem `code`, retain `X-Request-ID`, and respect `Retry-After`. Correct request/upload problems for 400/408/413/415 and unusable-file 422 responses. Authentication/account/terms errors retain their existing 401/403 contract. `LICENSE_REPORT_TOO_LARGE` or `SBOM_OUTPUT_TOO_LARGE` requires a smaller inventory or the original available job result. Keep request identity for persistent 502 errors. Retry reads of an existing job for transient failures instead of unconditionally repeating a charged POST. Responses use `Cache-Control: no-store`. This is an experimental contract. Stable promotion is a separate acceptance step; it does not remove or reinterpret saved schema-1 reports. # Preview a compact report for a completed analysis Source: https://docs.githits.com/api-reference/v1/experimental/preview-a-compact-report-for-a-completed-analysis https://api.githits.dev/v1/openapi.json get /v1/experimental/license-reports/{id} Retrieve compact report `schema_version: 2` for an existing authorized CycloneDX SBOM job. Use the analysis ID returned by `POST /v1/experimental/lockfile-jobs?kind=sbom&format=cyclonedx`, after its existing status/events indicate success. A component `bom_ref` is not an analysis ID. The synchronous compact POST returns no job ID. ```sh curl --config /path/to/private-auth.conf \ --fail-with-body --silent --show-error \ --output license-report.json \ 'https://api.githits.dev/v1/experimental/license-reports/{id}' ``` `/path/to/private-auth.conf` is your own protected curl configuration containing your authorization header, kept outside the repository. Use a credential with access to the submitted job, such as the submission credential. Check curl's exit status: failures save a JSON problem rather than a report. This read fetches one existing authorized result and projects it; it never resubmits, resolves, enriches or fetches source URLs. Operation cost is 0, with no new analysis reservation. The original job's status/events/result links, representation, owner/expiry gates and retention stay unchanged. No query parameters or `Accept`-based report selection are supported. The legacy `/v1/experimental/licenses/{id}` read remains schema 1, and the original CycloneDX result remains available through the job's `result_url`. **Interpret the report** The compact POST documents the full report semantics. Keep every original occurrence and supplied identity qualifier; `bom_ref` and typed `inputs` retain attribution. Reported choices, publisher statements/context and observed file detections remain distinct. Original source observations and latest-attempt state/time do not certify your installed artifact. Local source does not prove first-party ownership. No license normalization, inferred AND/OR or pass/fail verdict is added. Purpose-specific fields are already JSON objects/arrays; they replace JSON strings inside generic property containers. `license_evidence` retains independent occurrence limitations and manifest/legacy detail only when it is not a mirror of canonical publisher evidence. Inventory coverage and named declaration gaps are not license completeness. Missing requirements never imply unrestricted selection. Empty matched-version lists do not imply no lock evidence; original provider proofs remain in the schema-1 view/SBOM. Null, absent facts, empty choices, unfamiliar statuses and unresolved references retain uncertainty. HTTP 200 does not establish that every dependency or license is known. Report output is bounded at 16,777,216 bytes and is never truncated. Dependency adjacency, component/reference digests and generic SBOM/debug properties are omitted from this compact view. **Handle errors** Problems use `application/problem+json`; branch on `code`, keep `X-Request-ID`, and honor `Retry-After`. | Status / code | Meaning and next action | | --- | --- | | 400 `VALIDATION_ERROR` / `INVALID_SESSION_ID` | Remove query parameters or correct the named field/session header. | | 401 / 403 | Check credential, ownership/account eligibility and required terms. | | 404 `ANALYSIS_NOT_FOUND` | Check the submission ID and credential. Missing, malformed, expired and inaccessible IDs share this response after authentication. | | 409 `ANALYSIS_PENDING` | Wait through existing status/events, then retry the same read. | | 409 `ANALYSIS_FAILED` | Inspect the safe open `failure_code` and job status before deliberately submitting new work. | | 409 `INCOMPATIBLE_ANALYSIS` | Use a job submitted with `kind=sbom&format=cyclonedx`; audit/SPDX/text jobs are not converted. | | 422 `LICENSE_REPORT_TOO_LARGE` | The compact report exceeds its limit. Read the original available job result or request a smaller inventory. | | 429 / 502 / 503 / 504 | Respect retry guidance and retain the job/request IDs. Retry the existing read for transient failures instead of creating another analysis. | Responses use `Cache-Control: no-store`. Stable promotion is a later acceptance step; current schema-1 endpoints and saved reports remain unchanged. # Report dependency licenses from uploaded files Source: https://docs.githits.com/api-reference/v1/experimental/report-dependency-licenses-from-uploaded-files https://api.githits.dev/v1/openapi.json post /v1/experimental/licenses Create a JSON license report from your project's manifests and lockfiles, including transitive dependencies found during analysis. The report lists projects, packages and source/file entries, their license choices, source observations and coverage. It can contain incomplete results or unknown licenses; HTTP 200 does not mean every dependency or license is known. **First request** Use a GitHits Bearer credential for an active account with the required terms accepted. In these examples, `/path/to/private-auth.conf` is your own protected curl configuration containing `header = "Authorization: Bearer "`; replace the placeholder privately and keep the file outside your repository. Run from your repository root: ```sh curl --config /path/to/private-auth.conf \ --fail-with-body --silent --show-error \ --form 'files[]=@package.json;filename=package.json' \ --form 'files[]=@package-lock.json;filename=package-lock.json' \ --output licenses.json \ 'https://api.githits.dev/v1/experimental/licenses' ``` Repeat the literal field name `files[]` for each file. For a nested project, preserve the path in both places, for example `files[]=@app/package.json;filename=app/package.json`. This lets related manifests and lockfiles be associated. Let curl set the multipart `Content-Type` and boundary. Only `files[]` parts are accepted: do not send query parameters, `kind`, `format`, repository URLs, archives, base64 data or policy files. `Accept` does not change the response format. On HTTP 200, `licenses.json` contains the report itself, with `schema_version`, `inventory` and `components`. On an HTTP error, curl exits unsuccessfully and writes a JSON problem to that file; check the exit status before treating it as a report. Save a successful response: this synchronous operation returns no job ID or retrieval URL. A component's `bom_ref` is not an analysis job ID. **Inputs and limits** Supported inputs are the same as **Generate an SBOM** (`POST /v1/experimental/sbom`): for example `Cargo.toml`/`Cargo.lock`, `package.json`/`package-lock.json`, or supported pnpm and Yarn lockfiles. Lockfiles can be uploaded alone; manifests without a compatible lockfile resolve dependencies separately. File contents determine support. `go.sum` and `requirements.txt` are unsupported companion files. One unusable file rejects the whole upload; inspect the problem's `files` entries for its path and status. Send 1–256 raw UTF-8 files, each at most 5,242,880 bytes. The entire multipart request, including boundaries and headers, must fit within 8,000,000 bytes. Each filename is a repository-relative path of at most 1,024 UTF-8 bytes, without backslashes, control characters, or empty, dot or parent path segments. The upload must finish within 30 seconds. After upload, analysis can wait up to 150 seconds for a response. A timeout does not guarantee that processing stopped. Repeating POST creates another analysis; there is no idempotency key or saved result to resume. **Long-running work and usage** For work that may outlast the synchronous request, submit `POST /v1/experimental/lockfile-jobs?kind=sbom&format=cyclonedx` with the same files. Its HTTP 202 JSON response supplies an analysis `id`, plus `status_url`, `events_url`, `result_url` and `expires_at`. Follow status or events until `state=succeeded`, then read `GET /v1/experimental/licenses/{id}` using that analysis ID. The **Get dependency licenses** operation shows the complete workflow. At current default policy, creating an analysis reserves 100 weighted units from your daily allowance. Processing failures do not automatically refund that reservation. Reading an existing job's licenses report does not start another analysis or consume another analysis reservation. The `x-githits-cost` value of 1 is provisional operation metadata, not an additional charge. Avoid unconditional POST retries. **Read the report** Keep separate component entries even when their names, versions or package URLs match. Use `bom_ref` for reported relationships and `properties` for input-file attribution. `licenses` contains license-choice objects; `observed_licenses` contains separate observations. `publisher_evidence` explains original publisher statements and their context; `source_evidence` explains source-file detections and attempt history. These evidence fields are JSON objects already; do not decode them as JSON strings. Some named `properties[].value` strings contain additional JSON and need a separate parse, as described in the response schemas. Null identity or evidence fields mean unavailable information. Empty license arrays mean no entries were reported, not that every file was checked or that a package has no license. Read `inventory.completeness` alongside the component list. Dependency coverage is in `inventory.compositions` and the `inventory.properties` entry named `githits:dependency_coverage`; parse that entry's `value` as JSON. Notices are properties named `githits:notice`. No chosen license, relationship between separate choices, or pass/fail decision is inferred. Response keys use `snake_case`; embedded CycloneDX choice, composition, dependency, reference and hash objects retain standard keys such as `dependsOn`. **Handle errors** Problems use `application/problem+json`. Branch on `code`, keep `X-Request-ID` for support, and respect `Retry-After` when present. | Status / code | What to do | | --- | --- | | 400 `VALIDATION_ERROR` / `INVALID_SESSION_ID` | Correct the field named in `detail`, the upload parts, or the session header. | | 401 / 403 | Check the credential, account access and required terms; use any provided terms/acceptance links. | | 408 / 413 / 415 | Meet the upload deadline and size/path/count limits; send valid multipart data. | | 422 `UNUSABLE_MANIFEST` / `NO_MANIFEST_EVIDENCE` | Correct the reported files or supply a supported manifest/lockfile with package evidence. A file can be rejected after the analysis units were already reserved. | | 422 `LICENSE_REPORT_TOO_LARGE` / `SBOM_OUTPUT_TOO_LARGE` | The report or underlying inventory exceeds its output limit. Request a smaller inventory if possible. The JSON report limit is 16,777,216 bytes; using jobs does not raise it. Jobs also let you download the original CycloneDX document through `result_url` when that document is available. | | 429 `RATE_LIMITED` | Wait until the supplied `Retry-After` time before trying again. | | 502 `UPSTREAM_ERROR` | The analysis result could not be read. Keep `X-Request-ID` and report a persistent failure; repeating POST may create another charged analysis. | | 503 | Try again later. If you already have an analysis job, keep its ID and retry reads rather than submitting another job. | | 504 `TIMEOUT` | Processing may still have run. Prefer the job workflow for future submissions and do not assume a repeated POST is free. | Responses must not be cached (`Cache-Control: no-store`). # Research a question with cited sources Source: https://docs.githits.com/api-reference/v1/experimental/research-a-question-with-cited-sources https://api.githits.dev/v1/openapi.json post /v1/experimental/research Research a question about a package, GitHub repository, or documentation site and receive a Markdown answer with links to its sources. Continue the conversation with follow-up questions in the same thread. Answer generation can take up to 210 seconds. Use this experimental endpoint when you want an explanation based on project documentation and code. # Resolve a target name Source: https://docs.githits.com/api-reference/v1/experimental/resolve-a-target-name https://api.githits.dev/v1/openapi.json post /v1/experimental/targets/resolve Find packages, repositories, and documentation sites from a name. Results include ranked matches and related projects to help you identify the project you mean. Use this experimental endpoint when you know a project name but need its package coordinates or repository or documentation address for another GitHits request. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `details` | Target display_name, description, repository_url, repository_owner, repository_name, documentation_url and license. | Yes | | `availability` | Target docs_available, code_available, docs_page_count, code_file_count, stars, downloads_last_month and downloads_total. | Yes | | `ranking` | Direct-match matched_aliases, match_tier, score and name_similarity. | No | # Stream lockfile analysis progress Source: https://docs.githits.com/api-reference/v1/experimental/stream-lockfile-analysis-progress https://api.githits.dev/v1/openapi.json get /v1/experimental/lockfile-jobs/{id}/events Open the public event stream for an authorized job. Each frame uses event: snapshot, id: , and data: ; the data is a complete state replacement and contains the canonical result_url. Revisions are nondecreasing but nonunique: equal-revision snapshots may change state or attempt, so apply every frame and never deduplicate by job ID or revision. A fresh connection starts with the latest full snapshot; Last-Event-ID does not replay history. Idle connections receive the : keepalive comment every 15 seconds, and the public connection closes after 600 seconds or immediately after a terminal snapshot. After receiving a succeeded or failed snapshot, clients must close the connection and stop reconnecting; browser EventSource clients should call close(), because EventSource otherwise reconnects automatically. Reconnect to continue an unfinished job. Closing the downstream connection releases this stream's upstream transport but does not cancel the job. After authentication, malformed, missing, expired and other-owner job IDs return the same 404 ANALYSIS_NOT_FOUND response; 400 remains for other invalid request syntax. Authentication, ownership, and upstream opening errors are returned before event-stream headers; a later stream error closes the body without appending problem JSON. The upstream stream has no HTTP whole-body deadline, while the public event protocol has the 600-second lifetime. # Submit a lockfile analysis job Source: https://docs.githits.com/api-reference/v1/experimental/submit-a-lockfile-analysis-job https://api.githits.dev/v1/openapi.json post /v1/experimental/lockfile-jobs Submit uploaded manifests and lockfiles for asynchronous dependency analysis. Authenticate with a GitHits Bearer credential for an active account that has accepted the required terms. Supply kind=sbom or kind=audit either as a query parameter or multipart field; when both are supplied, the multipart field wins. Supply format in either location or both; the multipart field wins, and omission selects cyclonedx for sbom or json for audit. SBOM accepts cyclonedx/spdx/text; audit accepts only json. Crossed effective pairs are rejected before upstream admission. Repeated values within one location and unknown query or multipart fields are rejected. The gateway reports a provisional cost of one unit for submission; at current policy defaults, normal backend job admission reserves 100 weighted daily units once, including audit. The input support, strict whole-upload rejection and shared submission rate/cost policy are described under POST /v1/experimental/sbom, including reservation before parsing and no refund for later failures. Reads, progress, reconnects and backend execution retries are free; a deliberate new submission is newly charged. This endpoint returns HTTP 202 when the job is queued. The existing /v1/experimental/sbom endpoint remains synchronous and returns an HTTP 200 document. # Submit solution or session feedback Source: https://docs.githits.com/api-reference/v1/feedback/submit-solution-or-session-feedback https://api.githits.dev/v1/openapi.json post /v1/feedback Record whether a generated example or a session was useful, with optional written feedback. You can rate a saved example using its solution identifier or submit feedback for a session. Each successful submission saves a new feedback record. # Find regex or literal matches across source and documentation Source: https://docs.githits.com/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation https://api.githits.dev/v1/openapi.json post /v1/grep Find text in packages, repositories, and hosted documentation. Use this endpoint for exact text or regular-expression matches. Use list to find paths, search to discover topics, and read to retrieve more context for a match. ## Find text Send a JSON body to `POST /v1/grep`. This request searches an Express package and an explicit documentation site for literal text: ```json { "targets":[{"target":"npm:express@5.2.1"},{"target":"site:expressjs.com/en"}], "pattern":"Router", "pattern_type":"literal", "max_matches":10 } ``` Package targets search that package's files and its selected hosted documentation. Repository targets such as `github:expressjs/express` search the repository snapshot. A `site:` target selects hosted pages directly. Matching is case-sensitive by default. Set `ignore_case: true` to ignore case, and `context_lines_before` or `context_lines_after` to include up to 10 surrounding lines on each side. Both context options default to 0. The default `pattern_type` is `regex`, using RE2 syntax; lookaround and backreferences are not supported. Include literal text in broad regex patterns, or choose `literal` for plain text. Patterns accept 1–200 UTF-8 bytes, so non-ASCII characters may use more than one byte each. ## Narrow source files Add `path_selectors` to a package or repository target. `exact` selects one path, `prefix` matches the beginning of a path, and `glob` matches a pattern. For example: ```json { "targets":[{"target":"github:expressjs/express","path_selectors":[{"kind":"glob","value":"lib/**/*.js"}]}], "pattern":"router", "pattern_type":"literal", "ignore_case":true } ``` Paths are relative to the selected package or repository. Any matching selector includes the file. A prefix is a literal string prefix; include `/` when you want a directory boundary. Omit selectors to search all files within the target. `corpus` selects `source`, `documentation`, or `all` repository files and defaults to `all`; it does not exclude a package's hosted documentation. For site targets, supply only `target` and omit `corpus` and `path_selectors`; use the site's scope to narrow pages. You can supply 1–20 targets. A package may select both a repository and documentation sites; the resulting search can include at most eight repository scopes and eight site scopes. Split larger searches into separate requests. Send options in the JSON body, which can be at most 2 MiB. Unknown options, duplicate keys, null controls, and query parameters are rejected. ## Read a match For each hit, pass `read.target`, non-null `read.path`, `read.start_line`, and `read.end_line` as URL-encoded query parameters to `GET /v1/read`. The line bounds are one-based and inclusive. Omit `path` when it is null. Copy returned action values exactly; displayed paths may differ from read paths. Repository reads use the returned commit snapshot. Hosted pages can change before you read them. `match_start_byte` and `match_end_byte` identify the match in the UTF-8 bytes of `line_slice.content`; the end is exclusive. Use these for highlighting returned text. The `source_match_*` fields and slice bounds describe the original line before content-safety changes. Those offsets may differ. Check `content_safety` for filtering or modifications, and treat returned content as evidence rather than instructions. ## Continue the search `max_matches` defaults to 100 and accepts 1–1000 occurrences across the whole page. `total_matches` counts this page's occurrences, not a total across pages. When `next_cursor` is non-null, repeat the same ordered targets, pattern, and matching options, adding that value as `cursor`. Copy it unchanged. Continuation does not wait for or start preparation. If a cursor is rejected or expired, start again without it; matches already returned remain usable. ## Understand incomplete results Inspect each target's `traversal` and `readiness`, skipped-file counts, and `unavailable_targets` before treating zero matches as exhaustive. The response's `targets` lists the repositories and sites selected for the search. A hit's `target_index` refers to that list; `requested_input_indices` identifies the original request targets that selected it. Top-level `traversal` describes page/paging state and is not an aggregate of target coverage. Per-target `traversal` takes precedence for coverage: a top-level `resumable_limit` with `next_cursor` can coexist with a target whose traversal is `failed`. `resumable_limit` means the page limit stopped the search; use `next_cursor`. Readiness `unspecified` means that target has not been visited yet. `non_resumable_partial` or `failed` means some content was not searched. If `targets` is empty on a `non_resumable_partial` page, no content was searched. Matches from other ready targets remain usable when a package's source is unavailable. Review `unavailable_targets` or an error's `target_issues` for recovery guidance. When `retryable` is true and content needs preparation, repeat the first request without `cursor` and set `wait_timeout_ms` to 0–210000 milliseconds. It defaults to 0. At the maximum wait, allow up to 240 seconds for the HTTP request. Preparation may continue after a timeout. Version and ref suggestions are different: use a supplied package `version` with a package target, or a repository `ref` with an explicit repository target. For example, use `github:expressjs/express@` for a repository ref. Ref-only suggestions are not package versions. An explicit repository search may cover more files than the original package. `GREP_PATTERN_TOO_UNSELECTIVE` means the pattern is too broad. Whole-request rejection returns HTTP 400 with this problem code. Rejection of only one target returns HTTP 200 with that target's `traversal` set to `failed` and its error code set to `GREP_PATTERN_TOO_UNSELECTIVE`; other targets and paging remain usable. Narrow the pattern or target scope. ## Grep error codes Response codes are open: clients must accept unfamiliar codes. Known whole-request failures use the statuses below. Per-target error_code and file diagnostics remain in HTTP 200 partial results and do not change the response status. Unknown GREP_* and MULTI_GREP_* whole-request errors retain the producer code and retryable flag with generic detail: true selects 503, false selects 400; without a flag an upstream 4xx/5xx status is retained, or 400 for an HTTP-success GraphQL error. Non-retryable does not prove caller fault; inspect code and structured evidence. Known user-facing errors use nonempty REST-suitable producer guidance when available; detail wording is not stable. Authentication and HTTP rate-limit policy take precedence. | Code | HTTP status | Meaning and recovery | | --- | --- | --- | | `GREP_PATTERN_TOO_SHORT` | 400 | pattern must contain at least one UTF-8 byte. | | `GREP_PATTERN_TOO_LONG` | 400 | pattern exceeds 200 UTF-8 bytes; shorten it. | | `GREP_PATTERN_INVALID` | 400 | pattern contains invalid text or NUL bytes. | | `GREP_INVALID_REGEX` | 400 | pattern is not valid RE2 syntax; correct it or use literal matching. | | `GREP_UNSUPPORTED_PATTERN` | 400 | pattern uses unsupported regex features; use RE2 syntax or literal matching. | | `GREP_PATTERN_TOO_UNSELECTIVE` | 400 | pattern is too broad; add literal text or narrow the scope. | | `GREP_FILE_TOO_LARGE` | 422 | The selected file exceeds the source 5 MB limit. | | `GREP_INDEX_ABSENT` | 503 | The grep index is absent; retry when retryable is true. | | `GREP_INDEX_STALE` | 503 | The grep index is stale; retry when retryable is true. | | `GREP_INDEX_INCOMPLETE` | 503 | The grep index is incomplete; retry when retryable is true. | | `GREP_CAS_REQUIRED` | 503 | The index lacks required content-addressed metadata; retry when retryable is true. | | `GREP_SCOPE_REQUIRED` | 400 | The source requires a more specific target or path scope. | | `GREP_SELECTOR_INVALID` | 400 | A path selector is invalid; use a documented target-relative selector. | | `GREP_CURSOR_INVALID` | 400 | cursor is invalid for this request; start again without it. | | `GREP_CONTEXT_TOO_LARGE` | 400 | context_lines_before or context_lines_after exceeds 10. | | `GREP_CONTEXT_NEGATIVE` | 400 | context_lines_before and context_lines_after must be nonnegative. | | `GREP_MAX_MATCHES_TOO_LARGE` | 400 | max_matches exceeds 1000; lower the limit and paginate. | | `GREP_MAX_MATCHES_INVALID` | 400 | max_matches must be a positive integer. | | `GREP_SERVICE_UNAVAILABLE` | 503 | The grep service is unavailable; retry when retryable is true. | | `GREP_TIMEOUT` | 504 | The grep deadline expired; narrow the scope or retry. Preparation may continue. | | `GREP_INVALID_PATH_SELECTOR` | 400 | A path selector is invalid; use a documented target-relative selector. | | `MULTI_GREP_CURSOR_INVALID` | 400 | cursor is invalid for these targets or controls; start again without it. | | `MULTI_GREP_CURSOR_EXPIRED` | 400 | cursor expired; start again without it. Already returned matches remain usable. | | `GREP_BACKEND_ERROR` | 502 | The grep backend failed to provide usable evidence. | | `GREP_FAILED` | 502 | The grep operation failed to provide usable evidence. | | `GREP_BACKEND_PROTOCOL_ERROR` | 503 | The grep backend returned an invalid protocol result; retry when retryable is true. | | `GREP_FILE_INDEX_INCOMPLETE` | 503 | The file index is incomplete; retry when retryable is true. | | `GREP_FILE_INDEX_UNREADABLE` | 503 | The file index cannot be read; retry when retryable is true. | | `GREP_PATH_EXCLUDED` | 422 | The source excludes the selected path from its searchable index. | | `GREP_PATH_NOT_INDEXED` | 404 | The selected path is not present in the searchable index. | | `GREP_TARGET_PREPARATION_REQUIRED` | 409 | Content needs preparation or a different target; inspect target_issues and retryability. | # Search supported programming languages Source: https://docs.githits.com/api-reference/v1/languages/search-supported-programming-languages https://api.githits.dev/v1/openapi.json get /v1/languages Find supported programming languages by name or alias. Results provide a canonical name, a display name, and aliases for each match, ordered by relevance. Use the canonical name when choosing a language for a generated code example. # List files and documentation paths Source: https://docs.githits.com/api-reference/v1/list/list-files-and-documentation-paths https://api.githits.dev/v1/openapi.json post /v1/list Browse files and documentation paths in a package, repository, or documentation site. Use this endpoint when you know the target and want to find something to read. Use grep to find text within its contents, or search to discover documentation by topic. ## Start browsing Send a JSON body to `POST /v1/list`. This request lists the root of a package: ```json {"target":"npm:express@5.2.1"} ``` Package targets list files within that package, including local documentation. A repository target such as `github:expressjs/express` lists the whole repository snapshot. To browse hosted documentation, use a `site:` target: ```json {"target":"site:expressjs.com/en","recursive":true,"limit":100} ``` Omit `paths`, or use an empty array, to start at the root. To narrow the selection, pass paths or globs such as `{"target":"github:expressjs/express","paths":["lib/**/*.js"]}`. Entries matching any selector are included. Directories show their immediate children by default; `recursive: true` lists files or pages beneath them. Glob depth is determined by the glob itself. The `file_types`, `languages`, and `intents` filters apply only to source files. For filename extensions, use a path glob. Send all options in the JSON body; query parameters are not accepted. Request bodies can be at most 2 MiB. ## Read a result or open a directory Each entry includes a `read` action, a `browse` action, or both as applicable. Use these actions to make the next request: - For `read`, send its `target` and non-null `path` as URL-encoded query parameters to `GET /v1/read`. Omit `path` when it is null. - For `browse`, send its `target` and non-null `paths` in a new `POST /v1/list` body. Omit `paths` when it is null, and leave out `after`. Copy action values exactly. A displayed path can differ from the path needed to read a file. Preserve the path value, including trailing slashes and any query string, then URL-encode it as one query parameter. Encode literal `+` as `%2B` and `%` as `%25`; do not decode the action before encoding it. For example, `GET /v1/read?target=site%3Aexpressjs.com%2Fen&path=%2F` reads the landing page for that site scope. Use the action returned for your selected entry. ## Get the next page `limit` defaults to 100 and accepts 1–500 entries per page. When `has_more` is true, repeat the same target, paths, filters, recursion, and limit, adding the returned `next_cursor` as `after`. Copy the cursor unchanged. If it is rejected, start again without `after`. Site pages can change between requests. Pagination does not freeze their contents or membership; start without `after` to get a fresh listing. The response does not report a total number of entries. ## Check availability and coverage An empty page does not prove that all content has been indexed. For source files, inspect `code_index_state` and `target_resolution` to check availability, freshness, and the version or commit actually returned. For sites, inspect `inventory_state`, `crawl_status`, `coverage_state`, and `preparation`. Null means unknown or not applicable. A site selection can combine multiple indexed documentation collections. Crawl and coverage fields are null when there is no single collection summary. The `canonical_target` may identify the host root even for a narrower request; keep your original selection and use the returned actions. To wait for source indexing or an empty site's preparation, set `wait_timeout_ms` to a value from 0 to 210000 milliseconds. The default, 0, returns without waiting. At the maximum wait, allow up to 240 seconds for the HTTP request. A wait timeout does not stop preparation. Each site's wait reports an exact `status` and a summary `outcome`; use `status` to distinguish `failed` from `discarded`, or `superseded` from `cancelled`. In `preparation`, `selected` counts documentation collections, `enqueued` counts newly queued preparation, and `active_jobs` lists work already running. A positive `repair_limit_reached` means some collections still need preparation but were not queued. Narrow the site selection to include fewer collections. A zero value does not guarantee complete coverage. For `RESOURCE_LIMIT` errors, choose a target or paths that select fewer documentation collections. If a single collection exceeds the limit, read a known page directly; selecting fewer paths within that collection does not reduce the limit. If a package's source inventory is unavailable (`409 SOURCE_INVENTORY_SCOPE_UNAVAILABLE`), the error can include `repo_url` and `commit_sha`. A repository target at that commit, such as `github:expressjs/express@`, can include files outside the package, so use it only when that broader scope is acceptable. # Get a package or repository changelog Source: https://docs.githits.com/api-reference/v1/packages/get-a-package-or-repository-changelog https://api.githits.dev/v1/openapi.json get /v1/changelog Read release notes for a package or repository, ordered newest first. Retrieve recent releases to catch up on changes, or a version range to review everything between two releases. Use this endpoint to understand what changed before updating a dependency. You can request just the release timeline or include the full release-note text. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `statements` | Parsed statement page and release totals; no classification work. Timeline metadata remains required. | No | | `statements.classification` | Available classifications with uncertainty/provenance; implies statement items and assessment coverage. Missing answers are null; waits are bounded. | No | | `statements.full_text` | Uncut returned quotes and retained predecessor context; implies items independently of classification and raw release bodies. | No | | `statements.coverage` | Assessment coverage and page metadata without item text; does not imply items. Reduces payload, not classification work. | No | | `entries` | Complete timeline metadata: version, normalized_version, published_at and html_url when available. | Yes | | `entries.body` | Third-party Markdown bodies; implies the complete entries metadata group. | Yes | | `entries.*` | Explicit union of entries and entries.body. | No | Parsed statements are opt-in and require package addressing. `statements` returns parsed quotes and release totals without requesting labels. `statements.classification` includes available labels and assessment coverage; selected unavailable labels are null. `statements.coverage` requests coverage without item text. `statements.full_text` returns uncut quotes and predecessor context independently of raw release bodies or labels. Timeline metadata remains required. Explicit fields replaces defaults; defaults and entries.* do not include statements. Page controls are computation inputs, separate from fields. Active tiers request labels and imply assessment coverage, including with coverage-only selection; unassessed statements do not match. Zero matches with incomplete coverage do not prove absence of actionable changes. Coverage-only reduces payload, not assessment work. Waiting is bounded, so answers can remain unavailable. Read every page to exhaust matching parsed bullets; complete text only means uncut returned quotes. Offsets address current notes/labels without a snapshot guarantee. Compare available coverage, versions and source URLs and restart at offset zero if they change; unchanged counts/URLs cannot detect every wording change. # Inspect a package release Source: https://docs.githits.com/api-reference/v1/packages/inspect-a-package-release https://api.githits.dev/v1/openapi.json get /v1/packages/{registry}/{name} Get an overview of a package and one of its published releases, including its description, license, and deprecation status. You can also include download counts, GitHub repository details, security advisories, and release notes. Use this endpoint to evaluate a dependency or check a version you already use. For a release history, use `GET /v1/changelog`; for a full advisory list, use `GET /v1/packages/{registry}/{name}/vulnerabilities`. Security assessment_status and unknown_vulnerability_count qualify incomplete evidence. selected_version_affected means a confirmed match; false alone does not certify non-affecting. Clients must accept unfamiliar assessment statuses. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `package` | Package description, homepage, repository URL, version count and latest-release publication timestamp. | Yes | | `selected_version` | Selected release publication timestamp, license, deprecation state and deprecation reason. | Yes | | `package.downloads` | Download counts for the last month and all time, plus the refresh timestamp. | No | | `package.github_repository` | Linked GitHub repository owner, name, stars, forks, subscribers, open-issue count, archive state, language, license, topics and timestamps. | No | | `security` | Selected-release confirmed-match flag, assessment status, affected and unknown counts, plus the package-wide advisory count. | No | | `security.recent_vulnerabilities` | Up to five newest advisories affecting the selected release; selecting this group also includes security counts. | No | | `selected_version.changelog` | Exact selected-release changelog metadata and entry details. | No | | `selected_version.changelog.body` | Exact selected-release changelog body; selecting this group also implies changelog metadata. | No | | `package.*` | Bundle of package metadata, package.downloads and package.github_repository. | No | | `security.*` | Bundle of security counts and security.recent_vulnerabilities previews. | No | | `selected_version.*` | Bundle of selected-version metadata, selected_version.changelog and selected_version.changelog.body. | No | # Inspect package dependencies Source: https://docs.githits.com/api-reference/v1/packages/inspect-package-dependencies https://api.githits.dev/v1/openapi.json get /v1/packages/{registry}/{name}/dependencies Explore the dependencies of a package release, from its direct dependencies to the full dependency graph. The response can also include dependency declarations, relationships between packages, and issues such as outdated or deprecated dependencies. Use this endpoint to understand what a package brings into your project and where an indirect dependency comes from. Package version and transitive totals may be null when unknown. Unavailable graph or issue evidence is omitted; direct declarations can still be returned with unresolved versions. Absence is not evidence of zero dependencies. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `dependencies.direct` | Direct dependencies, their declared version constraints, and available resolved versions. | Yes | | `dependencies.groups` | Dependency declarations grouped by lifecycle, including conditions and environment markers. The lifecycle filter applies to this group. | Yes | | `dependencies.transitive` | The dependency graph, with package relationships, counts, version conflicts, and cycles. Use max_depth to limit its depth. | No | | `dependencies.importers` | Packages that depend on each dependency, with their declared constraints. Also includes dependencies.transitive. | No | | `dependencies.issues` | Deprecated, outdated, duplicate, and conflicting dependencies, with counts. Graph details are returned only if selected. | No | | `dependencies.*` | All dependency groups: direct, groups, transitive, importers, and issues. | No | # Inspect package vulnerabilities Source: https://docs.githits.com/api-reference/v1/packages/inspect-package-vulnerabilities https://api.githits.dev/v1/openapi.json get /v1/packages/{registry}/{name}/vulnerabilities Find known security advisories for a package version, with assessment reasons, severity evidence, affected-version displays and evaluated source fix candidates. Omit `version` to use the package's default for reads: its native install default, otherwise the registry's reported latest version, otherwise the latest stable inventory version (or latest inventory version if none is stable). The returned `package.version` identifies the inspected version; it can be null when none is available. Provide an exact version or supported constraint to choose a version explicitly. **Start with `vulnerabilities.summary`.** `assessment_status` describes the result, `assessment_reasons` explains evidence that could not be evaluated, and `current_version_affected` is nullable. A confirmed affected match remains `affected`/`true` even when other evidence is incomplete. `unknown`, `not_assessed` and `unsupported` never establish a clear release. Null affectedness means undetermined. A null package version means no concrete release was inspected. Counts describe affected, non-affecting, unknown and all advisories after severity and withdrawal filters and source deduplication. For an inspected release the three applicability counts sum to all; package history can instead have a positive all count with zero applicability counts. `advisory_scope` selects rows and their page total, independently of summary count scopes. Use `advisory_scope=unknown` to investigate unknown rows. An empty unknown page or zero unknown count can still accompany an incomplete report: read the summary status and reasons, including when requesting sparse fields. **Read status and reasons together on each advisory.** `affects_inspected_version=false` means no confirmed match, not necessarily non-affecting. Reasons can also accompany a confirmed affected match when other source ranges could not be evaluated; they never weaken that match. Known reason strings include `lookup_failed`, `unsupported_branch_version`, `invalid_version`, `invalid_range` and `missing_ranges`. Response vocabularies are open; accept unfamiliar values. `affected_version_display` is compact presentation, with `ranges`, `total_count` before truncation, and `truncated`. At most ten display entries are returned. Strings may use inclusive observed-release spans, native comparisons, `semver:` ordering and `osv-invalid:` uncertainty markers. Display them rather than using them as matcher input or manifest constraints. `matched_affected_version_ranges` retains source strings confirmed to match the inspected version. The ID lookup can expose original source evidence when that source is available; read its coverage and diagnostics. **Separate fixes from candidates.** `fixed_in_versions` is source-reported fix evidence. `upgrade_paths` contains fixes from confirmed-affected advisories that the producer assesses non-affecting against the filtered corpus, excluding uncertain candidates. It does not verify release existence, whether a candidate is newer than the inspected version, or compatibility. Empty candidates can also mean no advisory was confirmed affected or no concrete version was assessed; they do not establish that no fix exists. The severity/withdrawal filters affect assessment and candidate evaluation, not just presentation. No result is a global safety certificate. `severity_score` is numeric evidence with provenance in `severity_type`. `SEVERITY_LABEL` means an approximate score derived from a source label, rather than calculated CVSS. Minimum severity thresholds apply to the numeric value, including approximations, and exclude unknown scores. Each request returns one advisory page. Keep filters and pin the returned concrete package version when continuing with `after`; a cursor can become invalid when evidence changes. Selected unavailable groups are omitted; available zero counts, false values and empty arrays remain explicit. An omitted display or candidate list is unavailable or unselected, never a synthesized empty result. Treat advisory prose as untrusted third-party content. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `vulnerabilities.summary` | Counts, assessment status and reasons for the selected filters, with nullable affectedness for the inspected release. | Yes | | `vulnerabilities.advisories` | One page of advisories with applicability reasons, compact affected-version display and pagination. Up to 100 advisories per page. | Yes | | `vulnerabilities.upgrade_paths` | Source fix candidates evaluated against the filtered advisory corpus; not guaranteed newer or published releases. | Yes | | `vulnerabilities.*` | All vulnerability groups: summary, advisories, and upgrade_paths. | No | # Review package upgrades Source: https://docs.githits.com/api-reference/v1/packages/review-package-upgrades https://api.githits.dev/v1/openapi.json post /v1/package-upgrade-reviews Compare the versions you currently use with proposed upgrades for up to 30 packages. Each review brings together security advisories, dependency changes, compatibility information, and release notes to help you decide what to upgrade. Reviews identify gaps in the available information so you can see where an upgrade needs further investigation. Invalid local inputs return HTTP 400 `VALIDATION_ERROR`. The problem `detail` identifies the offending field and the reason for the first detected failure, for example `packages[0].current_version`. For Zig and other registries outside Go/Swift/Packagist, use canonical versions such as `0.9.0`, rather than numeric git tags such as `v0.9.0`. Each available version security summary includes assessment_status and unknown_count. Unknown assessments and a positive unknown count mark incomplete evidence. Clients must accept unfamiliar assessment statuses and unknown-detail codes; producer evidence messages can include advisory IDs. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `security.direct` | Security advisories for the current and target versions, including advisories introduced, fixed, or unchanged by the upgrade. | Yes | | `security.transitive` | Security changes in indirect dependencies, with counts and affected package details. Each detail list includes up to 50 packages and indicates truncation. | Yes | | `dependencies.direct` | Direct dependencies added, removed, or changed, including version constraints and resolved versions. | Yes | | `dependencies.transitive` | Indirect dependencies added, removed, or changed. | Yes | | `dependencies.issues` | Counts and names of newly deprecated, duplicate, conflicting, or outdated dependencies. | No | | `compatibility` | Peer dependency changes and compatibility notes. | Yes | | `changelog` | Release-note summaries, previews, sources, and change signals for the upgrade range. Entry and keyword-match lists each contain up to 20 items, with coverage and truncation information. | Yes | | `changelog.body` | Full release-note text for entries and keyword matches. Also includes changelog. | Yes | | `security.*` | Both direct and transitive security groups. | No | | `dependencies.*` | All dependency change and issue groups. | No | | `changelog.*` | Changelog summaries and full release-note text. | No | # Read documentation or source code Source: https://docs.githits.com/api-reference/v1/read/read-documentation-or-source-code https://api.githits.dev/v1/openapi.json get /v1/read Read a documentation page or an exact source file. The response identifies which kind was returned and includes the information needed to cite the page, package version, or repository commit. ## Choose a target For documentation, follow the `read` action from `POST /v1/list`, passing its `target` and non-null `path` unchanged. Browse hosted documentation with an explicit `site:` target; package and repository inventories include local documentation. Documentation results from `POST /v1/searches` also provide a `docs_read_target`, which you can pass as `target` without a path. An HTTP(S) target can include a fragment to select one indexed section. For source code, pass both `target` and the exact target-relative file `path`. Use a package target such as `crates:serde@1.0.0`, or a supported public repository locator such as `https://github.com/serde-rs/serde@master`. Find paths with `POST /v1/list`, `POST /v1/grep`, or a code result from `POST /v1/searches`. Repository refs use `@`; a literal `#` is not supported in a code target. When you have a read action, pass its `target` and non-null `path` unchanged. A scoped site target can use `/` to read its landing page. Preserve trailing slashes, query bytes, and literal percent bytes: they can identify distinct pages. Omit a null path. Encode both values as query parameters. Encode a literal `+` as `%2B`, `#` as `%23`, and `%` as `%25`; an unencoded `+` is decoded as a space. For example, `GET /v1/read?target=site%3Aexample.org%2Fguide&path=%2F` reads that scope's landing page. For a ready source target, absolute paths, dot segments, or trailing slashes are rejected with `400 VALIDATION_ERROR`. Target resolution or indexing errors can occur before the source path is validated. ## Interpret the result Branch on the required `kind` field: | `kind` | Result | | --- | --- | | `documentation` | Page identity, reusable `docs_read_target`, and exact crawled or repository source details. | | `code` | Target-relative and repository-root paths, binary status, and the requested, resolved, and served package version or repository commit. | Documentation and source files use 1-based inclusive line ranges. If no bounds are supplied, the complete page or file is returned; for a documentation URL, its fragment selects an indexed section. Explicit bounds override that fragment. An `end_line` past the end is clamped. Empty documentation has null bounds, while an empty text file has bounds `0`–`0`; binary code has null content and bounds. Explicit bounds require the `content` field group. ## Selector catalogue Use these selectors with the `fields` query parameter. Supplying `fields` replaces the defaults; `kind` and the identity and provenance fields for the returned branch remain present. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for the shared selection rules. | Selector | Documentation result | Code result | Default | | --- | --- | --- | --- | | `metadata` | Title, format, breadcrumbs, update and source context, and package ownership when known. | Detected language and total line count. | Yes | | `content` | Body, total lines, returned range, and resolved section anchor. | Body and returned range; values are null for binary files. | Yes | ## Wait for code indexing `wait_timeout_ms` controls how long to wait for code preparation, from `0` to `60000` milliseconds; the default is `20000`. Use `0` when the caller prefers an immediate `503 PACKAGE_INDEXING` response if code is not ready. Documentation reads do not use this budget for indexing. For failures, branch on the problem response's stable `code`. Correct malformed locators, paths, ranges, or selectors after `400 VALIDATION_ERROR`. A `404` means the requested page, file, package, version, repository, or ref was not found. A `409 DOCUMENTATION_PAGE_OWNER_CONFLICT` means the URL belongs to another documentation corpus. A `422` means the target exists but the requested section, file, package variant, or repository ref cannot produce one result. Respect `Retry-After` after `429 RATE_LIMITED`; retry `503 PACKAGE_INDEXING` later or with a positive wait budget. A `504 TIMEOUT` does not guarantee that preparation stopped. # Get search status and retained results Source: https://docs.githits.com/api-reference/v1/search/get-search-status-and-retained-results https://api.githits.dev/v1/openapi.json get /v1/searches/{search_ref} Retrieve the status and saved results of a search started with `POST /v1/searches`. Use this endpoint to follow a search that is still running or to retrieve its results again while they are retained. This reads the existing search without starting new work. Start a new search to change the query, targets, or result page. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `results` | Matching items, their text, relevance scores, source locations, and coverage information. | Yes | | `results.highlights` | Highlight locations within result titles and summaries. Also includes `results`. | No | | `results.*` | Results and highlights together. | No | | `sources` | Source status, applied filters, coverage, and suggested documentation sites. | No | | `progress` | Search request details, readiness counts, and available or suggested versions and refs. | No | # Search documentation, code and symbols Source: https://docs.githits.com/api-reference/v1/search/search-documentation-code-and-symbols https://api.githits.dev/v1/openapi.json post /v1/searches Search documentation, source code, and symbols across packages, public repositories, and documentation sites. Results include matching text and source locations you can use to read the original page or file. Use this endpoint to discover relevant documentation and implementations across projects. Searches can return while indexing or searching is still in progress; use `GET /v1/searches/{search_ref}` to retrieve subsequent results and status. ## Selector catalogue Use the following selectors with the `fields` query parameter to choose which fields the response includes. See [Choose what the response includes](https://docs.githits.com/api/requests-and-responses#choose-what-the-response-includes) for details. | Selector | Data | Default | | --- | --- | --- | | `results` | Matching items, their text, relevance scores, source locations, and coverage information. | Yes | | `results.highlights` | Highlight locations within result titles and summaries. Also includes `results`. | No | | `results.*` | Results and highlights together. | No | | `sources` | Source status, applied filters, coverage, and suggested documentation sites. | No | | `progress` | Search request details, readiness counts, and available or suggested versions and refs. | No | # Look up a vulnerability and affected packages Source: https://docs.githits.com/api-reference/v1/vulnerabilities/look-up-a-vulnerability-and-affected-packages https://api.githits.dev/v1/openapi.json get /v1/vulnerabilities/{id} Look up a vulnerability ID or known alias for its current source explanation and one page of grouped package evidence. Authentication and `public_read` authorization are required. To assess an installed release, follow up with `GET /v1/packages/{registry}/{name}/vulnerabilities?version=...`. | Read | Use it for | | --- | --- | | `advisory` | The served source's explanation, references, severity and original affected entries | | `affected_packages.entries` | Named packages with separate `source_evidence` and imported `advisories` | | `affected_packages.coverage` and `diagnostics` | Which evidence was acquired and what remains unresolved, including on empty pages | **Keep source and imported evidence separate.** The service groups canonical package identities; clients need not match aliases or infer registries. The live source and imported association rows can disagree in ranges, fixes or revision. Package-less Git evidence stays under `advisory.affected`; a CVE can still have useful imported GHSA package associations. Unsupported namespaces remain visible with a null registry. A null registry is not permission to guess one from a purl. `requested_id` preserves normalized caller intent. `advisory.osv_id` and each evidence branch's ID, URL and revision identify the record actually served. Lookup is exact-first; only an exact source 404 permits one uniquely recorded imported alias candidate. Imported associations use exact ID/direct aliases, with no recursive alias discovery or range merge. Each row keeps its own timestamps and withdrawal state. URLs identify current records, not archival snapshots. **Check coverage before interpreting an empty result.** `source_status` is `available`, `not_found`, `ambiguous` or `unavailable`; `imported_status` is `available` or `unavailable`. Imported `available` means that read completed, even with no rows, not worldwide coverage. Source failure can preserve useful imported packages; an imported-read failure can preserve source evidence. Partial reads return 200 with `diagnostics`. Source not-found plus checked empty imported evidence returns 404. Ambiguity without useful package evidence returns 422 with candidates when available; choose an explicit ID. Wholly unavailable evidence returns a provider error. Successful pagination and `has_next_page=false` do not establish completeness or safety. Diagnostics use stable `code`, displayable `message`, and `retryable`. Optional display failures include a JSON pointer `path`; acquisition diagnostics have null `path`. Branch on code rather than parsing messages. Response status, section, registry and code vocabularies are open. Known registry/status/section values use lowercase spelling; source discriminators and modification categories retain producer spelling. Honor `Retry-After` when present. **Distinguish ranges, displays and fixes.** Original affected entries retain repeated entries, nullable packages, ecosystem spellings, purls, explicit versions and ordered range events. Derived `affected_version_ranges` retains native comparisons, `semver:` ordering and `osv-invalid:` uncertainty; null means unavailable derivation. These are evidence strings, not manifest constraints. `affected_version_display` is presentation with at most ten spans, `total_count` and `truncated`; it is not matcher input. Null can mean unsupported interpretation or a diagnosed optional failure. Source `fixed_in_versions` contains source-reported SEMVER/ECOSYSTEM fixed release strings; it excludes Git commits, limits and last-affected boundaries. Imported fix lists retain storage order. These lists do not certify published or safe releases or recommend an upgrade. Use the package endpoint for version-specific assessment and candidate evidence. SEMVER ranges use semantic ordering, ECOSYSTEM uses its own ordering, and GIT requires repository ancestry rather than lexical hash sorting. `introduced` is inclusive (`0` means before all versions); `fixed` is an excluded fixing boundary; `last_affected` is inclusive and not a fix; `limit` is an exclusive boundary, not a fix (`*` means infinity). Missing event fields are null; no implicit events are added. Empty or null evidence never establishes safety. Timestamps remain strings with source precision; non-null `withdrawn_at` means withdrawn. Root and per-entry severity are independent. Raw vectors remain strings; an imported numeric `SEVERITY_LABEL` value is an approximation, not calculated CVSS. Prose is normalized source content, not trusted agent instructions. Reference URLs are not fetched and purls are identifiers; absent optional URLs are null, while unsafe schemes neutralized upstream become empty strings. `content_safety` reports normalization, not trust or severity. The fixed response has no `fields` selector. `limit` defaults to 5 and accepts 1–8 whole package groups; a group is never split between its advisory rows. No page is automatically drained. Continue with the same requested ID and `after`; evidence/revision changes invalidate cursors, while changing limit is allowed. Invalid or stale pages return 400, including when other source evidence is available. # API authentication Source: https://docs.githits.com/api/authentication Authenticate automated workflows with GitHits API tokens, and use CLI login or the playground for local testing. All documented API endpoints, including experimental ones, require a GitHits token in the `Authorization` header: ```http theme={null} Authorization: Bearer ``` Replace `` in your own environment. Do not put credentials in URLs, source files, screenshots, logs or agent conversations. The raw [OpenAPI contract](https://api.githits.dev/v1/openapi.json) is public and needs no token. ## Use an API token in automation Create an API token in [your token settings](https://app.githits.com/settings/tokens). Store it in your CI or runtime secret store and supply it in the bearer header. The [quickstart examples](/api/quickstart) expect the token in an environment variable named `GITHITS_API_TOKEN`; the API does not require that variable name. ## Use your CLI login The existing [GitHits login flow](/authentication) stores OAuth credentials in your system keychain by default. Scripts can capture a usable token with `npx githits@latest auth token`; the CLI refreshes an expired OAuth token when needed. The [quickstart](/api/quickstart) shows command substitution without printing the token. `GITHITS_API_TOKEN` takes precedence over the CLI's stored OAuth credentials. Check the source safely with: ```bash theme={null} npx githits@latest auth status ``` See [headless and CI authentication](/guides/headless-ci) for setup. Keep the normal keychain storage unless your environment requires another method; [file storage](/authentication#file-storage-mode) is unencrypted. Calling the REST API or using the playground does not invoke the CLI's token refresh. If a token expires, obtain a current token through your own login and replace the playground value. ## Use the API playground Enter the token value, without the `Bearer ` prefix, in the playground's bearer field. The playground adds the `Authorization` header for you. GitHits login is not integrated into this documentation site; enter credentials yourself, outside agent-controlled sessions. The playground uses your browser to send requests directly to `https://api.githits.dev`. Reading the docs needs no authentication, but sending a request uses your token's access and can perform the work described by the endpoint. > [!WARNING] > > Playground credentials can survive page reloads and carry across endpoint pages. Use a private browser session on a trusted device and close all private windows when finished. Do not assume the CLI's `logout` command clears browser data. For a regular browser session, remove the documentation site's stored data using your browser's site settings. If the browser reports a network error without a readable API response, do not paste your token into a bug report. Confirm the request destination and see [browser request errors](/api/errors#browser-request-errors). ## Resolve authentication errors For `AUTHENTICATION_REQUIRED`, check the bearer header and replace expired or invalid credentials. `TERMS_ACCEPTANCE_REQUIRED` means you must review and accept the applicable terms; follow the [terms acceptance instructions](/authentication#terms-of-service-acceptance). Other access failures are described in [errors](/api/errors). # API errors Source: https://docs.githits.com/api/errors Handle GitHits problem responses, request IDs, rate limits and ambiguous request outcomes. Errors normally return `application/problem+json`. Use the stable `code` field in your error-handling logic. The `detail` text explains the error for a person and can change. Each endpoint's reference lists its responses and examples. ## Choose the next action | HTTP status and code | Action | | - | - | | `400 VALIDATION_ERROR` | Check the endpoint's accepted inputs, encoding, `fields` values and parameter combinations. | | `401 AUTHENTICATION_REQUIRED` | Supply a usable bearer token. See [authentication](/api/authentication). | | `403 FORBIDDEN` | Verify that your account can access the requested resource. | | `403 ACCOUNT_INACTIVE` | Resolve your account's inactive state before retrying. | | `403 FEATURE_FLAG_REQUIRED` | The capability is not enabled for your account. Retrying the same request will not enable it. | | `403 TERMS_ACCEPTANCE_REQUIRED` | Review and accept the applicable terms through the documented acceptance flow. | | `404 PACKAGE_NOT_FOUND` or `VERSION_NOT_FOUND` | Check the registry, package name and requested version. | | `409 DOCUMENTATION_PAGE_OWNER_CONFLICT` | Use the `docs_read_target` returned for the intended documentation corpus. | | `422 DOCUMENTATION_SECTION_UNRESOLVED` | Use an indexed documentation fragment or explicit line bounds; see [read requests](/api/requests-and-responses#read-documentation-or-source-code). | | `429 RATE_LIMITED` | Respect `Retry-After` when provided and reduce request frequency. | | `503 PACKAGE_INDEXING` | Code is not ready. Retry later or set a positive `wait_timeout_ms` on the read request. | | `502 UPSTREAM_ERROR` or `504 TIMEOUT` | Check the endpoint's retry guidance before deciding whether to send another request. | This table covers common cases, not every endpoint-specific code. A timeout does not guarantee that work stopped. Repeating [example generation](/api-reference/v1/examples/generate-an-example-from-open-source-references) can save another example. Each [feedback submission](/api-reference/v1/feedback/submit-solution-or-session-feedback) creates a new record, even if you send the same feedback again. [Experimental Research](/api-reference/v1/experimental/research-a-question-with-cited-sources) also saves answers and follow-up turns; repeating a request can create another thread or turn. Research answer generation can take up to 210 seconds. Set your client timeout longer than 210 seconds. A `504 TIMEOUT` does not make retrying safe: generation may continue, and repeating the request can create another thread or turn. For [lockfile analysis](/api/lockfile-analysis), retain the accepted job ID and check its status instead of resubmitting. A new submission is a new analysis and can consume quota again. Synchronous SBOM generation has no saved result to resume. ## Rate-limit headers Operations that document usage headers can return `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` on successful or rate-limited responses when usage information is available. The trio is omitted when that information is unavailable; the credential type alone does not guarantee it. `X-RateLimit-Reset` is an absolute Unix timestamp in seconds, not a delay. Use these values to pace requests, while handling `429` and honoring `Retry-After`: concurrent requests or other quotas can still exhaust a limit. These headers are not exposed for example generation, Research, feedback, language discovery, SBOM generation, or lockfile job submission, events, and results. Consult each operation's reference. ## Keep the request ID Save `X-Request-ID` from the response headers. A normal problem response's `instance` matches this ID. Include it with the endpoint, approximate time, status and problem code when reporting a failure. Remove authorization headers and sensitive request content from reports. If the service cannot create a request identity, it returns an empty HTTP `500` without a request ID. Clients must handle that case without assuming every failure body is JSON. ## Browser request errors A browser can block a cross-origin response before the playground can display its status or body. Check the destination URL and whether your browser reports a CORS failure. A browser network error alone does not prove your token is invalid or that no work occurred. The playground sends live requests from `https://docs.githits.com`. If you are reading a preview or another copy of these docs, use the [cURL quickstart](/api/quickstart) in your own terminal. The API does not allow those other sites to send playground requests. # SBOM, audit and licenses Source: https://docs.githits.com/api/lockfile-analysis Upload manifests and lockfiles to generate SBOMs, audit dependencies and read compact license reports through the experimental REST API. Upload your manifests and lockfiles to an asynchronous analysis job, then retrieve an SBOM, dependency audit findings or a compact license report through the REST API. > [!TIP] > > To run these analyses from a repository or CI, use [Scan (`githits-scan`)](/scan/overview). > [!NOTE] > > These operations are experimental and pre-production. The [v1 contract](/api/versioning) is not finalized; routes and report schemas can change. ## Choose an operation Submit to `POST /v1/experimental/lockfile-jobs` with the query parameters below. Each submission returns HTTP `202` with a job ID and progress URLs. | Operation | Submit query | After submission | | - | - | - | | Generate an SBOM | `kind=sbom`, `format=cyclonedx` (or `spdx`, `text`) | Follow `events_url` until success, then download `result_url` | | Audit dependencies | `kind=audit`, `format=json` | Follow `events_url` until success, then download JSON from `result_url` | | Read a license report | `kind=sbom`, `format=cyclonedx` | Follow `events_url` until success, then read `GET /v1/experimental/license-reports/{id}` | Follow the event stream for progress, or read the returned `status_url` for the latest snapshot. For license reports, use the job ID to read the compact report instead of downloading the SBOM result. Use a [bearer token](/api/authentication) for an active account with the required terms accepted. The examples expect `GITHITS_API_TOKEN` in your environment, `curl` and `jq`. Supply the token through your secret store and keep shell tracing disabled. Run from your repository root and substitute your own files. Choose one submission below; each saves its response as `job.json` for the follow-up commands. ## Prepare files Send individual UTF-8 files as repeated multipart `files[]` parts, with raw contents rather than base64, archives or a repository URL. Preserve paths relative to a common repository root, such as `app/package.json` and `app/package-lock.json`. Let curl set the multipart content type and boundary. Supported inputs include Cargo, npm/pnpm/Yarn classic and Berry, uv/Poetry/PDM/Pipenv, Go `go.mod`, Swift, Gradle, NuGet, Dart, Composer, Mix, Bundler, Rebar, Conan and Go dep. This list is non-exhaustive; recognition depends on filenames and contents. See the [upload and format reference](/api-reference/v1/experimental/generate-an-sbom-from-uploaded-files) for details. `go.sum` and `requirements.txt` are unsupported: do not upload them as companion files. One unusable file rejects the entire upload with `422 UNUSABLE_MANIFEST`; companion files are not silently ignored. Lockfiles can be submitted alone. | Upload limit | Value | | - | - | | Files per request | 1–256 | | Bytes per file | At most 5,242,880 | | Complete multipart body, including framing | At most 8,000,000 bytes | | Filename length | At most 1,024 UTF-8 bytes | Filenames must be relative and cannot contain backslashes, empty segments, `.` or `..` segments, or control characters. Preserve directory structure so manifests can be associated with lockfiles. A nested manifest does not automatically inherit an ancestor lockfile. Analysis submissions consume quota. The current default reserves 100 daily units per analysis; failures after admission do not necessarily refund them. A new submission can consume quota again. Status reads, progress connections and result reads, including compact license reports, do not resubmit the analysis or reserve another 100 units. Handle `429` using `Retry-After` when supplied. See the [submission reference](/api-reference/v1/experimental/submit-a-lockfile-analysis-job) for admission rules. ## Submit an SBOM job This example uploads a Cargo manifest and lockfile and requests CycloneDX JSON: ```bash theme={null} curl --fail-with-body --silent --show-error \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --form 'files[]=@Cargo.toml;filename=Cargo.toml' \ --form 'files[]=@Cargo.lock;filename=Cargo.lock' \ --output job.json \ 'https://api.githits.dev/v1/experimental/lockfile-jobs?kind=sbom&format=cyclonedx' ``` Choose the format at submission; `Accept` does not select it: | `format` | Download | | - | - | | `cyclonedx` (default) | CycloneDX 1.7 JSON; save as `bom.cdx.json` | | `spdx` | SPDX 2.3 tag-value, not JSON; save as `bom.spdx` | | `text` | Human-readable inventory report; save as `bom.txt` | ## Submit an audit job Audit uses the same job route with `kind=audit&format=json`. This example uploads a Python uv lockfile: ```bash theme={null} curl --fail-with-body --silent --show-error \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --form 'files[]=@uv.lock;filename=uv.lock' \ --output job.json \ 'https://api.githits.dev/v1/experimental/lockfile-jobs?kind=audit&format=json' ``` For either submission, check curl's exit status before using `job.json`. With `--fail-with-body`, an HTTP failure saves a problem response there. A successful [submission response](/api-reference/v1/experimental/submit-a-lockfile-analysis-job) includes `id`, `state`, `expires_at`, `status_url`, `events_url` and `result_url`. Retain these values. The URLs are relative to `https://api.githits.dev`. ## Follow progress and download Stream the returned `events_url` with bearer authentication. `--no-buffer` displays server-sent events as they arrive: ```bash theme={null} EVENTS_URL=$(jq -r '.events_url' job.json) curl --fail-with-body --silent --show-error --no-buffer \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --header 'Accept: text/event-stream' \ "https://api.githits.dev$EVENTS_URL" ``` Apply each `snapshot` event as a complete state replacement. Revisions are nondecreasing but can repeat: state or attempt can change at the same revision. If the stream closes before a terminal snapshot, reconnect to the same URL for the latest snapshot, not historical replay. Stop streaming and reconnecting when `state` is `succeeded` or `failed`. Disconnecting does not cancel the job. See the [progress reference](/api-reference/v1/experimental/stream-lockfile-analysis-progress). You can also read the returned `status_url` for the [latest status](/api-reference/v1/experimental/get-lockfile-analysis-status): ```bash theme={null} STATUS_URL=$(jq -r '.status_url' job.json) curl --fail-with-body --silent --show-error \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ "https://api.githits.dev$STATUS_URL" ``` Only after `state` is `succeeded`, download the SBOM or audit result before `expires_at`. This example saves CycloneDX; use `audit.json`, `bom.spdx` or `bom.txt` for the other outputs. For a license report, skip this download and use the next section. ```bash theme={null} RESULT_URL=$(jq -r '.result_url' job.json) curl --fail-with-body --silent --show-error \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --output bom.cdx.json \ "https://api.githits.dev$RESULT_URL" ``` Check curl's exit status before consuming the file: an HTTP failure saves a problem response instead of the result. Successful downloads contain the document directly, without a JSON wrapper. The [result endpoint](/api-reference/v1/experimental/download-a-completed-lockfile-analysis) returns `409 ANALYSIS_PENDING` while work continues and `409 ANALYSIS_FAILED` for a failed job. A `result_url` is present even before the result is ready. Unknown, expired and inaccessible jobs return `404 ANALYSIS_NOT_FOUND` after authentication. Retain the job ID and read its status after a timeout instead of automatically submitting again. ## Read a compact license report Submit the [SBOM job above](#submit-an-sbom-job) with `kind=sbom&format=cyclonedx`, then follow its events until `state` is `succeeded`. Use that submission's `id` to read the compact license report. Do not download `result_url` for this flow. ```bash theme={null} JOB_ID=$(jq -r '.id' job.json) curl --fail-with-body --silent --show-error \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --output license-report.json \ "https://api.githits.dev/v1/experimental/license-reports/$JOB_ID" ``` The successful response is the compact JSON report with `schema_version: 2`. This read uses the existing analysis, with the same authorization and expiry; it does not start another analysis. Check curl's exit status before consuming the report file. This endpoint requires a finished CycloneDX SBOM job. Audit, SPDX and text jobs return `409 INCOMPATIBLE_ANALYSIS`; pending and failed jobs return `409 ANALYSIS_PENDING` and `409 ANALYSIS_FAILED`. Use the submission's job ID, not a component's `bom_ref`. The [OpenAPI definition](https://api.githits.dev/v1/openapi.json) documents `GET /v1/experimental/license-reports/{id}` under **Preview a compact report for a completed analysis** (`get_compact_dependency_licenses`). ## Interpret results A successful analysis can still describe a partial inventory. Inspect completeness and per-manifest resolution information. Compatible lockfiles supply recorded versions; uncovered manifests resolve separately. GitHits does not verify that a lockfile is up to date, and an SBOM does not guarantee an exact installed inventory. Audit JSON contains findings and independent coverage information. Inspect both: no findings does not prove that every dependency was assessed. The compact license report contains `schema_version`, `inventory` input and coverage context, and `components` with license evidence, not a policy verdict or certification. Keep reported license choices, publisher context and source-file observations distinct. Inspect inventory and license coverage separately; missing licenses or empty choices mean unavailable information, not that no license applies or every file was checked. A successful response does not certify installed artifacts or complete license coverage. ## Also available Synchronous `POST /v1/experimental/sbom`, `POST /v1/experimental/licenses` and `POST /v1/experimental/license-reports` are not recommended and are likely to be removed. The legacy `GET /v1/experimental/licenses/{id}` returns schema 1; use the compact schema-2 read above for new integrations. # GitHits REST API Source: https://docs.githits.com/api/overview Direct HTTP access to dependency source, documentation, and package data. Use the REST API for deeper integration with your retrieval and orchestration code. Coding agents and software factories can also use [MCP](/quickstart) or the [CLI](/cli/commands). | Item | Value | | - | - | | Base URL | `https://api.githits.dev/v1` | | Authentication | `Authorization: Bearer ` | | Response format | JSON for most operations; SBOM documents and job event streams use their documented media types | | API definition | [OpenAPI JSON](https://api.githits.dev/v1/openapi.json) | * [Quickstart](/api/quickstart): make your first request. * [Requests and responses](/api/requests-and-responses): parameters, field selection, and result handling. * [Authentication](/api/authentication): tokens and credential handling. * [Errors](/api/errors): status codes and retries. * [SBOM, audit and licenses](/api/lockfile-analysis): upload manifests and lockfiles to generate an SBOM, audit dependencies or read a compact license report through experimental analysis jobs. > [!NOTE] > > The API is available for evaluation. The [v1 contract](/api/versioning) is not yet finalized. # API quickstart Source: https://docs.githits.com/api/quickstart Inspect an exact package version with an authenticated HTTP request to the GitHits API. This example inspects Express `4.18.2`; substitute a package version your software depends on. You need a GitHits account, an API token and `curl`. ## Authenticate Create an API token in [your token settings](https://app.githits.com/settings/tokens). The examples below expect it to be available in the `GITHITS_API_TOKEN` environment variable. Supply that variable through your CI or runtime secret store. The API reads your token from the `Authorization: Bearer` header; your integration can use any variable name or credential-storage mechanism. See [API authentication](/api/authentication) for credential handling. The command below assumes the secret is already available in the environment. Do not write the token into the command, enable shell tracing or copy credentials into an agent conversation. ## Inspect an exact package version ```bash theme={null} curl --silent --show-error --include \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ 'https://api.githits.dev/v1/packages/npm/express?version=4.18.2' ``` A successful request returns HTTP `200` with JSON containing `package` and `selected_version`. The package identity includes its latest version; `selected_version` describes the requested release, `4.18.2`. Keep that version information with the results your workflow uses. The package’s latest version can change independently. The response headers include `X-Request-ID` for diagnostics and `Cache-Control: no-store`. If the request fails, use its HTTP status and problem `code` to choose the next action; see [errors](/api/errors). ## Add vulnerability information Use `fields` to choose what the response includes. This request keeps the basic package and release information and adds vulnerability counts and up to five recent advisories affecting Express `4.18.2`: ```bash theme={null} curl --silent --show-error --include \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ 'https://api.githits.dev/v1/packages/npm/express?version=4.18.2&fields=package,selected_version,security.*' ``` The `package` and `selected_version` choices keep the information from your first request. `security.*` adds the security information. When you specify `fields`, it replaces the endpoint's default choices, so include everything you need. See [Requests and responses](/api/requests-and-responses#choose-what-the-response-includes) for how `fields` works, and [Inspect a package release](/api-reference/v1/packages/inspect-a-package-release) for all available choices. ## Find documentation and source files List source files, including repository documentation, for the same release: ```bash theme={null} curl --silent --show-error \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --header 'Content-Type: application/json' \ --data '{"target":"npm:express@4.18.2","limit":20,"wait_timeout_ms":20000}' \ 'https://api.githits.dev/v1/list' ``` Follow an entry's `read` action with its exact `target` and non-null `path` at `GET /v1/read`. Preserve those values instead of constructing a path from its display name. If the source is still being prepared, follow the response's preparation guidance. Hosted documentation is a separate inventory. Use an explicit `site:` target: ```bash theme={null} curl --silent --show-error \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --header 'Content-Type: application/json' \ --data '{"target":"site:expressjs.com","limit":20}' \ 'https://api.githits.dev/v1/list' ``` Follow the returned page's `read` action in the same way. Both read types use `GET /v1/read`; the response's `kind` identifies documentation or code. See [Read documentation or source code](/api/requests-and-responses#read-documentation-or-source-code) for copyable read requests and response handling. ## Test locally with your CLI login For local development, you can use your existing [GitHits CLI login](/authentication). Log in with `npx githits@latest login`, then run this in your own Bash or Zsh terminal. The command captures the current token without printing it and clears the temporary variable afterward. It uses `GITHITS_ACCESS_TOKEN` for that temporary value so it does not overwrite `GITHITS_API_TOKEN`, which the CLI reads first. Keep shell tracing disabled. If `GITHITS_API_TOKEN` is set, the CLI uses that credential instead of local OAuth storage. ```bash theme={null} GITHITS_ACCESS_TOKEN=$(npx githits@latest auth token) && curl --silent --show-error --include \ --header "Authorization: Bearer $GITHITS_ACCESS_TOKEN" \ 'https://api.githits.dev/v1/packages/npm/express?version=4.18.2' unset GITHITS_ACCESS_TOKEN ``` ## Try the same request in the browser Open [Inspect a package release](/api-reference/v1/packages/inspect-a-package-release), choose **Try it**, enter your bearer token in the authorization field, and set `registry` to `npm`, `name` to `express` and `version` to `4.18.2`. Check that the destination is `https://api.githits.dev` before choosing **Send**. The playground sends a live API request. Browser credentials can persist across reloads; follow the [playground authentication guidance](/api/authentication#use-the-api-playground). # Requests and responses Source: https://docs.githits.com/api/requests-and-responses Choose response information with fields, encode parameters and read documentation or source code through the unified GitHits API. GitHits endpoints use common request conventions. Each endpoint's reference describes the parameters it accepts and the information it returns. ## Choose what the response includes The `fields` parameter lets you request the information your application or agent needs. For example, package inspection returns basic package and release information by default. You can also ask for download counts, vulnerability information or release notes. Add `fields` to the URL as a query parameter. Separate multiple choices with commas. For package inspection: | Request | Information returned | | - | - | | Omit `fields` | Default package and selected-release information | | `fields=security` | Vulnerability counts and whether the selected release is affected | | `fields=security.*` | The security information above, plus up to five recent advisories affecting the selected release | | `fields=package,selected_version,security.*` | The default information plus the security information and recent advisories | **When you supply `fields`, your choices replace the defaults.** Include the default groups explicitly if you want to keep them. Some information, such as the package name and resolved version in package inspection, is always returned so you can identify the result. This request keeps the default package and release information and adds security information for Express `4.18.2`: ```bash theme={null} curl --silent --show-error \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ 'https://api.githits.dev/v1/packages/npm/express?version=4.18.2&fields=package,selected_version,security.*' ``` This example expects your API token in `GITHITS_API_TOKEN`, as explained in the [quickstart](/api/quickstart). The quotes around the URL ensure your shell passes the whole URL, including `&`, to `curl`. ### Check the choices for your endpoint Each endpoint defines its own allowed `fields` values. Use the names listed in its reference; a property appearing in a JSON response does not automatically make it an accepted `fields` value. For example, package inspection accepts `security.*` as a name for security counts and recent advisories. That does not mean `*` works with every name or endpoint. Likewise, requesting `package` does not include the separately listed `package.downloads` information. `fields` stays in the URL for both GET and POST requests. For a POST, put the other inputs in the JSON body as shown in the endpoint reference. Send one `fields` parameter containing your comma-separated choices, rather than repeating the parameter. Not every endpoint accepts `fields`. If the reference does not list it, use that endpoint's normal response. Unsupported choices return `400 VALIDATION_ERROR`. Selecting less information can reduce the response size. It does not always reduce the work needed to produce the result; each endpoint explains when a choice changes the work performed. ## Choose a target Identify the package, repository, or documentation you want to work with: | Operation | Target input | | - | - | | List and read | A compact `target` or returned read locator, with paths as described by the operation | | Source diff | Package `registry`, `name`, `from_version`, and `to_version`, or `repo_url`, `from_ref`, and `to_ref` | | Research | One structured `target` or an existing `thread_id`, together with `question` | To compare repository refs, pass a public GitHub, GitLab.com, or Codeberg URL in `repo_url`, with `from_ref` and `to_ref` identifying the two revisions. To start [Research](#research-a-question-with-cited-sources), send a question and a package, GitHub repository, or documentation-site target. For a follow-up, send the returned `thread_id` with your next question. ## Wait for indexing Set `wait_timeout_ms` to give GitHits time to prepare content that is still being indexed. `POST /v1/list` returns without waiting by default (`0`). Code reads through `GET /v1/read` wait up to 20 seconds by default (`20000`). Values are in milliseconds; each endpoint's reference lists its allowed range. ## Pass request parameters * Put URL parameters after `?` and separate them with `&`, as in the example above. * For JSON request bodies, send `Content-Type: application/json`. Use the exact property names shown in the reference, such as `current_version`. * Encode special characters in URL values. A scoped npm package such as `@scope/package` becomes `%40scope%2Fpackage` in the package-name part of the path. * When a version contains a literal `+`, write `%2B` in the URL. An unencoded `+` in a query value is read as a space. * For `GET /v1/read`, pass `target` as a query parameter. Encode a literal `+` as `%2B` and a documentation fragment marker (`#`) as `%23`. With `curl`, use `--get` and `--data-urlencode` as shown below. ## Read documentation or source code [Read documentation or source code](/api-reference/v1/read/read-documentation-or-source-code) uses one endpoint: `GET /v1/read`. Follow returned read actions with their `target` and non-null `path` unchanged; omit a null path. | Read | Inputs | | - | - | | Documentation page or section | A returned read action's `target` and non-null `path`, or a search result's `docs_read_target` as `target` without `path`. | | Source file | `target`: a package target such as `npm:express@4.18.2`, or a supported public repository URL with an optional `@ref`. `path`: the exact target-relative file path. | ### Read a documentation page [List documentation paths](/api-reference/v1/list/list-files-and-documentation-paths) with an explicit `site:` target and follow an entry's `read` action. Alternatively, [search documentation](/api-reference/v1/search/search-documentation-code-and-symbols) and pass the returned `docs_read_target` unchanged, including any fragment. Replace `` below with that search value; the command encodes it as a query value. ```bash theme={null} curl --silent --show-error --get \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --data-urlencode 'target=' \ 'https://api.githits.dev/v1/read' ``` ### Read a source file Find an exact path with [file listing](/api-reference/v1/list/list-files-and-documentation-paths), [source text search](/api-reference/v1/grep/find-regex-or-literal-matches-across-source-and-documentation), or a code search result. Follow the returned read action's target and path; display paths can differ from read paths. Preserve the served version or commit for an exact follow-up. This example reads from Express `4.18.2`. Replace `` with a path discovered for that release. ```bash theme={null} curl --silent --show-error --get \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --data-urlencode 'target=npm:express@4.18.2' \ --data-urlencode 'path=' \ 'https://api.githits.dev/v1/read' ``` Repository targets use `@` to introduce a ref, for example `https://github.com/expressjs/express@4.18.2`. A literal `#` is not supported in code targets. ### Handle the read response Branch on the required `kind` field: | `kind` | Identity and source information | | - | - | | `documentation` | `id`, reusable `docs_read_target`, and `source` with the crawled page URL or exact repository locator. | | `code` | `path`, `repository_file_path`, `is_binary`, `target_resolution`, `code_index_state`, and `indexing_ref`. Use `target_resolution.served` to identify the artifact that supplied the content. | Both branches return `metadata` and `content` by default. `fields=metadata` omits the body; `fields=content` omits descriptive metadata. Identity and source information remain present. Read text from `content.body` when selected; binary code has null body and range values. `start_line` and `end_line` are positive, 1-based inclusive bounds. Without bounds, the complete page or file is returned, or a documentation URL's fragment selects an indexed section. Either explicit bound overrides the fragment and requires `content` in `fields`. An end beyond the last line is clamped. Empty documentation has null bounds; an empty text file has bounds `0`–`0`. For code preparation, `wait_timeout_ms` defaults to `20000` and accepts `0`–`60000`. With `0`, code that is still being prepared returns `503 PACKAGE_INDEXING` immediately. Documentation reads do not use this indexing wait budget. See the [read reference](/api-reference/v1/read/read-documentation-or-source-code) for target validation and endpoint-specific errors. ### Migrate separate read requests The separate documentation and code read endpoints have been removed from the current v1 contract. Send both kinds of request to `GET /v1/read`. Follow returned read actions with their `target` and non-null `path`, or pass a documentation locator as `target` alone. Update response handling to branch on `kind` and use the corresponding identity and content fields above. ## Interpret the result Keep the returned package version or commit and source references with the information your workflow uses. When discovery returns a target for a later source or documentation read, follow the endpoint's instructions for using that target. Check whether a response reports incomplete information or when its data was last updated. HTTP `200` means the request succeeded; some endpoints can still report missing or incomplete data. An omitted property, `null`, an empty list and zero can mean different things. The reference explains those meanings for each response. For failed requests, use the HTTP status and the response's `code` to decide what to do next. See [API errors](/api/errors) for troubleshooting and retry guidance. ## Research a question with cited sources [Research](/api-reference/v1/experimental/research-a-question-with-cited-sources) generates a Markdown answer with source URLs through `POST /v1/experimental/research`. Answer generation can take up to **210 seconds**; configure your client timeout to exceed that deadline. Start with a question and one structured `target`: a package, GitHub repository, or documentation site. This example uses the token setup from the [quickstart](/api/quickstart) and allows 240 seconds for the response: ```bash theme={null} curl --silent --show-error --max-time 240 \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --header 'Content-Type: application/json' \ --data '{"target":{"registry":"npm","name":"express","version":"5.1.0"},"question":"How does error handling work?"}' \ 'https://api.githits.dev/v1/experimental/research' ``` The response contains `answer_markdown`, ordered `sources` with URLs, a `tool_call_id` for diagnostics, and a `thread_id` for follow-ups. Source URLs are not guaranteed to be valid `read` targets. For a follow-up, reuse the returned `thread_id` instead of sending `target`. Replace `` below with that value: ```bash theme={null} curl --silent --show-error --max-time 240 \ --header "Authorization: Bearer $GITHITS_API_TOKEN" \ --header 'Content-Type: application/json' \ --data '{"thread_id":"","question":"What about async handlers?"}' \ 'https://api.githits.dev/v1/experimental/research' ``` Send exactly one of `target` or `thread_id` together with `question`; the public API does not accept a question alone. Research saves answers and follow-up turns. After a timeout, consult the [retry guidance](/api/errors) before repeating a request. # API versioning Source: https://docs.githits.com/api/versioning Distinguish the GitHits v1 API contract from package versions and track reference updates. The public API uses `/v1` in endpoint paths. Its API address is `https://api.githits.dev`, and its machine-readable contract is [OpenAPI JSON](https://api.githits.dev/v1/openapi.json). > [!NOTE] > > The v1 contract is not yet finalized. You can evaluate the API now, but its requests and responses may change before that contract is finalized. ## API versions and package versions These values describe different things: | Value | Meaning | | - | - | | `/v1` | The HTTP API's versioned namespace. | | OpenAPI `3.1.0` | The format of the machine-readable specification. | | OpenAPI `info.version` | The API document's declared version, separate from the URL namespace. | | An endpoint's `version` parameter | The package release or supported constraint to inspect, where that endpoint accepts it. | Each endpoint explains how it identifies packages and resolves versions. Do not assume every endpoint accepts the same registries, constraints or Git refs. ## Experimental operations The **Experimental** reference group contains endpoints that may change routes before becoming part of the main API: | Operation | Current route | | - | - | | [Research a question with cited sources](/api-reference/v1/experimental/research-a-question-with-cited-sources) | `/v1/experimental/research` | | [Compare two exact source trees](/api-reference/v1/experimental/compare-two-exact-source-trees) | `/v1/experimental/code/diff` | | [Resolve a target name](/api-reference/v1/experimental/resolve-a-target-name) | `/v1/experimental/targets/resolve` | | [Generate an SBOM](/api-reference/v1/experimental/generate-an-sbom-from-uploaded-files) | `/v1/experimental/sbom` | | [Submit a lockfile analysis job](/api-reference/v1/experimental/submit-a-lockfile-analysis-job) | `/v1/experimental/lockfile-jobs` | Lockfile jobs also have status, event-stream, and result routes under `/v1/experimental/lockfile-jobs/{id}`. See [lockfile analysis](/api/lockfile-analysis) for the workflow. Use [`POST /v1/code/diff`](/api-reference/v1/code-diff/compare-two-exact-source-trees) for source comparisons. The experimental diff route remains available as a deprecated alias. Research uses operation ID and public MCP tool ID `research`, with `Research*` schemas such as `ResearchRequest` and `ResearchResponse`. The previous experimental route and tool ID were removed; there is no compatibility alias. See [Research requests and follow-ups](/api/requests-and-responses#research-a-question-with-cited-sources). Use the current routes shown in the reference. Check the release notes for changes before updating your integration. ## Follow contract changes The v1 reference is generated from the deployed production contract. API releases and documentation rebuilds are separate steps; maintainers update the reference and affected guides together. See the [changelog](/changelog/overview) for released changes. Use documented schemas and stable error codes when writing a client. Keep returned version information and check whether results are complete and when their data was updated. The endpoint reference explains which fields can be absent or null and which values are guaranteed. # Authentication special cases Source: https://docs.githits.com/authentication Handle GitHits authentication manually for CI, headless machines, custom storage, and troubleshooting. For normal local setup, `npx githits@latest init` handles authentication automatically. You only need this page for CI, headless machines, custom credential storage, or troubleshooting. For HTTP requests and the browser playground, see [API authentication](/api/authentication). The storage guidance below applies to the CLI's credentials. > [tab] Browser OAuth (recommended) > > Browser OAuth is the recommended method for local development. It opens a secure login flow in your browser and stores the resulting credentials in your system keychain so they refresh automatically. > > **Log in** > > ```bash theme={null} > npx githits@latest login > ``` > > This opens your browser to the GitHits OAuth page. Sign in or create an account, authorize the app, and your browser redirects back. The CLI confirms when authentication is complete. > > **Useful flags** > > | Flag | What it does | > | - | - | > | `--no-browser` | Prints a login URL instead of opening a browser. Use this for SSH sessions, containers, or other headless environments. | > | `--force` | Re-authenticates even if you are already logged in. | > | `--port ` | Uses a specific port for the local OAuth callback server. | > > **Example: headless login** > > ```bash theme={null} > npx githits@latest login --no-browser > ``` > > The callback still listens on the machine running the CLI. If the browser is on another computer, choose a fixed callback port and forward it over SSH: > > ```bash Remote host theme={null} > npx githits@latest login --no-browser --port 8765 > ``` > > ```bash Browser machine theme={null} > ssh -N -L 8765:127.0.0.1:8765 user@remote-host > ``` > > Keep the tunnel open while you open the printed sign-in URL. Replace `user@remote-host` with your SSH destination. > [tab] API token > > For CI pipelines, automation scripts, and environments where browser login isn't practical, set the `GITHITS_API_TOKEN` environment variable. > > ```bash theme={null} > export GITHITS_API_TOKEN=ghi-your-token-here > ``` > > When this variable is set, GitHits uses the token directly and skips the keychain. You can create an API token in [your token settings](https://app.githits.com/settings/tokens). > > Personal API tokens and project API keys are static credentials. They are not refreshed like OAuth sessions. From CLI and MCP 0.34.0, authentication failures with `gh-proj-` project keys no longer attempt an OAuth refresh. Check or replace a rejected key instead of repeating browser login. > > **Example: CI environment variable** > > ```bash theme={null} > GITHITS_API_TOKEN=ghi-your-token-here npx githits@latest auth status > ``` > > For CI systems, set the variable as a secret in your CI provider rather than hardcoding it in scripts. > > > [!TIP] > > > > API tokens are the recommended approach for all non-interactive environments. They require no keychain access and work in any shell without additional setup. ## Keychain storage When you use browser OAuth, GitHits stores your credentials in the system keychain by default. The keychain used depends on your operating system: | Platform | Keychain | | - | - | | macOS | Keychain Access | | Windows | Credential Manager | | Linux | Secret Service (e.g., GNOME Keyring, KWallet) | GitHits reads from the keychain only when it actually needs the token — for example, during a tool call, a token refresh, or when you run `npx githits@latest auth status`. A small non-secret metadata file is written alongside credentials so routine startup checks do not need to hit the keychain. On macOS you may see a prompt: **"githits wants to access ... in your keychain"**. Choose **Always Allow** if you trust the installed `githits` CLI. This is a macOS system prompt that GitHits cannot customize. ## File storage mode If keychain prompts keep appearing even after choosing **Always Allow**, or if you are on a system without a keychain backend, you can switch OAuth credential storage to file mode. > [!WARNING] > > File mode stores OAuth credentials as plain JSON files. They are written with private permissions, but they are not encrypted. Any process running as your operating-system user can read them. Use file mode only on machines where you trust local user-account access. For CI and automation, use `GITHITS_API_TOKEN` instead. **Option 1: Config file (persistent)** Set `storage = "file"` in your GitHits config file: ```toml macOS / Linux theme={null} # ~/.config/githits/config.toml # (or $XDG_CONFIG_HOME/githits/config.toml) [auth] storage = "file" ``` ```toml Windows theme={null} # %APPDATA%\githits\config.toml [auth] storage = "file" ``` The config directory may be empty until you create `config.toml`. Create it if it does not already exist. **Option 2: Environment variable (one session)** ```bash theme={null} GITHITS_AUTH_STORAGE=file npx githits@latest login --force ``` This opts into file storage for a single login without changing your config. ## Check authentication status At any time, you can inspect your current auth setup: ```bash theme={null} npx githits@latest auth status ``` This shows whether you are authenticated, where credentials are sourced from (keychain, file, or environment variable), and token expiry details when available. ## Log out To remove stored credentials: ```bash theme={null} npx githits@latest logout ``` This deletes the locally stored tokens. If you used `npx githits@latest init` to configure your coding tools, `logout` removes credentials only — your MCP configuration is preserved. Run `npx githits@latest uninstall` separately if you want to remove the MCP configuration as well. ## Sign-in required errors From CLI and MCP 0.38.0, example search and Research return sign-in guidance when GitHits needs you to sign in again. The interactive CLI and local MCP server can open a returned sign-in link in your browser automatically. Noninteractive CLI commands and `--json` output return the guidance without opening a browser. Hosted MCP availability depends on the deployed package version and client. In JSON, the error uses code `REAUTH_REQUIRED` with `retryable: false`. `details.reauthUrl` contains the sign-in link when available. Open the link, finish signing in, then retry the request. If no link is returned, sign in again in the [GitHits app](https://app.githits.com), then retry. ## Terms of Service acceptance Authenticated requests can return `TERMS_ACCEPTANCE_REQUIRED` when your account must accept the current GitHits Terms of Service. The CLI and local stdio MCP return a clear remediation command instead of retrying indefinitely: ```bash theme={null} npx githits@latest settings terms accept ``` Hosted MCP clients can direct you to the browser acceptance page instead. Review the current [Terms of Service](https://githits.com/legal/terms-of-service/) before accepting. ### Check your current status ```bash theme={null} npx githits@latest settings terms ``` Use `--json` to return the `terms_required` field as JSON. ### Accept from the CLI The acceptance command asks for confirmation in an interactive terminal. Pass `--yes` only after you have reviewed the terms: ```bash theme={null} npx githits@latest settings terms accept --yes ``` For machine-readable output, add `--json`. The response includes `accepted`, `token_refreshed`, and the updated settings object. After acceptance, OAuth sessions force-refresh so later requests carry the updated terms state. If acceptance succeeds but refresh fails, run `npx githits@latest login --force` before retrying. Opaque `GITHITS_API_TOKEN` credentials are not refreshed. GitHits checks their updated acceptance state on the next request. # Changelog Source: https://docs.githits.com/changelog/overview Recent updates to GitHits — new features, improvements, and bug fixes. **November 9, 2026** ## githits-scan 0.4.0 Released [githits-scan 0.4.0](https://github.com/githits-com/githits-scan/releases/tag/v0.4.0). ### Added * **Experimental dependency diff.** `githits-scan diff --base [--head ]` compares direct and transitive dependency changes between Git revisions or against your working tree, including advisory changes and direct upgrade evidence. It requires Git and an API token, counts as two audits, and ignores configuration in favor of `--exclude` and `--lockfiles-only`. Exit code 0 is informational, not a policy pass. * **JSON and Markdown from one diff.** `diff --output-json diff.json --output-markdown diff.md` saves both reports from the same analysis. Use either option alone, or `-` for stdout on one of them. These options can't be combined with `--format` or `-o/--output`. * **Advisory ignores.** `[[audit.ignore]]` entries with an exact advisory `id` and a `reason` keep the finding and reason visible in text, JSON, and saved analyses without failing the audit. Other audit categories and incomplete evidence still fail. See [audit dependencies](/scan/commands#audit-dependencies). * **Git-source license exceptions.** License exceptions can match a Git dependency by exact `name` and `git` URL, optionally pinned to a full `rev`. See [package exceptions](/scan/configuration#package-exceptions). * **Remediation explanations.** Audit recommendations show the checked effects of each change when available, in saved explanations and JSON. * **Homebrew.** Install with `brew install githits-com/tap/githits-scan`. See [install with Homebrew](/scan/installation#install-with-homebrew). ### Changed * **Nonblank exception reasons.** Every license exception needs a nonblank `reason`. Fill in blank reasons before upgrading. If you return to an older version, remove `[[audit.ignore]]` and Git-source exception entries first. * **License coverage warnings.** License checks warn on stderr when no components were evaluated or resolution was incomplete, and for offline SBOMs without inventory completeness evidence. Warnings also appear in quiet and JSON modes and don't change verdicts or exit codes. * **Compact license rows.** Human license check and report output combines equivalent default and develop occurrences. JSON inventory is unchanged. * **Installation guidance.** Homebrew is the recommended install on macOS and Linux, and crates.io is the primary Cargo method. Prebuilt binaries remain supported. See [installation](/scan/installation). ### Fixed * **Clearer remediation choices.** Audit output separates advisory-reported fix versions from recommendations and explains conflicts, unresolved findings, override coverage, and verification limits. * **Blocked dependency names.** Remediation blockers show the requested dependency name, and JSON and saved analyses keep it as `dependency_name`. * **Detect configuration guidance.** `detect --config FILE --save` creates a missing file from the commented template. Other commands reject a missing explicit configuration with exit code 2. **November 9, 2026** ## GitHits 0.40.3 Released [githits 0.40.3](https://github.com/githits-com/githits-cli/releases/tag/v0.40.3) and [@githits/mcp 0.40.2](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.40.2). ### Changed * **Simpler API key handling.** CLI and MCP handle API keys the same way regardless of key format. Existing keys and browser sign-in keep working, with no action needed. See [authentication](/authentication). * **Custom token providers control refresh (@githits/mcp).** If you embed `@githits/mcp` with your own token provider, your provider now decides whether credentials can be refreshed. Providers that can't refresh should return `undefined` from refresh. Hosted MCP receives these changes when the service adopts and deploys the released package. **November 9, 2026** ## GitHits 0.40.2 Released [githits 0.40.2](https://github.com/githits-com/githits-cli/releases/tag/v0.40.2) and [@githits/mcp 0.40.1](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.40.1). ### Fixed * **Client support for the new API key prefixes.** CLI and MCP now recognize `sk-githits-` personal keys and `sk-githits-proj-` project keys. Existing `ghi-` and `gh-proj-` keys keep working, so you don't need to rotate. See [authentication](/authentication). ### Security * **Patched CLI HTTP client.** `githits` now depends on undici 7.30.2. The update fixes cache and redirect responses leaking between users, a subresource integrity bypass, and a cache denial of service (CVE-2026-116592, CVE-2026-116630, CVE-2026-120474, CVE-2026-120415, CVE-2026-120222, and CVE-2026-120423). Hosted MCP receives these changes when the service adopts and deploys the released package. **November 5, 2026** ## GitHits 0.40.1 Released [githits 0.40.1](https://github.com/githits-com/githits-cli/releases/tag/v0.40.1). @githits/mcp stays at 0.40.0. ### Fixed * **Claude plugin listing links.** The Claude plugin listing now links to GitHits support, documentation, and terms of service. See [marketplace and plugin installs](/installation/automatic-setup#marketplace-plugin-and-extension-installs). **November 5, 2026** ## GitHits 0.40.0 Released [githits 0.40.0](https://github.com/githits-com/githits-cli/releases/tag/v0.40.0) and [@githits/mcp 0.40.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.40.0). ### Added * **Full OSV advisory reports.** `pkg vulns --details` (MCP `pkg_vulns` with `details: true`) returns the full advisory report and source metadata for direct advisories. Reports follow finding groups and keep assessments even when a source fails. `githits vulns --verbose` adds OSV schema, related and upstream IDs, and credits. See [Package Intelligence](/tools/package-inspection). ### Changed * **Clearer advisory assessments.** Assessments show only nonredundant matched ranges and label aggregate fixes as candidate fix versions. Source report text does not change affectedness results or confirm a safe upgrade. ### Fixed * **Claude plugin packaging.** The Claude marketplace entry now installs a self-contained plugin without extra dependency files, and its icon passes Claude's validator. See [marketplace and plugin installs](/installation/automatic-setup#marketplace-plugin-and-extension-installs). Hosted MCP receives these changes when the service adopts and deploys the released package. **November 4, 2026** ## GitHits 0.38.0 – 0.39.0 Released githits [0.38.0](https://github.com/githits-com/githits-cli/releases/tag/v0.38.0), [0.38.1](https://github.com/githits-com/githits-cli/releases/tag/v0.38.1), and [0.39.0](https://github.com/githits-com/githits-cli/releases/tag/v0.39.0), plus matching [@githits/mcp](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.39.0) releases. ### Added * **Advisory ID lookup (CLI).** `githits vulns ` looks up CVE and OSV IDs and lists affected packages, version ranges, reported CVSS scores, and source-reported fixes. Use `--verbose` for original source evidence. MCP has no equivalent tool. For package-level advisories, see [`pkg vulns`](/tools/package-inspection). * **Pub packages.** CLI and MCP accept `pub:` package targets for package analysis, resolution, source, and docs. See [target resolution](/tools/target-resolution). * **Googlesource repositories.** Search, read, list, grep, and diff accept public `*.googlesource.com` HTTPS project URLs, including refs. See [code navigation](/tools/code-navigation). * **Generated release-note markers.** Changelog and upgrade reviews mark generated notes and their status compactly. See [Package Intelligence](/tools/package-inspection). ### Changed * **Shorter agent guidance.** MCP instructions, tool descriptions, CLI help, and Skills are condensed. Refresh MCP tool discovery after updating if your client caches descriptions. * **Clearer grep regex help.** CLI grep help explains alternation versus literal pipe characters. ### Fixed * **Selected release in package overviews.** Package overviews show the default selected release and its publish date, and explain when the registry's latest version is skipped. JSON adds `latestVersion`, `latestVersionPublishedAt`, and `registryLatestDifference`. * **Sign-in recovery.** Example search and [Research](/tools/research) return a sign-in link when needed. The interactive CLI and local MCP can open it automatically. See [authentication](/authentication). * **Research limit recovery.** After a daily [Research limit](/tools/research#rate-limits), GitHits suggests a scoped search when possible. Guidance clarifies that cooldowns apply across targets, questions, and threads. * **More tolerant CLI arguments.** `--lines N` accepts single-line reads. Oversized grep context is capped at 10 lines and reported instead of failing. * **Reliable follow-ups.** Resolver follow-ups replay correctly for Googlesource and scoped site addresses. Dependency output keeps registry namespaces and distinguishes SDK sources. Hosted MCP receives these changes when the service adopts and deploys the released package. **October 29, 2026** ## GitHits 0.37.0 Released [githits 0.37.0](https://github.com/githits-com/githits-cli/releases/tag/v0.37.0) and [@githits/mcp 0.37.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.37.0). ### Added * **Migration guides in upgrade reviews.** CLI and MCP upgrade reviews link to available migration guides for the version range. JSON output preserves the guide details. See [Package Intelligence](/tools/package-inspection). ### Fixed * **Self-contained MCP tool descriptions.** Tool descriptions no longer mention retired tool names or migration notes, and repeated guidance is trimmed. Tool selection and follow-up instructions are unchanged. Refresh MCP tool discovery after updating if your client caches descriptions. Hosted MCP receives these changes when the service adopts and deploys the released package. **October 27, 2026** ## GitHits 0.36.1 Released [githits 0.36.1](https://github.com/githits-com/githits-cli/releases/tag/v0.36.1) and [@githits/mcp 0.36.1](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.36.1). ### Fixed * **Accurate MCP state annotations.** [`get_example`](/tools/code-examples) and [`research`](/tools/research) now set `readOnlyHint: false` and `idempotentHint: false` because they consume credits and save results or research threads. Every built-in tool sets all four boolean annotations explicitly. Refresh MCP tool discovery after updating if your client caches annotations. ### Security * **Scoped setup guidance.** Onboarding Skills separate hosted MCP connection from local setup and keep the setup scope you choose. Agents validate suggested setup commands and ask for your authorization before running the CLI, signing in, or accepting terms. * **Bounded recovery and upgrade reviews.** Onboarding validates relayed sign-in links and stops if secure credential storage fails. Package upgrade reviews stay evidence-only unless you ask the agent to implement the upgrade. Hosted MCP receives these changes when the service adopts and deploys the released package. **October 26, 2026** ## GitHits 0.36.0 Released [githits 0.36.0](https://github.com/githits-com/githits-cli/releases/tag/v0.36.0) and [@githits/mcp 0.36.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.36.0). ### Added * **Package-path advisories.** Unified grep shows one compact warning per distinct package-path correction in CLI and MCP text. Grep JSON includes a new `pathWarnings` array of warning strings. Results, failures, and pending targets are preserved. See [code navigation](/tools/code-navigation). * **Package source-match disclosure.** When a package version's match to its source is uncertain, read, list, search, grep, and diff show a notice inline beside the exact source revision. Diff covers both sides. CLI and MCP JSON preserve the source assessment. ### Changed * **Clearer path scope.** CLI, MCP, and Skills guidance explain package-relative and repository-relative paths. Follow-ups keep the returned target and path together, and indexing retries keep the original scope. See [code navigation](/tools/code-navigation#choose-a-target). ### Fixed * **Accurate grep preparation errors.** Missing, ambiguous, and unrecoverable targets are reported as such instead of as indexing. Retry guidance and structured details are preserved in CLI and MCP output. * **Path recovery commands.** Suggested CLI retry commands quote paths safely, including paths that start with a dash. Ambiguous symbol candidates name the target each path belongs to. * **Complete guidance setup and cleanup.** [Guided setup](/installation/automatic-setup#guided-mcp-setup-default) installs and repairs skill reference files. [`uninstall`](/cli/commands) removes them and deletes instruction files left empty after GitHits guidance is removed. Unrelated content is preserved. * **Smoother progress.** [Live progress](/tools/research#live-progress) no longer briefly falls back to a generic "Starting..." stage after the opening message. ### Security * **Node security update.** GitHits development and CI now use Node 24.22.1 with the October 2026 security fixes. If you run the CLI or STDIO MCP server locally, update your own Node runtime separately. Hosted MCP receives these changes when the service adopts and deploys the released package. **October 22, 2026** ## Public API documentation refresh Updated API guides cover file listing, source comparisons, and experimental dependency analysis. * **Unified file and documentation listing.** The [API quickstart](/api/quickstart#find-documentation-and-source-files) uses `POST /v1/list` and returned read actions, replacing the removed package-docs and code-files routes. * **Stable source diff route.** Use `POST /v1/code/diff` for new integrations. The experimental route remains a deprecated alias. See [API versioning](/api/versioning#experimental-operations). * **Experimental lockfile analysis.** The new [guide](/api/lockfile-analysis) covers synchronous SBOM generation, asynchronous SBOM and audit jobs, progress, result retrieval, and coverage limits. * **Rate-limit response headers.** The [error guide](/api/errors#rate-limit-headers) explains when usage headers are available and how to interpret the reset timestamp. * **Target inputs and indexing waits.** The [request guide](/api/requests-and-responses#choose-a-target) explains how to select a package or repository, start Research, and wait for content to be indexed. **October 20, 2026** ## GitHits 0.33.0, 0.34.0, and 0.35.0 Released [githits 0.33.0](https://github.com/githits-com/githits-cli/releases/tag/v0.33.0), [0.34.0](https://github.com/githits-com/githits-cli/releases/tag/v0.34.0), and [0.35.0](https://github.com/githits-com/githits-cli/releases/tag/v0.35.0), with [@githits/mcp 0.33.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.33.0), [0.34.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.34.0), and [0.35.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.35.0). ### Added * **Launchpad Git targets (0.33.0).** Search, list, grep, and read accept owner-qualified repositories and mutable defaults through `launchpad:`, `lp:`, and supported Launchpad URLs. Follow-ups preserve canonical repository identities and refs. Bazaar is unsupported. Diff accepts these targets, but comparisons between different commits currently return `RAW_DIFF_UNAVAILABLE`. See [repository targets](/tools/code-navigation#choose-a-target), including GitLab and Codeberg support available since 0.15.0. * **Package registry provenance (0.33.0).** Package info shows the metadata-supplying registry's name and URL. Info, dependency, and vulnerability JSON include `registryRepository` when known. See [Package Intelligence](/tools/package-inspection). * **MCP progress (0.34.0).** Local MCP forwards live stages for `research` and `get_example` when the client requests progress. Display depends on the client; unavailable progress does not prevent a result. * **CLI progress and MCP animation (0.35.0).** Interactive `research` and `example` commands show live stages with an animated mark. JSON and piped output are unchanged. Custom MCP hosts can configure `progress` and `progressAnimation`; see [live progress](/tools/research#live-progress). ### Changed * **Progress does not delay calls (0.35.0).** Calls start without waiting for the progress connection. Early updates may be skipped; the final result remains authoritative. * **Example guidance (0.35.0).** CLI, MCP, and Skills describe examples as drawn from projects across open source. Example behavior is unchanged; verify version-sensitive APIs against your dependency version. ### Fixed * **Grep coverage and recovery (0.33.0).** Text distinguishes complete empty searches from preparation, unavailable content, and partial coverage. Retry guidance names targets and preserves cursor and wait controls. * **Project API key authentication (0.34.0).** Rejected project keys no longer trigger an OAuth credential refresh. Only signed-in sessions refresh. Hosted MCP receives these changes when the service adopts and deploys the released package. **October 19, 2026** ## GitHits 0.31.0 and 0.32.0 Released [githits 0.31.0](https://github.com/githits-com/githits-cli/releases/tag/v0.31.0) and [0.32.0](https://github.com/githits-com/githits-cli/releases/tag/v0.32.0), with [@githits/mcp 0.31.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.31.0) and [0.32.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.32.0). ### Added * **Stable Research (0.31.0).** CLI `research` and MCP `research` are available by default, including in the public MCP package. No experimental opt-in is needed. Ask a question directly, pass a package or repository target, and reuse the returned thread for follow-ups. See [Research](/tools/research). * **Unknown vulnerability assessments (0.31.0).** CLI `pkg vulns --scope unknown` and MCP `pkg_vulns` with `advisory_scope: "unknown"` show advisories that could not be evaluated and explain why. Direct and opt-in transitive reports retain unknown counts, including dependency packages with only unknown assessments. Upgrade reviews also retain direct unknown counts. See [Package Intelligence](/tools/package-inspection). * **Cargo registry alias (0.32.0).** Package targets accept `cargo:` as an alias for public crates.io `crates:` across package, search, navigation, changelog, and diff commands and MCP tools. Structured registry inputs accept `cargo`; canonical registry identities remain `crates`. ### Changed * **Research guidance (0.31.0).** The quick-start guide and Skills include stable Research routing. Agents ask the question directly because sources are always included, use package or repository targets instead of documentation sites, and retry with the matching candidate when Research asks for a target. * **Breaking for custom MCP hosts (0.31.0).** Custom providers must supply the Research service required by the public MCP package. See the [MCP package integration guide](https://github.com/githits-com/githits-cli/blob/mcp-v0.31.0/packages/mcp/README.md). ### Fixed * **Version and ref recovery (0.31.0).** CLI and MCP errors retain available package-version and repository-ref suggestions in JSON and show concise retry actions in text when possible. See [troubleshooting](/guides/troubleshooting). * **MCP cancellation (0.32.0).** All network-backed MCP tools now pass caller cancellation through to their in-flight requests. Cancelled calls are not retried after credential refresh. Hosted MCP receives these changes when the service adopts and deploys the released package. **October 15, 2026** ## GitHits 0.30.0 Released [githits 0.30.0](https://github.com/githits-com/githits-cli/releases/tag/v0.30.0) and [@githits/mcp 0.30.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.30.0). ### Added * **Change filters.** CLI `pkg changelog` and `pkg upgrade-review` accept `--changes actionable|important|all`. MCP `pkg_changelog` and `pkg_upgrade_review` accept `changes`. `important` includes actionable and "should know" statements. See [Package Intelligence](/tools/package-inspection). ### Changed * **Complete changelog statements.** Package changelogs show every parsed release-note statement by default, with available agent classifications, uncertainty markers, coverage, and nearby sources. Use `--verbatim` or MCP `verbatim: true` to see the original notes. `--verbose` and MCP `verbose` remain as deprecated aliases. * **Complete upgrade evidence.** Upgrade reviews collect every matching changelog statement with source links and context. Batch triage still covers the whole version range. * **Breaking: changelog JSON.** Default JSON returns parsed statements instead of raw bodies. Use `--verbatim --json` or `verbatim: true, format: "json"` to get original bodies. * **Breaking: upgrade review JSON.** `changelog.statements` replaces `changelog.riskItems`, and `riskCoverage.itemsOmitted` is removed. Update scripts that read these fields. * **Cited research answers.** Local MCP [`research`](/tools/research) guidance treats results as verified answers. Agents cite the listed sources directly and read a source only when the answer lacks a needed detail. ### Fixed * **Consistent CLI JSON errors.** With `--json`, argument parsing, authentication, storage, and unexpected failures return a structured error envelope. Routine update notices no longer appear in JSON output. Hosted MCP receives changes when the service adopts and deploys the released package. **October 12, 2026** ## GitHits 0.29.0 Released [githits 0.29.0](https://github.com/githits-com/githits-cli/releases/tag/v0.29.0) and [@githits/mcp 0.29.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.29.0). ### Added * **Classified upgrade evidence.** CLI `pkg upgrade-review` and MCP `pkg_upgrade_review` show agent-classified release-note quotes grouped by version, split into "Possibly requires action" and "Should know". Uncertain classifications are marked `(uncertain)`. Reports include changelog coverage and keep lexical keyword matches separate. Batch output ranks packages by confident action count. See [Package Intelligence](/tools/package-inspection). * **Statement data in JSON.** JSON output includes each statement's raw text, complete `fullText`, source `url`, tier, kind, confidence, model provenance, and pre-cap totals. ### Changed * **Upgrade review text.** Note references appear beside each version, and the compatibility disclaimer footer is removed. Classifications are evidence, not a package verdict. Hosted MCP receives changes when the service adopts and deploys the released package. **October 9, 2026** ## GitHits 0.28.0 Released [githits 0.28.0](https://github.com/githits-com/githits-cli/releases/tag/v0.28.0) and [@githits/mcp 0.28.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.28.0). ### Changed * **Breaking: search waits use milliseconds.** CLI `search` and `search status` `--wait` now take integer milliseconds, matching other commands. Replace `--wait 30` or `--wait 30s` with `--wait 30000`. Seconds suffixes are no longer accepted. See [Code](/cli/commands#code). * **Shorter GitHits guide.** The MCP skill and [`quick_start`](/tools/quick-start) share a shorter, sectioned guide covering tool choice, workflow, targets, results, dependency upgrades, and external content. * **Upgrade verification guidance.** MCP and CLI guidance tell agents to run local before-and-after checks when upgrading dependencies. Agents preserve the original source and lockfiles, compare behavior after upgrading, fix unintended differences, and report verification gaps. ### Fixed * **Consistent indexing waits.** Search, search status, read, list, and grep wait up to 30000 ms for indexing when you omit a wait. Pass an explicit `0` to return immediately. Longer waits no longer hit HTTP timeouts early, and expired responses report a `TIMEOUT` error. ### Security * **Dependency refresh.** The CLI updates runtime dependencies to address known advisories and keeps Node 20 support. Hosted MCP receives changes when the service adopts and deploys the released package. **October 7, 2026** ## GitHits 0.27.1 Released [githits 0.27.1](https://github.com/githits-com/githits-cli/releases/tag/v0.27.1) and [@githits/mcp 0.27.1](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.27.1). * **Shorter search and grep output.** Text results use concise counts and shared Read, More results, and Follow-up guidance. Source details, coverage warnings, JSON output, and request behavior are preserved. * **Read the sources behind examples.** CLI and MCP examples request copyable source-reading commands or tool calls when the service supports them. Source links, licenses, and JSON envelopes are preserved. See [Example](/tools/code-examples). * **Clearer changelog ranges.** CLI help and MCP guidance explain that `@from..to` excludes the starting version and includes the ending version. Query `@from` separately for that release's own notes. See [Package Intelligence](/tools/package-inspection). Hosted MCP receives changes when the service adopts and deploys the released package. **October 6, 2026** ## GitHits 0.27.0 Released [githits 0.27.0](https://github.com/githits-com/githits-cli/releases/tag/v0.27.0) and [@githits/mcp 0.27.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.27.0). * **Target resolution is available by default.** `githits resolve` and MCP `resolve_target` no longer require experimental opt-in. Use them to find a package, repository, or documentation target from a dependency name. See [Target resolution](/tools/target-resolution). * **Partial search results by default.** Search returns available hits while other targets or sources prepare. Use CLI `--no-allow-partial` or MCP `allow_partial_results: false` to wait for all runnable targets and sources before returning hits. See [Code](/tools/code-navigation#search). * **Readable MCP errors.** Text responses explain failures directly. Use `format: "json"` when a script needs structured error codes and retry information. * **Clearer source and indexing details.** Results show consistent source identities, known commit dates, indexing estimates, and retry guidance. * **Full changelog bodies with verbose output.** MCP `pkg_changelog` accepts `verbose: true` alongside `body_lines` or `omit_bodies: true`; verbose text includes the full bodies. Hosted MCP receives changes when the service adopts and deploys the released package. **October 5, 2026** ## GitHits 0.26.0 Released [githits 0.26.0](https://github.com/githits-com/githits-cli/releases/tag/v0.26.0) and [@githits/mcp 0.26.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.26.0). * **Source diff is available by default.** `githits code diff` and MCP `code_diff` no longer require experimental opt-in. Comparisons cover the whole repository, including for package targets. See [Code](/tools/code-navigation#code-diff). * **Automatic skill refresh.** Local CLI MCP startup refreshes older, unchanged GitHits-managed `githits-mcp` installs. Edited, unrecognized, and newer content stays untouched. Disable refresh with [`skills.auto_update = false`](/cli/configuration#the-skills-section) or [`GITHITS_DISABLE_SKILL_UPDATE`](/cli/environment-variables#githits_disable_skill_update). * **Search during indexing.** Results identify the indexed commit and offer a pinned read while the default branch indexes. Finished searches direct agents to a new search instead of further polling. * **GitHits-first guidance.** Guided `init` tells agents to use GitHits first for code, docs, examples, and package lookups. Rerun guided setup to update installed instructions. * **Accurate site wait outcomes.** CLI and MCP list JSON preserve `FAILED` and `SUPERSEDED` outcomes. Update scripts that branch on `outcome` to handle them. * **Breaking provider API change.** Custom `@githits/mcp` providers must implement `codeDiff` on `codeNavigationService`. The built-in client already does. * **Documentation homepage.** The npm package and plugin manifests now link to `docs.githits.com`. Hosted MCP receives changes when the service adopts and deploys the released package. **October 1, 2026** ## GitHits 0.25.0 and 0.25.1 Releases [githits 0.25.0](https://github.com/githits-com/githits-cli/releases/tag/v0.25.0) and [0.25.1](https://github.com/githits-com/githits-cli/releases/tag/v0.25.1), with [@githits/mcp 0.25.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.25.0) and [0.25.1](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.25.1), update MCP grep and add explicit session identifiers. ### Changed * **Unified MCP grep.** In 0.25.0, [`grep`](/tools/code-navigation#grep) replaces `code_grep`. It searches ordered package, repository, and hosted documentation targets with the same defaults as CLI `githits grep`: RE2 regex, case-sensitive matching, and zero context. Migrate to `targets` objects and the new parameters; set `pattern_type: "literal"` and `ignore_case: true` to retain the old matching behavior. Legacy CLI `githits code grep` remains available. ### Added * **Explicit session identifiers.** In 0.25.1, [`GITHITS_SESSION_ID`](/cli/environment-variables#githits_session_id) overrides automatic request grouping in the CLI and local MCP server. Values must match `[A-Za-z0-9_-]{1,64}` and are transmitted unchanged. Empty or malformed values fail validation without being echoed; unset the variable to restore automatic detection and hashing. Refresh local MCP tool discovery after updating. Hosted MCP availability depends on the deployed server version; local environment variables do not reconfigure it. **September 30, 2026** ## GitHits 0.24.0 Releases [githits 0.24.0](https://github.com/githits-com/githits-cli/releases/tag/v0.24.0) and [@githits/mcp 0.24.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.24.0) add unified CLI grep, replace the MCP inventory tools with one `list` tool, and make read follow-ups exact across search, listing, and research results. ### Added * **Unified CLI grep.** `githits grep` searches one or more package, repository, and hosted documentation targets in order. It defaults to regex, case-sensitive matching with zero context lines. Pass `-F` for literal text, `-i` for case-insensitive matching, or `-s` for ripgrep-style case sensitivity. Text output groups matches by file or page with aligned line numbers and numbered locators you can copy into a read. GitHits reports partial coverage explicitly, including unvisited scopes, and returns a cursor to continue. JSON output stays lossless. Legacy CLI `code grep` and MCP `code_grep` remain available. ```bash theme={null} # Search source and hosted docs together, case-insensitive literal match githits grep -Fi 'router' npm:express site:expressjs.com ``` ### Changed * **Unified MCP `list` tool.** One MCP `list` tool replaces `code_files` and `docs_list` for package, repository, and explicit site inventories. Its description still mentions both retired names so stale tool searches find it. Default text includes the opaque `after` continuation when more entries are available. Grouped CLI commands such as [`code files`](/cli/commands#npx-githits-latest-code-files) and `docs list` remain available. * **Backend-selected read actions.** Search and status results and `list` inventories emit read commands with the target, path, selector, and bounds that the backend selected. Replay the complete action instead of rebuilding it. Capped MCP continuations keep the whole remaining selection and served revision. CLI commands handle filenames that start with a dash. JSON shapes and caps are unchanged. * **Compact search text.** CLI and MCP [`search`](/tools/code-navigation#search) text no longer repeats a read command under every hit. Hit headers remain usable for reads, and JSON keeps each hit's exact `followUp` action. * **Claude plugin metadata.** The Claude plugin manifest now includes the GitHits display name, publisher contact email, and publisher website. ### Fixed * **Case-insensitive list filters.** CLI and MCP `list` accept language and file-type filter names in any casing. * **Leading-slash site selectors.** CLI and local MCP `list` accept one leading `/` in a site path and keep it within the `site:` target's scope. `/` alone browses the target's root. * **Site directory paths.** CLI [`list`](/cli/commands#npx-githits-latest-list) text no longer drops the first directory component or prints repeated `/` entries for descendant sites. CLI and MCP read-path guidance now uses the supplied site target as the base. ### Experimental * **Research renders backend Markdown.** Experimental CLI and local MCP [`research`](/tools/experimental-tools) display the complete Markdown returned by the API, so answer sections and citations can change without a client release. JSON output now returns a minimal envelope with `display_markdown` and optional IDs. **Breaking:** this replaces the previous structured answer and source JSON. Update any scripts that parse Research JSON. Refresh local MCP tool discovery after updating and switch `code_files` and `docs_list` calls to `list`. Hosted MCP clients receive these changes after the service adopts `@githits/mcp` 0.24.0 and deploys. **September 28, 2026** ## GitHits 0.23.0 Releases [githits 0.23.0](https://github.com/githits-com/githits-cli/releases/tag/v0.23.0) and [@githits/mcp 0.23.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.23.0) add CLI inventories and site-page reads and update search evidence. ### Added * **Unified CLI inventories.** [`githits list`](/cli/commands#npx-githits-latest-list) browses one package, repository, or explicit documentation site. It supports path and glob selectors, recursive traversal, source filters, cursor pagination, paths-only `--silent` output, and JSON with read actions and metadata. Package and repository inventories contain source files; use a `site:` target for hosted docs. CLI `code files` is deprecated in help but remains available. MCP retains `code_files` and `docs_list`. * **Site-page reads.** CLI and local MCP [`read`](/tools/documentation-access#read) accept an emitted `site:` target plus a host-relative page path, with an optional heading selector. Repository documentation reads return indexed file content with snapshot identity. ### Changed * **Search JSON migration.** `search` and `search_status` remove `summary`, `highlights.summary`, hit `contentSafety`, and `repositoryEvidence.focusedSource`. Use the [current evidence fields](/tools/code-navigation#search): `matchedSource`, indexed-field provenance, semantic context, and `documentationPreview`. ### Fixed * **Advisory applicability.** CLI `pkg vulns` and MCP `pkg_vulns` label advisories as affecting the inspected version or historical when the service supplies that status. JSON retains its applicability fields. * **Package-addressed repository docs.** Search headers and generated read follow-ups use the served package target, target-relative path, and line range consistently, while JSON retains snapshot provenance. Refresh local MCP tool discovery after updating. Hosted clients receive MCP changes after service adoption and deployment of `@githits/mcp` 0.23.0. Local environment variables do not reconfigure hosted MCP or plugin endpoints. **September 25, 2026** ## GitHits 0.21.0, 0.22.0, and 0.22.1 Releases [githits 0.21.0](https://github.com/githits-com/githits-cli/releases/tag/v0.21.0), [0.22.0](https://github.com/githits-com/githits-cli/releases/tag/v0.22.0), and [0.22.1](https://github.com/githits-com/githits-cli/releases/tag/v0.22.1), plus [@githits/mcp 0.21.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.21.0) and [0.22.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.22.0), add selector and code-symbol reads, rename the local experimental `ask` tool to `research`, and move package changelog lookup to compact targets. ### New * **Selector reads.** `githits read --selector` and the MCP [`read`](/tools/documentation-access) `selector` parameter read a single documentation heading or indexed code symbol. Ambiguous, missing, and unsupported selections return clear outcomes with recovery guidance. * **Compact code-symbol reads.** Read a package or repository symbol with `target#symbol`, plus an optional exact path. GitHits picks code or documentation presentation from the result. Available in CLI 0.22.1; `@githits/mcp` 0.22.0 already includes it. ### Changed * **Experimental `ask` is now `research`.** The local MCP tool is renamed to `research`, matching the [public API](/api/requests-and-responses#research-a-question-with-cited-sources). The CLI uses `githits research` and keeps `githits ask` as an alias. Local MCP clients with experimental tools enabled must switch from `ask` to `research`. See [experimental tools](/tools/experimental-tools). * **Package-only changelog targets.** MCP [`pkg_changelog`](/tools/package-inspection) now takes one required `target`, such as `npm:express`, `npm:express@5.2.1`, or `npm:express@4.21.2..5.2.1`. It replaces `registry`, `package_name`, `repo_url`, `git_ref`, `from_version`, and `to_version`. The CLI drops `--repo-url` and `--git-ref` and keeps `--from`/`--to` for ranges. Exact pins return one release or `VERSION_NOT_FOUND`. Empty selections now succeed instead of returning `NOT_FOUND`. * **Clearer compact target guidance.** CLI help, agent guidance, and MCP schemas explain how omitting a suffix selects the latest package or default branch, and how package-subpath scope differs from full-repository scope. ### Fixed * **Clearer candidate search hits.** Text [`search`](/tools/documentation-access) results show bounded inspection windows, visible query fragments, and enclosing declarations in candidate headers. Fallback summaries are no longer presented as verified matches. * **No server error pages in errors.** CLI and MCP errors keep the HTTP status and safe JSON details without dumping HTML or plain-text response bodies. MCP callers must refresh tool discovery and migrate `pkg_changelog` calls to `target`. CLI users must replace repository changelog lookups with package targets. Hosted MCP clients at `https://mcp.githits.com` receive these changes after the service adopts `@githits/mcp` 0.22.0 and deploys. **September 23, 2026** ## GitHits 0.22.0 Releases [githits 0.22.0](https://github.com/githits-com/githits-cli/releases/tag/v0.22.0) and [@githits/mcp 0.22.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.22.0) add selector reads, rename the experimental local `ask` entrypoints to `research`, and clean up search hit headers and HTTP error output. ### Added * **Selector reads.** [`read`](/tools/code-navigation#read) now accepts a `selector` that reads a documentation heading or an indexed code symbol by name, so you don't need line ranges or URL fragments. On the CLI, pass `--selector`. For code symbols, add an exact path to narrow resolution to one file. Ambiguous, missing, and unsupported-snapshot selections return typed outcomes with recovery guidance. ```bash theme={null} # Read an indexed code symbol githits read npm:express@5.2.1 --selector Router # Read a documentation heading by its logical heading ID githits read --selector ``` On MCP, call `read` with `target` and `selector`, plus an optional `path` for code. ### Changed * **Experimental local `ask` renamed to `research`.** The local stdio MCP tool is now `research`. The CLI command is now `githits research`, and `githits ask` still works as an alias. If your local MCP client calls `ask` with [experimental tools](/tools/experimental-tools) enabled, switch it to `research`. Both CLI spellings now report `command.research` telemetry. This matches the [public API rename](#public-api-research-replaces-ask) below. ### Fixed * **Clearer candidate search hits.** CLI and MCP text [search](/tools/code-navigation) results now show bounded inspection windows, visible identifier-query fragments, and known enclosing declarations in candidate headers. Fallback summaries are no longer presented as verified source matches. * **No server error pages in errors.** HTTP errors in the CLI and MCP keep the status code and safe JSON details. They no longer include HTML or plain-text response bodies. MCP callers must refresh tool discovery after updating. Hosted MCP clients at `https://mcp.githits.com` receive selector reads after the service adopts `@githits/mcp` 0.22.0 and deploys. **September 23, 2026** ## Public API: Research replaces Ask The experimental source-cited answer operation is now [Research](/api-reference/v1/experimental/research-a-question-with-cited-sources): `POST /v1/experimental/research`, operation ID and public MCP tool ID `research`, and `Research*` public schemas. The previous experimental route and tool ID have been removed without aliases. Answer generation can take up to **210 seconds**. Set a longer client timeout and reuse the returned `thread_id` for follow-up questions. See the [request examples](/api/requests-and-responses#research-a-question-with-cited-sources) and [timeout guidance](/api/errors). [githits 0.22.0](https://github.com/githits-com/githits-cli/releases/tag/v0.22.0) applies the same rename to the [local experimental tools](/tools/experimental-tools). The local stdio MCP tool is now `research`, and the local server no longer registers `ask`. `githits research` is the canonical CLI command, and `githits ask` remains an alias with the same behavior. Start a new agent session so local MCP clients discover `research`. **September 18, 2026** ## GitHits 0.20.0 Releases [githits 0.20.0](https://github.com/githits-com/githits-cli/releases/tag/v0.20.0) and [@githits/mcp 0.20.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.20.0) finish the compact-target migration for package tools, tighten shared agent instructions, and keep automatic documentation follow-ups stable when hosted pages get republished. ### Changed * **Compact package targets on MCP.** [`docs_list`](/tools/documentation-access), [`pkg_info`, `pkg_vulns`, and `pkg_deps`](/tools/package-inspection) now take a single string `target` such as `npm:express@5.2.1` instead of separate `registry`, `package_name`, and `version` fields. `pkg_info` requires an unpinned latest-only target. CLI syntax, filters, and returned output are unchanged, and `docs_list` retry hints now use the new target syntax. `pkg_changelog` and `pkg_upgrade_review` keep their structured inputs. * **Leaner agent instructions.** The shared MCP routing guide and packaged [skills](/installation/skills) now centralize common policy once, keep only the call essentials on each tool, and fit catalog selection sentences into 79 characters. Guidance around changelog caps and dependency graph opt-ins is clearer, and runtime behavior is unchanged. ### Fixed * **Hosted documentation follow-ups stay stable across publications.** Automatic search follow-ups now reuse mutable hosted page URLs or the exact emitted fragment instead of stale line bounds, so republishing a hosted docs page no longer breaks the next [`read`](/tools/documentation-access) call. Repository-document snapshots and explicit read ranges are unchanged. MCP callers must refresh tool discovery and migrate the four changed package tool call shapes after updating. Hosted MCP clients at `https://mcp.githits.com` receive these changes after the service adopts `@githits/mcp` 0.20.0 and deploys. **September 16, 2026** ## GitHits 0.18.0 Releases [githits 0.18.0](https://github.com/githits-com/githits-cli/releases/tag/v0.18.0) and [@githits/mcp 0.18.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.18.0) collapse code and search inputs to a single compact `target` string, move repository revisions to `@ref`, and let agents pass search filters inline in the query. ### Changed **Compact MCP targets on code and search tools** [`search`](/tools/documentation-access), [`code_files`, `code_grep`](/tools/code-navigation), and the experimental [`code_diff`](/tools/code-navigation#code-diff) now require a single string `target` instead of registry-and-package or repo-and-ref pairs. Migrate: * `{registry: "npm", package_name: "express", version: "5.2.1"}` → `"npm:express@5.2.1"` * `{repo_url: "https://github.com/expressjs/express", git_ref: "main"}` → `"github:expressjs/express@main"` * Search `{site: "https://expressjs.com/"}` → `"site:expressjs.com"` CLI syntax is unchanged. **Repository revisions use `@ref` instead of `#ref`** Repository targets are now `provider:path@ref`. Later `@` characters inside a ref are preserved, and legacy `#ref` input is rejected with the exact canonical replacement so migration is mechanical. Package `registry:name@version` targets and documentation fragments are unchanged. **Inline MCP search qualifiers** Move `category`, `kind`, `path_prefix`, `file_intent`, `name`, and `language` into the `query` string as `category:callable`, `kind:function`, `path:lib/`, `intent:production`, `name:Router`, and `lang:typescript`. CLI flags, `public_only`, results, and continuation behavior are unchanged. MCP callers must refresh tool discovery after updating. Hosted MCP clients at `https://mcp.githits.com` receive these changes after the service adopts `@githits/mcp` 0.18.0 and deploys. **September 16, 2026** ## GitHits 0.19.0 Releases [githits 0.19.0](https://github.com/githits-com/githits-cli/releases/tag/v0.19.0) and [@githits/mcp 0.19.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.19.0) remove the separate language lookup step for implementation examples. ### Removed * **Language discovery:** the `search_language` MCP tool and `githits languages` CLI command have been removed. Pass `language` to [`get_example`](/tools/code-navigation) or `--lang` to [`githits example`](/cli/commands), or omit the language to let GitHits infer it from your query. If GitHits cannot match the language, retry with a suggestion from the error or omit the language filter. These changes are live on the hosted MCP server at `https://mcp.githits.com`. Refresh your client's MCP tool discovery to load the current tool catalog. **September 16, 2026** ## Unified REST read API The [public API contract](https://api.githits.dev/v1/openapi.json) now exposes `GET /v1/read` for both documentation pages and source files. The separate documentation and code read endpoints have been removed. * **Documentation:** pass the `docs_read_target` returned by package documentation listing or search as `target`, omitting `path`. Indexed URL fragments select a section. * **Source code:** pass a package or public repository `target` and an exact target-relative `path`. * **Responses:** branch on `kind` (`documentation` or `code`). Both return `metadata` and `content` by default and preserve the identity and source information for their result type. See [read requests and migration guidance](/api/requests-and-responses#read-documentation-or-source-code) and the [unified read reference](/api-reference/v1/read/read-documentation-or-source-code). This entry describes the REST API contract; CLI and MCP releases have separate availability. **September 14, 2026** ## GitHits 0.17.0 and 0.17.1 Releases [0.17.0](https://github.com/githits-com/githits-cli/releases/tag/v0.17.0) and [0.17.1](https://github.com/githits-com/githits-cli/releases/tag/v0.17.1) shipped together. MCP `code_read` and `docs_read` merge into a single [`read`](/tools/documentation-access) tool, discovery waits grow to 120 seconds when the backend supplies indexing estimates, code and repository-doc results now emit copyable read targets, and every public-evidence MCP tool is annotated as open-world so clients with open-world filters can classify them correctly. ### Changed **Unified `read` tool for code and documentation** MCP `code_read` and `docs_read` are replaced by a single `read` tool that takes a compact target and an optional file path. Documentation fragments and code indexing waits behave the same, and Ask citations translate into the new locators automatically. The CLI adds `githits read` alongside the existing `githits code read` and `githits docs read` commands, which continue to work as deprecated aliases. MCP callers must rediscover the tool catalog after updating. Hosted MCP clients at `https://mcp.githits.com` receive the change after the service adopts `@githits/mcp` 0.17.0 and deploys. **Discovery waits up to 120 seconds using backend estimates** [`search`](/tools/documentation-access), search-status, and [code navigation](/tools/code-navigation) now preserve backend indexing timing evidence in JSON and use it when suggesting follow-up waits. When an estimate is available, waits can extend up to 120 seconds to match HTTP deadlines and MCP cancellation. Default waits are unchanged when no estimate is returned, and explicit wait overrides still apply. ### Fixed * **Copyable file-list targets.** MCP `code_files` headers now render the served repository commit instead of treating the Git SHA as a package version, so the displayed target can be pasted directly into `read`. * **Copyable repository documentation targets.** [`search`](/tools/documentation-access) text results for repository-backed documentation now show the backend's repo-doc read locator and separate line bounds, matching the JSON follow-up and avoiding invented package or path locators. * **Public-evidence MCP tools are annotated as open-world.** The 12 stable public code, documentation, package, and search-result MCP tools and the three local experimental tools (`ask`, `resolve_target`, `code_diff`) now set `openWorldHint: true` while keeping `readOnlyHint: true` and `destructiveHint: false`. Static guidance and language lookup remain closed-world. MCP clients that filter by open-world semantics can now include these evidence tools. Refresh MCP tool discovery after updating; hosted clients at `https://mcp.githits.com` receive the change after the service adopts `@githits/mcp` 0.17.1 and deploys. **September 11, 2026** ## GitHits 0.16.1 and 0.16.2 Releases [0.16.1](https://github.com/githits-com/githits-cli/releases/tag/v0.16.1) and [0.16.2](https://github.com/githits-com/githits-cli/releases/tag/v0.16.2) shipped together. Search now emits ready-to-read documentation fragments, MCP tool catalogs lead with question-to-tool routing before argument details, the default indexing wait grows from 20 to 30 seconds, and oversized `code_grep` context requests are clamped instead of failing. ### New **Read exact documentation sections and ranges** [`search`](/tools/documentation-access) now emits indexed documentation fragments as ready-to-read targets for [`docs_read`](/tools/documentation-access). `docs read` and `docs_read` resolve those fragments without synthesizing bounds, preserve absolute page coordinates, and keep unresolved sections distinct from missing pages. Requires the compatible backend schema, which is already deployed. ### Improved **Longer default indexing wait** The shared CLI and MCP wait on [`search`](/tools/documentation-access), search-status, and [code navigation](/tools/code-navigation) grew from 20 to 30 seconds so more indexing and metadata fetches complete before the response returns progress. Explicit wait overrides and the 60-second maximum are unchanged. **Routing guidance before tool discovery** The self-contained `quick_start` guide and the packaged [`githits-mcp` skill](/installation/skills) now lead with question-to-tool routing, so agents pick [`search`](/tools/documentation-access), [`code_*`](/tools/code-navigation), [`pkg_*`](/tools/package-inspection), or [`ask`](/tools/experimental-tools) from the question itself and only load argument details for the selected tool. **Ask follow-up scope guidance** The [experimental `ask`](/tools/experimental-tools) tool now documents how to change project, version, or topic within an existing thread and keeps the thread when clarifying a failed lookup, so follow-up questions don't force a new thread. **Prefer text for model-visible MCP output** Tool descriptions and the packaged [skill](/installation/skills) now recommend keeping model-visible MCP results in `text` and reserving `json` for host-side field handling or fields absent from text. Rendering and JSON payloads are unchanged. **Consolidated MCP wait guidance** Repeated MCP wait and indexing-recovery guidance moved into the shared `quick_start` and `githits-mcp` skill, and wait parameter descriptions shrank to units and bounds. Agent context stays leaner. ### Fixed * **`code_grep` clamps oversized context instead of erroring.** Requests with more than 10 lines of context per side are clamped to 10, asymmetric overrides are preserved, and JSON returns both requested and effective values with an actionable text notice. For larger source windows, follow up with [`code_read`](/tools/code-navigation). * **`search` rejects path prefixes without a code source.** Path prefix filters are now rejected locally when no code search source is selected, and CLI/MCP guidance explains that documentation and symbol searches don't support this filter. * **Documentation URL schemes are recognized case-insensitively.** Documentation fragment handoffs no longer stall on mixed-case URL schemes. * **Ask guidance no longer references unavailable defect reporting.** Instructions to report defects using an Ask run ID have been removed because no such action is available. Hosted MCP clients at `https://mcp.githits.com` receive the applicable changes after the service adopts `@githits/mcp` 0.16.2 and deploys. **September 10, 2026** ## GitHits 0.16.0 Releases [githits 0.16.0](https://github.com/githits-com/githits-cli/releases/tag/v0.16.0) and [@githits/mcp 0.16.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.16.0) retire feedback submission, mark every remaining MCP information tool as read-only, and preserve actionable recovery guidance when Ask cannot resolve a target. ### Changed * **All remaining MCP information tools are marked read-only.** Every advertised tool now sets `readOnlyHint: true`, including the local experimental [`ask`](/tools/experimental-tools) tool. Internal result storage, source preparation, and research-thread behavior are unchanged. ### Removed * **Feedback submission has been retired from the CLI and MCP package.** The MCP `feedback` tool, the `githits feedback` command, feedback instructions, and the exported TypeScript `submitFeedback` service method are no longer available. Existing `experimental.report_tool_issues` configuration keys are ignored. If your integration called feedback through these surfaces, remove those calls and refresh MCP tool discovery after updating. ### Fixed * **Ask keeps actionable target diagnostics.** CLI and local MCP Ask responses now preserve validated server diagnostics and recovery guidance when a target needs clarification. New diagnostic codes and reasons can reach the caller without requiring another client release, while malformed or legacy responses receive actionable fallback text. * **Public skills match the current product surface.** GitHits skills no longer recommend the retired feedback workflow. Onboarding and recovery guidance also preserve the requested CLI version, project scope, guidance preference, and separate Cursor authentication. Hosted MCP clients at `https://mcp.githits.com` receive the applicable changes after the service adopts `@githits/mcp` 0.16.0 and deploys. **September 8, 2026** ## GitHits 0.15.1 Releases [githits 0.15.1](https://github.com/githits-com/githits-cli/releases/tag/v0.15.1) and [@githits/mcp 0.15.1](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.15.1) let Ask clarify an ambiguous target with ranked candidates instead of failing, bring question-only Ask to the local MCP server, and preserve documentation indexing state in `docs list` results. ### Fixed * **Ask target clarification shows resolver candidates.** When a question-only [`githits ask`](/tools/experimental-tools) cannot confidently select a target, it now returns a clarification with ranked resolver candidates instead of an error. Candidates keep their confidence, related-target groups, protected matches, and malicious-status evidence, in the same layout as `resolve`. The command completes successfully, and `--json` marks the response `outcome: "needs_target"` with the typed resolution. Repeat the question with a selected canonical target. Answered responses and explicit-target behavior are unchanged, and the clarification requires backend support. * **Question-only Ask works in the local MCP server.** The local MCP [`ask`](/tools/experimental-tools) tool now accepts a question alone, matching the CLI. Omit both `target` and `thread_id` and GitHits identifies the target from the question, returning the same clarification candidates as the CLI when the target is ambiguous. Explicit targets and thread follow-ups keep working, but cannot be combined. * **`docs list` reports documentation indexing state.** [`docs_list`](/tools/documentation-access) and `githits docs list` now distinguish documentation that is still being prepared from a terminal empty result. Empty results during preparation or indexing say so and suggest retrying the same call later instead of reporting "No documentation pages found." Provisional results keep the pages that are already available while marking that indexing continues, and JSON retains the exact backend `codeIndexState` lifecycle value. Hosted MCP clients at `https://mcp.githits.com` receive the applicable changes after the service rollout. **September 8, 2026** ## GitHits 0.15.0 Releases [githits 0.15.0](https://github.com/githits-com/githits-cli/releases/tag/v0.15.0) and [@githits/mcp 0.15.0](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.15.0) add Codeberg and nested GitLab repository targets, let the experimental `githits ask` infer a target from your question, and fix authentication error handling. ### New **Codeberg and GitLab repository targets** [Search](/tools/documentation-access) and [code navigation](/tools/code-navigation) now accept explicit `codeberg:owner/repo` and nested `gitlab:group/subgroup/project` targets alongside `github:owner/repo`, plus the matching full HTTPS URLs. Each form takes an optional `#ref`, follow-up commands preserve the provider identity and exact ref, and GitHub shorthand, GitHub URLs, and registry-native Swift and Zig package coordinates keep working unchanged. Bare `owner/repo` names and unsupported hosts are rejected up front. Hosted MCP clients at `https://mcp.githits.com` receive the change once the remote server is redeployed on 0.15.0. **Question-only `githits ask`** The experimental [`githits ask`](/tools/experimental-tools) command no longer requires an explicit target. Ask with a single argument and GitHits identifies the public package or repository from the question itself: ```bash theme={null} npx githits@latest ask "How does FastAPI dependency injection resolve nested dependencies?" ``` Passing an explicit target first keeps the search scoped, and `--thread` follow-ups work as before. Enable the suite with `[experimental] tools = true` in your [CLI configuration](/cli/configuration). ### Fixed * **Code navigation recovers from backend authentication errors.** [Code navigation](/tools/code-navigation) tools now recognize the backend `AUTHENTICATION_REQUIRED` code and attempt the standard single credential refresh, matching package inspection behavior, while access-denied errors are preserved. See [authentication](/authentication). * **Rejected refresh credentials are classified correctly.** The CLI now recognizes OAuth and Supabase refresh-token and session rejection codes without relying on error description wording. Rejected tokens are cleared so the next login starts clean, while client registration and credentials replaced mid-refresh are preserved. * **Site documentation is described as crawled on demand.** The experimental [`resolve`](/tools/target-resolution) surfaces now describe documentation sites that need preparation as crawled on demand instead of implying they are unavailable, keeping the normal on-demand search continuation. **September 7, 2026** ## GitHits 0.13.0 and 0.14.0 Releases [0.13.0](https://github.com/githits-com/githits-cli/releases/tag/v0.13.0) and [0.14.0](https://github.com/githits-com/githits-cli/releases/tag/v0.14.0) shipped together. Search results gain semantic context and authoritative match evidence, `pkg_vulns` adds opt-in transitive vulnerability audits, `pkg_deps` picks up NuGet, Maven, and Packagist, and MCP output formats simplify to `text` and `json`. ### New **Semantic search context** 0.13.0 [`search`](/tools/code-navigation) and search-status results now show the enclosing declaration and numbered focused source for each hit, with precise attributed read coordinates for follow-up [`code_read`](/tools/code-navigation) calls. JSON output adds the same structural evidence as additive fields. Hosted MCP clients at `https://mcp.githits.com` receive the change once the remote server is redeployed on 0.13.0. **Authoritative search match evidence** 0.14.0 changes default [`search`](/tools/documentation-access) text to authoritative match evidence. Path-only matches render as compact file headers instead of arbitrary source chunks, source hits show proven snippets, and documentation hits use structural previews. Search JSON adds indexed-field provenance, the authoritative matched source, and crawled-documentation previews. **Transitive vulnerability audits on `pkg vulns`** [`pkg_vulns`](/tools/package-inspection) now offers opt-in npm-audit-style evidence covering vulnerabilities in the versions a package resolves, not just its direct advisories. Pass `--transitive` on the CLI or `include_transitive: true` in MCP; direct-only output remains the default, and severity and advisory-scope filters apply consistently to root and dependency rows. ```bash theme={null} npx githits@latest pkg vulns npm:express@4.18.2 --transitive ``` **NuGet, Maven, and Packagist dependency support** [`pkg_deps`](/tools/package-inspection) now accepts NuGet, Maven, and Packagist targets alongside the previously supported dependency registries, so .NET, JVM, and PHP dependency graphs resolve like the rest. ### Improved **Simplified MCP output formats: `text` and `json`** All format-selectable MCP tools now expose exactly two formats: `text` (the default) and `json`. Tool descriptions, `quick_start`, and the GitHits MCP [skill](/installation/skills) recommend text for reading and follow-up tool calls, reserving JSON for parsing in code or fields absent from text. Explicit `text-v1` callers must switch to `text` or omit the format parameter; rendering and JSON payloads are unchanged. **`..` upgrade-review ranges** Positional [`pkg_upgrade_review`](/tools/package-inspection) ranges now use `..`, including for scoped packages, and the legacy `->` delimiter is rejected with guidance. Write ranges as `:@..`: ```bash theme={null} npx githits@latest pkg upgrade-review npm:lodash@4.17.20..4.17.21 ``` **Documentation reads through emitted targets** [`docs_list`](/tools/documentation-access) and search results now retain a `docsReadTarget`, the stable `pageId`, and a provenance `sourceUrl` for every documentation entry. Follow-up guidance prefers clickable URL targets for [`docs_read`](/tools/documentation-access), and historical `pageId` reads stay compatible. **Complete vulnerability rows** Compact [`pkg_vulns`](/tools/package-inspection) CLI text now shows every selected direct and transitive advisory row, verbose mode adds clearer transitive evidence, and JSON preserves advisory-wide affected-range and fixed-version fields. Compact MCP text remains capped; use verbose mode for all selected advisory rows. ### Fixed * **Go module versions in MCP tools.** The MCP package documentation, dependency, vulnerability, changelog, and upgrade-review tools now accept exact Go versions with or without the `v` prefix and send the backend the canonical `v`-prefixed form, matching the CLI fix that shipped in 0.12.1. See [package inspection](/tools/package-inspection). * **Vulnerability text is safe to print.** Hostile terminal control sequences are stripped from vulnerability display values before rendering, while JSON evidence stays lossless. **September 4, 2026** ## Week of September 2 – September 4 Releases [0.12.0](https://github.com/githits-com/githits-cli/releases/tag/v0.12.0) and [0.12.1](https://github.com/githits-com/githits-cli/releases/tag/v0.12.1) shipped this week. An experimental `githits ask` command answers grounded questions about a package or repository with cited sources, `pkg deps` gains opt-in dependency issue analysis, and `pkg_info` separates current vulnerability exposure from historical advisories. ### New **Experimental Agentic Ask: `githits ask`** 0.12.0 adds an opt-in `githits ask` command and matching local MCP `ask` tool to the [experimental suite](/tools/experimental-tools). Ask one question about a canonical package or repository target (for example `githits ask npm:express "Where is router dispatch implemented?"`) and get a grounded answer with cited sources, an Ask run ID, and a thread ID. Pass the thread ID to `--thread` (or `thread_id` in MCP) for follow-up questions without repeating the target; threads support up to ten turns. Source citations default to directly executable source-reading calls; use `--source-format url` for original upstream URLs instead. Enable the suite with `[experimental] tools = true` in your [CLI configuration](/cli/configuration). **Dependency issue analysis on `pkg deps`** [`pkg_deps`](/tools/package-inspection) now offers opt-in analysis of deprecated, outdated, duplicate, and conflicting dependencies. Pass `--issues` on the CLI or `include_issues: true` in MCP to get actionable conflict constraints and importer provenance in both text and JSON, with full or depth-limited traversal. ### Improved **Clearer package overview evidence** [`pkg_info`](/tools/package-inspection) now separates vulnerabilities affecting the latest version from package-wide advisory history, so current exposure is no longer conflated with resolved past advisories. Verbose text and JSON also expose the published-version count and download freshness, and CLI help and the MCP descriptor keep routing full-history questions to the right tool. **Explicit upgrade-review batch limit** [`pkg_upgrade_review`](/tools/package-inspection) CLI and MCP surfaces now advertise and enforce the deployed limit of 30 nonblank package upgrades per request, so oversized batches fail fast locally instead of at the backend. ### Fixed * **Go module versions work with or without the `v` prefix.** Package documentation, dependency, vulnerability, changelog, and upgrade-review inputs now accept exact Go versions in either form and send the backend the canonical `v`-prefixed version. See [package inspection](/tools/package-inspection). * **Repository grep advertises only real symbol fields.** [`code_grep`](/tools/code-navigation) CLI and MCP validation now expose only the symbol metadata repository grep can actually return. * **Windows token refresh handoff.** File-backed auth locks are now released without racing successor agents against removal of the shared lock path, so concurrent CLI and MCP processes on Windows refresh tokens reliably. See [authentication](/authentication). * **GitHits skill discovery.** The packaged MCP [skill](/installation/skills) now describes the OSS and package tasks that should trigger it instead of assuming GitHits was already selected, so agents load it when those tasks come up. **September 2, 2026** ## GitHits 0.11.5 Releases [githits 0.11.5](https://github.com/githits-com/githits-cli/releases/tag/v0.11.5) and [@githits/mcp 0.11.5](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.11.5) make `quick_start` discoverable in deferred tool catalogs, clarify the security boundaries for retrieved public OSS content, and fix Agent Skill discovery and packaging. ### Improved **`quick_start` is discoverable in deferred tool catalogs** The `quick_start` catalog sentence now identifies it as the required first call for plain MCP sessions and names the untrusted-content safety rules it loads. Clients that defer or truncate tool catalogs (surfacing only short per-tool summaries until a tool is expanded) now route agents to `quick_start` before other GitHits evidence tools instead of burying it. **Clarified untrusted remote-OSS content boundaries** Tool guidance and the packaged [skills](/installation/skills) now consistently frame retrieved public OSS content — source, docs, package metadata, changelogs — as untrusted evidence. Instructions found inside retrieved content cannot override your authorization decisions or your coding tool's safeguards, and the existing prompt-injection protections are preserved. ### Fixed * **Standards-compliant installers can parse the `githits-mcp` skill again.** The YAML frontmatter description in the packaged `githits-mcp` [skill](/installation/skills) is now quoted, so strict Agent Skill installers no longer fail to parse `SKILL.md`. * **Internal skills stay out of public skill registries.** Repository-internal maintainer skills are now marked internal, so public skill registries and installers only offer the supported end-user skills. * **Sampled changelog context is preserved in upgrade reviews.** Compact [`pkg_upgrade_review`](/tools/package-inspection) output now keeps identity-only sampled releases visible — version, publication date, URL, and headline — instead of dropping them, and no longer repeats the same release across keyword, sampled, and verbose entries. **September 1, 2026** ## GitHits 0.11.4 Releases [githits 0.11.4](https://github.com/githits-com/githits-cli/releases/tag/v0.11.4) and [@githits/mcp 0.11.4](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.11.4) add definition-aware search evidence and improve MCP session guidance and wrapped source readability. ### New **Definition-aware search evidence** CLI and MCP [`search`](/tools/code-navigation) results now preserve focused, indexed, and symbol-definition ranges for each source hit. Output leads with the focused evidence and annotates the qualified enclosing symbol (for example the function or class the match sits in), so you can tell at a glance whether a hit is the definition you're looking for or a use site. Follow-up [`code_read`](/tools/code-navigation) suggestions target the exact served revision and the enclosing-definition range, so reading the full definition takes one call with no ref or line-range guessing. ### Improved **Readable wrapped source comments** Compact search output now repeats source comment markers on wrapped continuation lines, so long comments stay recognizable as comments instead of looking like executable code. ### Fixed * **Reliable MCP session guidance.** MCP servers built from `githits` or `@githits/mcp` now require one `quick_start` call per plain session, while agents with the loaded `githits-mcp` [skill](/installation/skills) skip it for every tool. GitHits MCP and CLI skills use transport-specific triggers so agents load only the workflow that matches their transport. **August 31, 2026** ## GitHits 0.11.3 Releases [githits 0.11.3](https://github.com/githits-com/githits-cli/releases/tag/v0.11.3) and [@githits/mcp 0.11.3](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.11.3) improve search recovery, target resolution, upgrade-review output, authentication guidance, and keychain error reporting. ### Improved **Grouped project identities in target resolution** The opt-in [`resolve`](/tools/target-resolution) command and `resolve_target` tool now keep related package, repository, and documentation-site identities together. Compact per-target rows preserve popularity, license, malicious-content, availability, and relation-truncation evidence. Pass `--verbose` or `verbose: true` to include coarse lexical name similarity; JSON includes available numeric similarity without changing backend ranking. **Outcome-first upgrade evidence** [`pkg_upgrade_review`](/tools/package-inspection) now uses the same compact, grouped evidence hierarchy in CLI and MCP text. It preserves vulnerability changes, dependency examples, issue locators, and structured JSON while leaving the final risk assessment to the caller. **Current-evidence routing for security questions** [`pkg_vulns`](/tools/package-inspection) now explicitly covers broad package-security questions so agents retrieve current advisory evidence instead of relying on potentially stale model knowledge. ### Fixed * **Search recovery and provenance.** [`search`](/tools/code-navigation) and `search_status` preserve canonical package addressing, pinned repository identity, replayable source provenance, and terminal next actions across partial and terminal target states. * **Backend authentication-required errors.** Package and source tools now recognize the backend `AUTHENTICATION_REQUIRED` code and return the standard refresh or sign-in guidance. * **Code diff version alternatives.** [`code_diff`](/tools/code-navigation#code-diff) preserves backend-ranked package-version alternatives and their proven source refs in structured error details and CLI guidance. * **Keychain access failures.** Inaccessible or unavailable credential stores now return an explicit error instead of appearing empty. See [authentication troubleshooting](/guides/troubleshooting). **August 28, 2026** ## Week of August 27 – August 28 Releases [0.11.1](https://github.com/githits-com/githits-cli/releases/tag/v0.11.1) and [0.11.2](https://github.com/githits-com/githits-cli/releases/tag/v0.11.2) shipped this week. Search output is now compact and consistent across CLI and MCP, the experimental resolver recognizes standalone documentation sites, agents can read larger source and docs slices in one call, and `githits init` recovers cleanly when stale credentials fail to refresh. ### New **Standalone documentation site resolution** The opt-in [`resolve`](/tools/target-resolution) command and `resolve_target` MCP tool now recognize standalone documentation sites as first-class candidates, labeled `site` instead of a generic fallback. You can request them explicitly with `--prefer-kind site` (or the matching MCP argument), and selected site targets route straight into documentation [`search`](/tools/documentation-access). Stable MCP guidance now also distinguishes package-only `docs_list` from the standalone-site search and `docs_read` flow. **Browser-callable `get_example` for WebMCP** `@githits/mcp` 0.11.1 adds a dedicated `@githits/mcp/tools` entry that exposes the validated [`get_example`](/tools/code-examples) surface for frontend WebMCP integration. Only this selected entry is browser-safe; the installed package and other entries remain Node-oriented. ### Improved **Compact, unified search output** [`search`](/tools/documentation-access) and search-status responses now share one outcome-first formatter across the CLI and MCP: compact completed-result headlines, numbered locator-first hits that keep docs page IDs for `docs_read` follow-ups, source provenance, target-grouped readiness when it matters, and terminal-aware wrapping in the CLI. JSON output states partial-result truth exactly, and continuation guidance stays native to the surface you called from. **Fewer context round trips on source and docs reads** [`code_read`](/tools/code-navigation) and [`docs_read`](/tools/documentation-access) now allow deliberate 300-line reads while keeping the 150-line default, and `code_grep` per-file limits align with the requested totals. Agents fetch what they need in fewer calls, and served indexing snapshots plus public-repository discovery guidance are clearer. **Intent-first package tool descriptions** [Package inspection](/tools/package-inspection) MCP descriptions now lead with compact user-intent phrases, so truncated tool catalogs still make clear which tool answers health, vulnerability, dependency, changelog, and upgrade questions. ### Fixed * **`githits init` recovers sign-in after stale refresh failures.** Interactive [`githits init`](/cli/commands) now proceeds to browser OAuth when retained expired credentials cannot refresh, instead of stalling, and its runnable authentication guidance consistently uses `npx githits@latest`. See [authentication](/authentication) for the refresh model. * **Uninstall respects your guidance selection.** Interactive user-level [`githits uninstall`](/cli/commands) now removes guidance only for selected tools whose MCP configuration is absent after cleanup, and preserves shared guidance still usable by detected tools you kept. * **Self-contained MCP skill.** The packaged `githits-mcp` [skill](/installation/skills) now includes the stable quick-start guidance directly, removing a redundant bootstrap call, while plain MCP clients keep the `quick_start` fallback. **August 27, 2026** ## Week of August 24 – August 27 Releases [0.10.2](https://github.com/githits-com/githits-cli/releases/tag/v0.10.2) and [0.11.0](https://github.com/githits-com/githits-cli/releases/tag/v0.11.0) shipped this week. The experimental resolver now fails closed on malicious package candidates, remote MCP clients get a one-call `quick_start` guide with benefit-first tool routing, and onboarding gains a predictable setup flow plus a canonical top-level `githits uninstall` command. ### New **One-call `quick_start` guidance for MCP clients** 0.11.0 adds a read-only `quick_start` MCP tool that returns the full GitHits tool guide in a single call: public-OSS scope, target syntax, compact-output guidance, cross-tool workflows, and safety rules, without querying any GitHits evidence. Call it once per session before other GitHits tools unless the guide is already in your agent's context. It replaces inconsistently surfaced server instructions, and the packaged Agent Skill now points at the guide instead of duplicating it. The hosted endpoint at `https://mcp.githits.com` must run `@githits/mcp` 0.11.0 before remote plugins and extensions can rely on `quick_start`. **Top-level `githits uninstall` command** Removing GitHits setup now has a canonical command: [`githits uninstall`](/cli/commands) removes GitHits MCP configuration from your coding tools, and unless you pass `--keep-guidance` it also cleans up the GitHits-owned skill files while preserving unrelated skills and directories. The previous `githits init uninstall` form remains a compatibility alias with identical flags and behavior. ```bash theme={null} npx githits@latest uninstall # Interactive: choose user-level or project-level npx githits@latest uninstall --yes # Non-interactive user-level removal npx githits@latest uninstall --yes --keep-guidance # Remove MCP config, keep guidance files ``` ### Improved **Benefit-first MCP tool routing** Remote MCP tool catalogs are now written benefit-first with explicit workflow handoffs between tools, so agents pick the right tool ([`search`](/tools/documentation-access), [`code_*`](/tools/code-navigation), [`pkg_*`](/tools/package-inspection)) from the description instead of trial and error. **Predictable onboarding setup and removal** [`githits init`](/cli/commands) now targets only the agents you select: an unselected configured agent is reported unchanged and never retargeted. Guidance-only and stale-skill cleanup selections repair packaged guidance without touching MCP configuration or requiring authentication, an empty selection exits with `Nothing selected, no changes made`, and a fully configured run becomes a verification-only review with no confirmation, authentication, or writes. Review and summary output is transport-aware, describing local stdio, Cursor's hosted remote MCP, or both based on what you actually selected. ### Fixed * **Experimental resolver fails closed on malicious package candidates.** The opt-in [`resolve_target`](/tools/target-resolution) tool and `githits resolve` command now preserve latest-version malicious-content decisions and bounded OSV evidence, link affected or uncertain advisories in warnings, and withhold the normal CLI/MCP continuation for affected, unknown, or unrecognized states instead of suggesting a next action on a suspect target. 0.10.2 also fine-tunes partial-readiness handling so incomplete resolver evidence is surfaced rather than treated as a clean result. * **Canonical resolve inputs are rejected locally.** [`githits resolve`](/tools/target-resolution) and the local `resolve_target` tool now direct already-canonical targets like `npm:express` or `github:owner/repo` straight to the next GitHits tool without calling the resolver backend. * **Reliable `init` install and uninstall state.** [`githits init`](/cli/commands) now uses structured inspection of Claude's user-scoped MCP state and best-effort guidance cleanup, so absent state is skipped safely, failures stay visible, and guidance reporting is kept separate from agent counts. * **Correct changelog range semantics.** [`pkg_changelog`](/tools/package-inspection) now documents and exposes `from` as an exclusive lower bound, so exact-release and range requests follow the backend contract consistently. Returned entries preserve backend/source order; consumers must not assume newest-first ordering. **August 24, 2026** ## GitHits 0.10.1 Releases [githits 0.10.1](https://github.com/githits-com/githits-cli/releases/tag/v0.10.1) and [@githits/mcp 0.10.1](https://github.com/githits-com/githits-cli/releases/tag/mcp-v0.10.1) preserve usable search evidence while indexing and harden authentication across concurrent CLI and local MCP processes. ### Improved **Provisional search evidence** [`search`](/tools/code-navigation) and `search_status` now render queryable `PROVISIONAL` repository and documentation freshness. Responses keep the exact served identity, indexing guidance, available hits, and a `searchRef` only while the session remains active. ### Fixed * **Reliable concurrent authentication.** Live per-user auth locks survive temporary process-inspection failures, and stale-owner cleanup is serialized so parallel CLI and local MCP processes do not reuse rotating refresh tokens. Restart long-running local MCP processes after upgrading so they load the hardened lock protocol. * **Evolving search-session statuses.** CLI and MCP search preserve evidence for terminal `DEFERRED` and future status values. Only known active sessions direct callers to keep polling; stopped or unknown sessions return a new-search action. **August 21, 2026** ## Week of August 17 – August 21 Releases [0.9.3](https://github.com/githits-com/githits-cli/releases/tag/v0.9.3) and [0.10.0](https://github.com/githits-com/githits-cli/releases/tag/v0.10.0) shipped this week, introducing opt-in local experimental tools for target resolution and source diffs, adding documentation source evidence to search results, and improving CLI recovery, validation, and diagnostics. ### New **Opt-in local experimental tools: `resolve` and `code diff`** 0.10.0 adds a hidden-by-default experimental suite to the [`githits` CLI](/cli/commands) and its local stdio MCP server: `githits resolve` (with the matching `resolve_target` MCP tool) ranks canonical package and GitHub repository targets, and `githits code diff` (with `code_diff`) produces bounded, Git-like diffs across [code navigation](/tools/code-navigation) targets. Enable them by setting `[experimental] tools = true` in your [CLI configuration](/cli/configuration). The hosted MCP at `https://mcp.githits.com`, plugins, extensions, and the public MCP API stay on the stable tool inventory. **Documentation source evidence on `search`** Unified [`search`](/tools/documentation-access) and search-status responses now identify the repository and published-site documentation behind each result. Healthy sources render as compact references; stale, incomplete, pending, or unavailable sources explain what was searched and what the published evidence actually covers, so you can tell partial hits from full coverage at a glance. **`githits code diff` (silent dogfood in 0.9.3)** 0.9.3 introduced [`githits code diff`](/cli/commands) as an unpromoted CLI surface: bounded Git-like views, repository-relative glob filtering, reversible path quoting, apply-safe patch handling, structured completeness diagnostics, and `--json` output. 0.10.0 promotes it to the experimental suite alongside the matching MCP tool. ### Improved **Authoritative documentation site identities** Discovery [`search`](/tools/documentation-access) and search-status now carry canonical documentation site URLs and show the host and path even when no hits are returned, so you can see exactly which site was consulted. **Repository-wide code diff scope, spelled out** CLI help, legacy-scope diagnostics, and public client docs for `code diff` / `code_diff` now explain that package targets resolve repository and commit identity while raw diffs remain repository-wide. Bounded results may contain only sibling paths, and the surface says so instead of implying a package-scoped diff. **Confident target resolution guidance** `resolve` now emits direct canonical next actions only for non-ambiguous exact or high-confidence matches. Weaker and empty results require explicit correction or selection instead of an unsafe auto-pick. **Diff terminal output** `code diff` aligns wide Unicode paths by terminal cell width and colors patches, stat bars, summary markers, and change statuses when the terminal supports it. Verbose code-file rows use the same alignment. **Standalone-site search recovery** [`search`](/tools/documentation-access) now preserves ordered backend site suggestions, distinguishes truncated candidate lists, and directs active crawls through search-status without guessing or rewriting your target. Help text also separates atomic interim evidence from opted-in partial target/source subsets. ### Fixed * **Exact-path recovery names the right surface.** `code_read` and `code_grep` now return `FILE_PATH_EXCLUDED` for excluded files and `SOURCE_FILE_INVENTORY_UNKNOWN` when the index cannot verify a path, with actionable path and resolution details, instead of a generic `NOT_FOUND`. See [code navigation](/tools/code-navigation). * **Waited searches no longer suggest an older ref.** After a waited [`search`](/tools/documentation-access) or [code navigation](/tools/code-navigation) call reaches the requested commit, the response no longer recommends falling back to an earlier ref. * **Code validation errors match the caller's surface.** Client-side `INVALID_ARGUMENT` errors from shared code-read and grep request builders name CLI commands, positionals, and flags for the [`githits` CLI](/cli/commands) while MCP callers keep MCP-native tool and argument syntax. **August 14, 2026** ## Week of August 12 – August 14 Releases [0.9.1](https://github.com/githits-com/githits-cli/releases/tag/v0.9.1) and [0.9.2](https://github.com/githits-com/githits-cli/releases/tag/v0.9.2) shipped this week, tightening exact-path recovery on [code navigation](/tools/code-navigation), making [`githits init`](/cli/commands) checks for Claude Code and Codex CLI reliable, and sharpening client-side validation error messages so CLI and MCP callers see the right syntax for the surface they're on. ### Improved **Surface-native validation guidance** Client-side `INVALID_ARGUMENT` errors from shared code read and grep request builders now name the right syntax for the caller. The [`githits` CLI](/cli/commands) sees `githits code read`, `githits code grep`, positionals, and flags; MCP callers see [`code_read`](/tools/code-navigation), [`code_grep`](/tools/code-navigation), and MCP argument names. No more mismatched examples in errors. ### Fixed * **Exact-path recovery on missing files.** Typed `FILE_NOT_FOUND` responses from [`code_read`](/tools/code-navigation) and [`code_grep`](/tools/code-navigation) now name `code_files`, `code_grep`, and `code_read` (or their `githits code …` CLI equivalents) in path-discovery guidance. Extensionless exact files use their containing directory for the follow-up listing, and generic `NOT_FOUND` errors no longer receive misleading file-path hints. * **Reliable Claude Code and Codex CLI setup in `githits init`.** User-scoped MCP checks now run outside project configuration, use targeted server probes with host-specific timeouts, and distinguish missing, non-canonical, disabled, and failed states. Enabled customized Codex entries are preserved, and a cleanup no-op is no longer reported as successful setup when a later command fails. **August 11, 2026** ## Week of August 10 – August 11 Release [0.9.0](https://github.com/githits-com/githits-cli/releases/tag/v0.9.0) adds a canonical `githits settings` surface with Terms of Service acceptance, tightens `search` and `code_grep` recovery so agents stop retrying futile calls, hardens the OAuth callback flow for remote and sandboxed logins, and picks up the latest `undici` security patches. ### New **Manage account settings and Terms of Service from the CLI** The new [`githits settings`](/cli/commands) command group lets you view and update account settings (default language, license mode, blocked license IDs, marketing emails) without leaving the terminal. Use `githits settings show` to print the full canonical settings object, `githits settings get ` and `githits settings set ` for individual fields, and `githits settings clear ` to reset a clearable field. Every subcommand supports `--json` for scripting. **Accept the Terms of Service without a browser round-trip** `githits settings terms` shows the current Terms of Service acceptance requirement, and `githits settings terms accept` records acceptance directly from the CLI. When the API returns a terms-remediation error on any authenticated call, the [`githits` CLI](/cli/commands) and MCP tools now surface a structured error pointing at `githits settings terms accept` so agents know exactly which command to run. ### Improved **Bounded recovery guidance for `search` and `code_grep`** Empty and still-indexing results on [`search`](/tools/code-navigation) and [`code_grep`](/tools/code-navigation) now come with bounded, actionable follow-ups instead of open-ended retry prompts. Terminal search sessions no longer poll indefinitely, deferred searches return an explicit continuation, grep truncation messages use normalized producer values, and case-sensitivity and per-command pivots are accurate across MCP and CLI output. Identical retry loops are prevented while structured JSON diagnostics are preserved. **Forward-compatible account settings** The account settings client now accepts unknown fields returned by newer account APIs, so older [`githits` CLI](/cli/commands) versions keep working when the server adds new settings. ### Fixed * **OAuth login completes cleanly on interrupted callbacks.** Valid sign-in callbacks now resolve even when the response closes before finish, timeout and callback-error reporting stay independent of listener teardown, and `githits login` no longer blocks waiting for the temporary callback server to shut down. See [authentication](/authentication) for the full flow. * **`githits init` sandbox and `--no-browser` logins are more resilient.** Temporary callback connections are force-closed after the response finishes and token exchange continues without awaiting listener teardown, so proxied sandbox and SSH-tunneled logins finish reliably. See the [`init` command reference](/cli/commands) for `--no-browser` and `--port`. * **`undici` security patches.** The bundled HTTP client was upgraded to `undici` 7.29.0 to resolve five published advisories while retaining Node 20 compatibility. **August 7, 2026** ## Week of August 3 – August 7 Releases [0.6.7](https://github.com/githits-com/githits-cli/releases/tag/v0.6.7), [0.7.0](https://github.com/githits-com/githits-cli/releases/tag/v0.7.0), and [0.8.0](https://github.com/githits-com/githits-cli/releases/tag/v0.8.0) shipped this week. `githits init` now discloses what it sends where before any changes land, cross-host plugin packaging consolidates into a single canonical source, and GitHits ships as a portable Agent Plugins 1.0.0 package that any compliant client can install directly. ### New **Portable Agent Plugins 1.0.0 support** 0.8.0 publishes GitHits as a portable [Agent Plugin](https://agent-plugins.org) alongside the existing native adapters. Any Agent Plugins 1.0.0 client can install GitHits from the repository root and connect to the hosted remote MCP at `https://mcp.githits.com` over Streamable HTTP, no host-specific glue required. Existing installs for Claude Code, Cursor, Codex, Gemini CLI, Google Antigravity, and VS Code/GitHub Copilot OpenPlugin keep working unchanged. See [Manual remote MCP setup](/installation/manual-setup) for the hosted transport. **`githits init` discloses outbound data flows and requires a review acknowledgment** Before configuring any coding tool, [`githits init`](/cli/commands) now shows the outbound queries, targets, and feedback endpoints it will contact and asks you to acknowledge the install review, even when there is nothing to write. Guidance-only remediation stays actionable, MCP configuration targets are listed separately from supporting-guidance targets, and `--no-guidance` is preserved through the generated install and verification commands. **Explicit documentation site targets on unified `search`** Unified [`search`](/tools/documentation-access) now accepts explicit indexed documentation site targets, so you can point a query at a specific site instead of relying on inferred routing. Responses continue to surface per-source [coverage state](/tools/documentation-access) — pages crawled, frontier remaining, and a human-readable note — for sites that are partially crawled or capped. **Consolidated cross-host plugin packaging** 0.7.0 collapses cross-host packaging around the [`githits-cli`](https://github.com/githits-com/githits-cli) repository as the single source of truth. Claude Code, Cursor, Codex, Gemini CLI, Google Antigravity, and generic/OpenPlugin now expose the same four current skills (`githits-onboarding`, `githits-mcp`, `githits-code`, `githits-package`), and every plugin/extension install goes through the hosted remote MCP at `https://mcp.githits.com` with host-managed OAuth. See [Manual remote MCP setup](/installation/manual-setup) for the hosted transport, and [Skills](/installation/skills) for the shared skill contract. ### Changed * **Direct `githits init` installs continue to use local stdio MCP for supported tools, with one exception: Cursor is now remote-only.** [Automatic local MCP setup](/installation/automatic-setup) covers the local stdio flow; Cursor users should follow [Manual remote MCP setup](/installation/manual-setup). * **Legacy plugin surfaces removed.** The legacy Cursor command payload and the duplicated standalone Claude and Gemini plugin repositories have been retired now that every host reads from the canonical repository. ### Fixed * **Concurrent auth operations stay isolated across process restarts.** The local auth storage lock now caches each process's identity per storage instance and retries transient identity lookups, so PID-reuse protection can't be weakened when multiple [`githits` CLI](/cli/commands) or MCP processes touch credentials at the same time. See [authentication](/authentication) for the full storage model. **July 31, 2026** ## Week of July 27 – July 31 Release [0.6.6](https://github.com/githits-com/githits-cli/releases/tag/v0.6.6) tightens keychain error handling, adds schema-level validation to the [`code_grep`](/tools/code-navigation) tool, clarifies [`docs_read`](/tools/documentation-access) output limits, and surfaces documentation crawl coverage warnings on unified [`search`](/tools/documentation-access). ### Improved * **Clearer `code_grep` context limits.** The `context_lines`, `context_lines_before`, and `context_lines_after` parameters on [`code_grep`](/tools/code-navigation) are now validated at the MCP schema level (integer, 0–100), so agents catch out-of-range values before the call is made. Each field also documents that `_before` / `_after` override the shared `context_lines` for their side. * **Precise `docs_read` text output description.** The [`docs_read`](/tools/documentation-access) tool description and parameter hints now spell out the text-mode behavior explicitly: text output is capped at 150 lines per call (including explicit larger ranges), the response reports the returned range plus `totalLines` for follow-up slices, and JSON output remains uncapped when `end_line` is omitted. * **Partial documentation coverage is surfaced on `search`.** When a hosted documentation site is still being crawled or its crawl was capped, unified [`search`](/tools/documentation-access) responses now include per-source coverage state (pages crawled, frontier remaining, and a human-readable note) so agents can decide whether to retry, widen the query, or proceed with the partial hits instead of assuming full coverage. ### Fixed * **Keychain access failures no longer look like a missing login.** The migrating auth storage layer now distinguishes a missing credential from an unreachable system keychain. In keychain mode, a locked or otherwise unavailable keychain surfaces a clear storage error (with guidance to unlock the keychain, set `GITHITS_API_TOKEN`, or opt into `auth.storage = "file"`) instead of silently returning "unauthenticated" or falling back to plaintext files. See [authentication](/authentication) for the full storage model. **July 28, 2026** ## Week of July 27 – July 28 Release [0.6.5](https://github.com/githits-com/githits-cli/releases/tag/v0.6.5) restores silent automatic refresh of expired local logins, so long-running CLI and MCP sessions no longer see stray `AUTH_REQUIRED` prompts when a valid refresh token is on disk. ### Fixed * **Expired access tokens refresh silently again.** Once an access token expired, authenticated [`githits` CLI](/cli/commands) and MCP calls could incorrectly raise an `AUTH_REQUIRED` prompt even with a valid refresh token stored. Normal expiry is noninteractive again — the token is refreshed in the background and the call proceeds. * **Transient refresh failures preserve stored credentials.** Transport, timeout, and 5xx failures during token refresh no longer surface as a missing-token error. The recoverable failure is reported to the caller, the refresh token stays on disk, and later calls retry the refresh automatically. See [authentication](/authentication) for the full recovery model. * **Missing OAuth client registration is reported explicitly.** If tokens exist but the companion dynamic OAuth client registration is missing or unreadable, authenticated calls return a clear re-login error instead of the generic missing-token message. **July 24, 2026** ## Week of July 20 – July 24 A small maintenance week: [`githits init`](/cli/commands) picks up the same SSH-friendly callback options that [`githits login`](/cli/commands) already exposes, so guided setup works cleanly on remote and headless machines. Runtime and workflow dependencies also got a routine refresh. ### Fixed * **`githits init` supports `--no-browser` and `--port`.** You can now run guided setup on a remote host or SSH session and either print the sign-in URL as a fallback or forward the callback over an SSH tunnel — for example `ssh -N -L 8765:127.0.0.1:8765 user@remote-host` alongside `npx githits@latest init --port 8765`. See the [`init` command reference](/cli/commands) for the full flag list. **July 17, 2026** ## Week of July 13 – July 17 Releases [0.6.3](https://github.com/githits-com/githits-cli/releases/tag/v0.6.3) and [0.6.4](https://github.com/githits-com/githits-cli/releases/tag/v0.6.4) shipped this week, bringing structured rate-limit and timeout errors across the [`githits` CLI](/cli/commands) and MCP tools, marketplace-ready MCP tool annotations with a compact-by-default output format, and tighter credential persistence when refreshes hit transient failures. ### New **Marketplace-ready MCP tool annotations** Every public MCP tool now declares explicit `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotations, so MCP-aware clients and marketplaces (including the OpenAI marketplace) can classify what each tool does before calling it. Read-only tools like [`docs_read`](/tools/documentation-access), [`pkg_info`, `pkg_vulns`, `pkg_deps`, `pkg_changelog`, and `pkg_upgrade_review`](/tools/package-inspection) are marked as such; tools that may enqueue private indexing or crawl work (like `search`, [`code_files`, `code_read`, `code_grep`](/tools/code-navigation), and [`docs_list`](/tools/documentation-access)) are explicit about the bounded, non-destructive nature of those writes. **Compact `text-v1` is now the default MCP output format** Format-selectable MCP tools now default to `text-v1` and advertise it as the first `format` option. Agents get concise, markdown-shaped responses out of the box instead of the full JSON envelope, cutting context usage on `code_read`, `code_grep`, `docs_read`, `pkg_changelog`, and `pkg_deps`. JSON stays available as an opt-in for scripting. ### Improved **Structured rate-limit and timeout errors across CLI and MCP** API rate-limit (`429`) and request-timeout responses are now classified consistently across the [`githits example`](/cli/commands) command, [code navigation](/tools/code-navigation), [documentation access](/tools/documentation-access), and [package inspection](/tools/package-inspection). JSON output preserves standard retry metadata (`details.retryAfterSeconds`, `details.timeoutMs`) with `retryable: true`; terminal output surfaces the same information in plain language, for example `Request limit reached. Try again in 17 seconds.` The client returns the error immediately instead of silently retrying, and public messages stay provider-neutral. **Longer client deadline for `githits example`** Example generation now uses a longer client-side deadline than shorter metadata operations, so complex example requests can complete without spurious timeouts. Explicit timeout overrides are honored for tests and embedding clients, and hosted transports can reserve time for their outer response boundaries. The CLI default stays at four minutes. ### Fixed * **Transient auth failures no longer clear your refresh credentials.** Transport, timeout, and 5xx failures during token refresh now retain the stored refresh token and retry on the next call. Only classified terminal failures (revoked sessions, refresh-token reuse, invalid client) clear credentials — see [authentication](/authentication) for details. * **Auth files preserve tightened permissions.** On POSIX, new and rewritten `auth.json`, `client.json`, `metadata.json`, and `diagnostics.json` are capped at `0600`; existing more-restrictive modes (like `0400`) are preserved instead of being loosened. * **Ambiguous legacy plaintext credentials are reconciled safely.** File-mode auth loads now run under the auth lock when migration is needed: the newest valid timestamp wins, canonical copies are re-persisted, and legacy copies are cleared. Ambiguous ties between legacy stores are left intact with a warning instead of guessing. **July 10, 2026** ## Week of July 6 – July 10 A batch of network and reliability fixes landed on `main` this week: [`githits`](/cli/commands) now honors standard HTTP proxy environment variables across every CLI-originated call, local auth commands no longer trip over a malformed proxy setting, and missing GitHub repositories in [code navigation](/tools/code-navigation) get a clean "not found" instead of a generic error. ### New **HTTP proxy support across the CLI** The [`githits` CLI](/cli/commands) now honors `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` (and their lowercase aliases) for every CLI-originated request — OAuth discovery, sign-in, token refresh, REST API calls, code and package service calls, local MCP tool calls started through `githits mcp start`, and npm update checks. Lowercase values win when both cases are set, matching standard proxy precedence. `NO_PROXY` bypass and credential redaction in error messages both work out of the box, so you can now run GitHits from behind a corporate proxy without extra configuration. The Node.js floor moves to `^20.18.1 || >=22.13.0` as part of this change. ### Fixed * **`githits auth status` and `githits logout` no longer fail on malformed proxy env.** Proxy validation is now deferred until the first network call, so local-only auth paths (checking status, logging out) run cleanly even when `HTTP_PROXY` is set to an unparseable value. * **Missing GitHub repositories now return `NOT_FOUND` from [code navigation](/tools/code-navigation).** A backend `REPOSITORY_NOT_FOUND` used to surface as a generic error; it's now classified as a clean, non-retryable `NOT_FOUND`, with `repoUrl` and `requestedRef` echoed in the error details so agents can give a specific "that repo doesn't exist" message instead of guessing. **July 6, 2026** ## Week of July 6, 2026 Release [0.6.2](https://github.com/githits-com/githits-cli/releases/tag/v0.6.2) shipped this week, adding a scripting-friendly `githits auth token` command, publishing GitHits to the official MCP registry as `com.githits/githits`, and polishing the `githits login` URL fallback plus the packaged GitHits MCP skill copy. ### New **`githits auth token` for scripting and CI** A new [`githits auth token`](/cli/commands) command prints the current bearer token to stdout — no labels, prompts, or extra whitespace — so you can pipe it directly to other tools or use it in command substitution. Resolution matches the rest of the CLI: if `GITHITS_API_TOKEN` is set it wins, otherwise the stored OAuth access token is printed, refreshing it against the saved client first if it's expired. When no credentials are available the command exits non-zero instead of triggering an interactive login, so CI runs fail fast with a clear signal. ```bash theme={null} curl -H "Authorization: Bearer $(npx githits@latest auth token)" \ https://api.example.com/resource ``` **Published to the official MCP registry** GitHits is now listed in the [official MCP registry](https://github.com/modelcontextprotocol/registry) as `com.githits/githits`, giving MCP-aware clients a canonical discovery and installation path in addition to the existing `npx githits@latest init` flow. The registry entry is published automatically from the release pipeline, so it stays in lockstep with each new CLI release. ### Improved **Visible sign-in URL fallback during `githits login`** [`githits login`](/cli/commands) now always prints the browser sign-in URL as a visible fallback during normal runs, not just under `--no-browser`. If the browser launch is hidden (for example inside a wrapper terminal) or fails silently, you'll still see the URL and can open it yourself without rerunning the command. **Tightened GitHits MCP skill guidance** The packaged `githits-mcp` skill installed by guided `githits init` picks up small copy tweaks — clearer framing that GitHits covers public OSS and package evidence, and less prescriptive advice about unrelated local tools — so agents get a calmer, more accurate description of when to reach for GitHits. **July 3, 2026** ## Week of June 29 – July 3 Release [0.6.0](https://github.com/githits-com/githits-cli/releases/tag/v0.6.0) shipped this week, making guided GitHits MCP setup the recommended `githits init` path, adding a packaged `githits-mcp` skill and short managed instruction block that agents pick up automatically, and expanding the set of supported MCP setup targets. ### New **Guided GitHits MCP init is the new recommended path** [`githits init`](/cli/commands) now leads with **Install GitHits MCP + supporting instructions (Recommended)** as the top choice, with plain MCP and standalone Agent Skills kept as explicit alternatives. Guided setup installs the MCP server plus a small `githits-mcp` skill and a managed instruction block, so agents reliably reach for GitHits as the default OSS context layer instead of falling back to model memory or generic web search. New flags let you pick a mode non-interactively: * `githits init --guidance` — install MCP plus the supporting skill and instruction block. * `githits init --no-guidance` — install plain MCP only. * `githits init uninstall --keep-guidance` — remove the MCP config but keep the skill and instruction block in place. Interactive setup, `--yes`, and staged `--install-agents` all default to guided MCP unless `--no-guidance` is passed. Reruns are idempotent: if MCP is already installed but guidance is missing, guided init installs only the missing pieces, and vice versa. Uninstall cleans up GitHits MCP config, the managed instruction block (identified by `` markers), and the GitHits-owned `githits-mcp/SKILL.md` from every target path, deleting the skill directory only if it ends up empty. Guidance is installed at both **user** and **project** scope depending on the tool — for example a project-level `.claude/skills/githits-mcp/SKILL.md` alongside a user-level `~/.copilot/instructions/githits.instructions.md`. **Packaged `githits-mcp` skill and managed instruction block** GitHits now ships a dedicated `githits-mcp` Agent Skill and a short managed instruction paragraph that guided init drops into `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and equivalent per-tool instruction files. The skill tells agents to prefer GitHits for open-source discovery, planning, research, implementation, debugging, and maintenance — package docs, indexed package and repository source, examples, dependency graphs, vulnerabilities, changelogs, and upgrade-review evidence — and to route to the right tool (`search`, `docs_*`, `code_*`, `pkg_*`, `get_example`) instead of relying on model memory. The instruction block stays intentionally one paragraph; the skill carries the detailed behavior, so agent context stays lean. **Expanded MCP setup targets** Guided and plain `githits init` now configure MCP for a wider set of current, docs-backed clients: * **Zed** — `context_servers` in `~/.config/zed/settings.json` (user) or `.zed/settings.json` (project). * **Junie** — `mcpServers` in `~/.junie/mcp/mcp.json` or `.junie/mcp/mcp.json`. * **Qwen Code** — `mcpServers` in `~/.qwen/settings.json` or `.qwen/settings.json`. * **Kiro** — `mcpServers` in `~/.kiro/settings/mcp.json` or `.kiro/settings/mcp.json`. * **Kilo Code** — `mcp` in `~/.config/kilo/kilo.jsonc` or `.kilo/kilo.jsonc`, using the local command shape. * **Factory Droid** — `mcpServers` in `~/.factory/mcp.json` or `.factory/mcp.json`. * **Amazon Q CLI** — command-driven user install via detected `q mcp` / `qchat mcp`; no direct file editing. Each target participates in the same install, uninstall, rerun, and `--install-agents --json` flows as existing tools. ### Fixed * **Headless-friendly `githits init` sign-in.** Release [0.6.1](https://github.com/githits-com/githits-cli/releases/tag/v0.6.1) adds a `--no-browser` flag to [`githits init`](/cli/commands) that prints the sign-in URL instead of trying to open a browser, so SSH sessions, containers, and other display-less environments can complete guided setup without a remote browser popping up. Behaves the same as `githits login --no-browser`. **June 26, 2026** ## Week of June 22 – June 26 Releases [0.5.1](https://github.com/githits-com/githits-cli/releases/tag/v0.5.1), [0.5.2](https://github.com/githits-com/githits-cli/releases/tag/v0.5.2), and [0.5.3](https://github.com/githits-com/githits-cli/releases/tag/v0.5.3) shipped this week, focused on a canonical syntax for GitHub repository targets, sharper "did you mean" guidance when a ref doesn't exist, and a leaner aggregate path for `pkg_upgrade_review`. ### New **Canonical `github:owner/repo#ref` target syntax** [Code navigation](/tools/code-navigation), search, and [documentation access](/tools/documentation-access) now accept GitHub repository targets in a canonical `github:owner/repo#ref` form, plus full `https://github.com/owner/repo` URLs. The `#ref` form makes refs that contain `@` (for example `n8n@2.26.5`) unambiguous, and CLI and MCP follow-ups now echo the same canonical label everywhere. Malformed GitHub URLs are rejected up front instead of being passed through. **Aggregate `pkg_upgrade_review` with transitive truncation metadata** [`pkg_upgrade_review`](/tools/package-inspection) now uses a single aggregate backend query instead of fanning out per package, so reviews are faster and JSON/text output stays in lockstep. Public JSON also gains `*TotalCount` and `*Truncated` fields on transitive vulnerability detail pages, so agents can tell when a list was cut off and decide whether to ask for more. ### Improved **Cleaner `githits init` status rows** [`githits init`](/cli/commands) now shows the read-only probe command (for example `checked via claude plugin list`) on rows that didn't change, prints install or uninstall commands only when they actually ran, and aligns multi-command continuation rows to the detail column. Composite rows that pair a CLI check with a config-file write are preserved. **Leaner package metadata payloads** Package summary, dependency, and changelog backend calls now request only the fields each output mode actually uses — compact text and `--omit-bodies` skip verbose fields, while JSON and verbose modes keep everything. You should see faster responses for the common `pkg info`, `pkg deps`, and `pkg changelog` paths with no change in what's rendered. **"Did you mean" suggestions for unknown repository refs** When [code navigation](/tools/code-navigation) hits a `REF_NOT_FOUND` for a GitHub target, the error now includes the backend's `suggestedRefs` (a short "did you mean" list) separately from `availableRefs` (indexed refs you can retry against). CLI and MCP error details surface both, and the inline hint only appends a suggestion when the backend message doesn't already include one — no more duplicated suggestions in the same error. **Indexing wait estimates in error messages** Code navigation responses for repos that are still being indexed now include a compact estimate of how long indexing should take, alongside structured `indexingEstimate` fields in the error details. You'll know whether to wait a few seconds or come back later. **June 19, 2026** ## Week of June 15 – June 19 Releases [0.4.14](https://github.com/githits-com/githits-cli/releases/tag/v0.4.14) and [0.4.15](https://github.com/githits-com/githits-cli/releases/tag/v0.4.15) shipped this week, focused on a much clearer `init` install/uninstall experience, stricter package target syntax, and a wave of auth hardening for users running multiple agents in parallel. ### New **Per-tool change rows in `githits init`** [`githits init`](/cli/commands) now reports exactly what changed for every detected tool — `created`, `updated`, `unchanged`, or `ran` — alongside the config path or command it touched, instead of a generic success line. Already-configured tools are included in the audit so you can see at a glance what your setup looks like, and `--install-agents --json` includes structured `changes` for scripting. **Unified `init uninstall` UX** `githits init uninstall` now uses the same selection model as install: configured tools are pre-checked, deselecting one keeps it, and `--yes` removes from all configured tools. Per-tool result rows use the same aligned renderer as install, so install and uninstall finally read the same way. **Auth-clear breadcrumb in `githits doctor`** [`githits doctor`](/cli/commands) now surfaces the last auth-clear event (`reason` + timestamp) when your token went missing — for example after a refresh-token reuse, a rejected client registration, or an explicit `logout`. When the active token is missing, `doctor` also prints a cause-specific recommendation so you know what to do next. No secrets are stored. ### Improved **Explicit package registries in target specs** Package targets across `search`, [code navigation](/tools/code-navigation), [documentation access](/tools/documentation-access), and [package inspection](/tools/package-inspection) now require an explicit registry prefix — for example `npm:express` instead of a bare `express`. GitHub repository shorthands `github:owner/repo` and `github.com/owner/repo` are normalized. Errors for mixed package/repo targets, CLI help, and MCP tool descriptions were rewritten to match. **Cleaner `login` and `logout` output** `githits login` and `githits logout` output is now concise — no token-lifetime or environment details, no implementation-oriented progress lines. Just what happened. **Dedicated message for missing git refs** Code navigation tools now classify backend `REF_NOT_FOUND` responses separately and show repo/ref-specific guidance instead of generic path-narrowing or "try `code_files`" hints. You'll know immediately when a branch, tag, or commit doesn't exist. **Windows launcher detection in `doctor`** `githits doctor`'s PATH lookup now checks PATHEXT launchers like `githits.cmd` on Windows, so `doctor` correctly reports the CLI as installed instead of missing. ### Fixed * **Refresh-token reuse races between concurrent agents.** The auth refresh lock is now keyed to the credential scope (per-user) instead of the active config directory, so two local agents sharing the same keychain credential no longer both submit the same single-use refresh token and trigger a server-side family revocation. Terminal `invalid_client` and refresh-reuse failures also clear stale state immediately so the next login starts clean. * **Cross-class credential tug-of-war.** Keychain and file-mode auth storage are now isolated for both reads and writes — agents running in different storage modes can no longer steal and delete each other's tokens. Switching `auth.storage` between modes now requires an explicit `githits login`. * **Automatic auth clears stay scoped to the active backend.** A stale credential in an inactive backend (for example a leftover keychain token) can no longer wipe the good credential in the mode you actually run. Explicit `githits logout` still clears every backend. * **Auth lock acquisition retries on write races.** Concurrent token refreshes no longer fail with `ENOENT` when another contender removes the lock directory between create and owner-file write. **June 12, 2026** ## Week of June 8 – June 12 ### New **GitHits onboarding skill** A new `githits-onboarding` skill walks coding agents through a safe, staged GitHits setup — detecting supported tools, asking before writing any config, installing the ones you pick, guiding you through login, and verifying the result. It ships as a public skill and as part of the Claude Code plugin. Install [GitHits Skills](/installation/skills) and your agent can run setup for you instead of you wiring `init` flags by hand. ### Improved **More resilient `githits init` on slow machines** Agent detection and config probes in [`githits init`](/cli/commands) now run with bounded timeouts (2–5s) so a stuck binary lookup or hung config check fails fast instead of stalling onboarding. Set `GITHITS_INIT_TRACE=1` to print step-by-step diagnostics on stderr when you need to debug a detection issue — JSON output on stdout is unaffected and stays machine-parseable. **June 5, 2026** ## Week of June 1 – June 5 ### New **OpenCode support in `githits init`** [`githits init`](/cli/commands) now detects and configures [OpenCode](/installation/automatic-setup) alongside the other supported AI coding tools, with a higher generated MCP timeout tuned for OpenCode's session flow. **Safer MCP package tool inputs** [Package inspection](/tools/package-inspection) tools picked up cleaner, agent-safer schemas: `pkg_deps` now takes `max_depth`, `pkg_changelog` takes `omit_bodies`, and `pkg_upgrade_review` takes `skip_transitive_security`. Defaults are no longer silently coupled to other options, so agents get more predictable behavior on every call. ### Improved **Better language search results** [`githits languages`](/cli/commands) and the [`search_language`](/tools/code-examples) MCP tool now route queries through the backend's ranked `/languages` endpoint instead of local filtering. Short aliases like `ts`, `py`, `js`, `c++`, and `c#` now surface the right language first. **Clearer authentication errors** Auth failures now distinguish missing local credentials from backend-rejected tokens, both in CLI JSON output and MCP error envelopes. Remediation guidance points you to the right next step — OAuth login, [`GITHITS_API_TOKEN`](/authentication), or support — instead of a generic "not authenticated" message. **Normalized empty MCP search filters** The `search` tool no longer fails with `INVALID_ARGUMENT` when an agent passes empty docs-only filter fields. Blank filters are treated as absent, matching how other MCP inputs behave. ### Fixed * **Concurrent agents no longer invalidate each other's auth tokens.** Token refresh is now serialized across CLI and MCP processes sharing the same credentials, so running multiple agents in parallel won't spend a single-use refresh token twice and log you out. **May 29, 2026** ## Week of May 25 – May 29 ### New **Project-level `githits init`** [`githits init`](/cli/commands) now supports installing GitHits MCP configuration at the project level, alongside the existing user-level setup. Project mode covers detect, install, and uninstall flows for supported agents — including a new VS Code stdio config — so you can scope GitHits to a single repo without touching your global agent setup. **`githits doctor` diagnostics command** A new [`githits doctor`](/cli/commands) command prints a redacted snapshot of your runtime, environment, config path, service override, and auth file state. Text and `--json` output are both supported, and probes are read-only so running it never triggers auth migration or token refreshes. Use it first when filing an issue. **Swift package support** Swift is now a first-class registry across `search`, [code navigation](/tools/code-navigation), [documentation access](/tools/documentation-access), and [package inspection](/tools/package-inspection). Vulnerability and dependency lookups, `v`-prefixed versions, and GitHub-shaped package coordinates all work for Swift packages out of the box. ### Improved **Simpler search source selection** The `search` tool and `githits search --source` now take a single source value instead of a list. Descriptions for `target` and `source` were also rewritten to be clearer for agents. Passing `--source` more than once is now rejected explicitly instead of silently picking one. **Request timeouts everywhere** Network requests now time out with a clear error, so stalled requests no longer leave the CLI waiting indefinitely. **Structured auth failures** Missing-auth failures from authenticated commands now return a consistent JSON envelope (`AUTH_REQUIRED`), while terminal sessions still see the friendly login guidance. Easier to handle from scripts and agents. ### Fixed * **Empty optional MCP fields no longer break tool calls.** `pkg_upgrade_review`, `search` targets, `pkg_changelog` addressing, and `code_*` targets now treat harness-filled empty arrays and blank strings as absent instead of failing validation. * **Token refresh races hardened.** Concurrent refresh attempts coalesce correctly across soft and forced refreshes, rotated refresh tokens are preserved on same-lineage conflicts, and newer external sessions/logouts still take precedence. * **Windows `init` no longer triggers Node DEP0190.** Subprocess probes now run through `cmd.exe` with safe argument escaping so shim resolution works without deprecation warnings. **May 22, 2026** ## Week of May 18 – May 22 ### New **Hermes Agent support in `githits init`** `githits init` now detects [Hermes Agent](/installation/automatic-setup) alongside the other supported AI coding tools and writes its MCP server configuration to `~/.hermes/HERMES_HOME` while preserving existing YAML comments. Run `githits init` to set it up. **Agent-safe staged onboarding** The `init` command now supports a staged, non-interactive flow for agents and CI. New flags on [`githits init`](/cli/commands): * `--detect-agents` — scan for supported AI tools and exit without making changes. * `--install-agents ` — install only the agents you explicitly name. Idempotent for already-configured agents. * `--json` — emit detection and install results as structured JSON. `--yes` is rejected in non-interactive runs to prevent surprise side effects. See the [headless CI guide](/guides/headless-ci) for usage patterns. **Copy-paste agent snippet on the `init` ready screen** After setup completes, `githits init` now prints a snippet you can drop directly into your `AGENTS.md` or `CLAUDE.md` so your agent knows when to reach for GitHits tools. ### Improved **Redesigned `init` onboarding flow** Rewritten copy across every `init` screen (intro, detect, choose, sign-in, install, ready, uninstall) in a clearer, agent-focused voice. The CLI also picks up a new brand color, a gradient ASCII logo, highlighted `--help` section titles, and an animated spinner with rotating labels on `example`, `search`, `code`, and `docs` while requests are in flight. **Target resolution feedback for code navigation** [Code navigation](/tools/code-navigation) tools (`search`, `code_files`, `code_read`, `code_grep`) now surface compact, actionable warnings when a target needs freshness or indexing attention, and stay quiet on healthy default-branch requests. Follow-up targets and default-branch intent are preserved across calls. **Severity-filtered transitive upgrade advisories** [`pkg_upgrade_review`](/tools/package-inspection) now applies your `min_severity` setting to transitive vulnerability counts, so the evidence you see matches the threshold you asked for. The previous "transitive counts are unfiltered" caveat has been removed. ### Fixed * **`--no-color` now actually disables color.** The flag was previously registered but never wired up. Every styled output across the CLI now respects it. * **`githits logout` no longer reads the keychain.** Logout completes cleanly without unnecessary credential prompts. * **Auth is refreshed before `init` login** to avoid stale-session failures during onboarding. * **Init detection messaging** is clearer when no compatible agents are found, and login guidance is suppressed when an install step fails. * **Node 20 compatibility restored** after a regression in the previous release. * **Stale-search warnings suppressed** when the follow-up target matches the original request. # GitHits CLI command reference: all commands and flags Source: https://docs.githits.com/cli/commands Complete reference for every GitHits CLI command, organized by category: setup, authentication, MCP server, Code, Documentation, and Package Intelligence. GitHits groups tools into **Deterministic** (Code, Documentation, and Package Intelligence) and **Agentic** (example generation and research). The CLI also provides setup and authentication commands. Run commands through `npx githits@latest` unless you are inside an MCP config that already uses the JSON command form. This reference covers [githits 0.40.1](https://github.com/githits-com/githits-cli/releases/tag/v0.40.1). Use `npx githits@latest --version` to check the version you are running. For package, GitHub, GitLab.com, Codeberg, Launchpad, and Googlesource addressing, see [target syntax](/tools/code-navigation#choose-a-target). Pass known targets directly to search and navigation commands; use `resolve` for a dependency name or a mutable Launchpad default. *** ## Global options Global options can appear before any command. | Option | Purpose | | - | - | | `-V, --version` | Print the installed GitHits version. | | `--no-color` | Disable ANSI color output. The standard `NO_COLOR` environment variable has the same effect. | | `-h, --help` | Show help for the current command. | *** ## Setup and configuration > [accordion] npx githits\@latest init > > Authenticate and configure GitHits for supported AI coding tools. > > Authenticate and configure supported 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. > > ```bash theme={null} > npx githits@latest init > ``` > > Automatic install support: Claude Code, Cursor, Windsurf, Claude Desktop, Codex CLI, Pi, VS Code / Copilot, Cline, Gemini CLI, Google Antigravity, OpenCode, Hermes Agent, Zed, Junie, Qwen Code, Kiro, Kilo Code, Factory Droid, and Amazon Q CLI. > > By default, `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 `` 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** > > **-y, --yes** `flag` > > Skip interactive prompts and configure all detected tools automatically. Defaults to guided MCP unless `--no-guidance` is set. > > **--skip-login** `flag` > > Skip the authentication step. Useful if you are already authenticated and only want to reconfigure tool integrations. > > **--project** `flag` > > Configure project-level MCP in the current directory instead of user-level tool configuration. > > **--detect-agents** `flag` > > Scan supported agents and print what GitHits can configure without installing anything. > > **--install-agents** `string` > > Install the MCP server for a comma-separated list of agent IDs returned by `--detect-agents`. Defaults to guided MCP unless `--no-guidance` is set. > > **--guidance** `flag` > > Explicitly install the GitHits skills and managed instruction block alongside MCP configuration. This is the default; use the flag when scripting a guided install to make intent explicit. > > **--no-guidance** `flag` > > Install plain MCP only. Skips the GitHits skills and the managed instruction block in supported tools. > > **--json** `flag` > > Emit JSON output for `--detect-agents` or `--install-agents`. > > **--no-browser** `flag` > > Print the authorization URL instead of opening a browser during the login step. Use this in SSH sessions, CI environments, or containers where a browser isn't available. > > **--port** `number` > > Port for the local sign-in callback (default `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`. > > > [!TIP] > > > > `init` is the default way to get started. It configures supported tools and handles authentication for common local setup. > [accordion] npx githits\@latest uninstall > > Remove GitHits MCP configuration and guidance from detected coding tools. > > Remove GitHits MCP configuration from all detected coding tools. Uninstall also cleans up guided setup artifacts: the managed instruction block (content between `` 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. > > ```bash theme={null} > npx githits@latest uninstall > ``` > > In interactive mode, `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** > > **-y, --yes** `flag` > > Skip prompts and uninstall user-level MCP configuration. Never touches project files; combine with `--project` for non-interactive project-level removal. > > **--project** `flag` > > Remove project-level MCP configuration from the current directory. > > **--keep-guidance** `flag` > > Remove the MCP server configuration but leave the GitHits skills and managed instruction block in place. Useful when you want to disable the MCP server without losing the supporting agent context. > > To also remove stored credentials, run `npx githits@latest logout` separately after uninstalling. > [accordion] npx githits\@latest doctor > > Diagnose GitHits configuration and authentication state. > > Print redacted diagnostics for GitHits CLI, MCP configuration, environment variables, and authentication state. > > ```bash theme={null} > npx githits@latest doctor > ``` > > **Flags** > > **--json** `flag` > > Output diagnostics as JSON. *** ## Authentication > [accordion] npx githits\@latest login > > Log in to your GitHits account with browser OAuth. > > 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. > > ```bash theme={null} > npx githits@latest login > ``` > > **Flags** > > **--no-browser** `flag` > > Print the authorization URL and callback-forwarding instructions instead of opening the browser. If the browser runs on another machine, combine this with a fixed `--port` and an SSH tunnel. > > **--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. > > ```bash Standard login theme={null} > npx githits@latest login > ``` > > ```bash SSH / headless login theme={null} > npx githits@latest login --no-browser --port 8765 > ``` > > ```bash Force re-authentication theme={null} > npx githits@latest login --force > ``` > > ```bash Specific callback port theme={null} > npx githits@latest login --port 8080 > ``` > > When the browser runs on another machine, forward the same callback port from that machine before opening the printed URL: > > ```bash theme={null} > ssh -N -L 8765:127.0.0.1:8765 user@remote-host > ``` > > > [!NOTE] > > > > If authentication times out (after 5 minutes), the browser link expires. Run the command again to get a fresh link. > [accordion] npx githits\@latest logout > > Remove stored OAuth credentials from this machine. > > Remove stored OAuth credentials. After logging out, tool calls that require authentication will fail until you log in again. > > ```bash theme={null} > npx githits@latest logout > ``` > [accordion] npx githits\@latest auth status > > Check the current authentication status and credential source. > > Show current authentication status, including the credential source, storage location, and token expiry. > > ```bash theme={null} > 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. > [accordion] npx githits\@latest auth token > > Print the current bearer token for scripts and command substitution. > > Print the currently usable access token to stdout. Only the token is written, so you can pipe it into other tools or capture it with shell command substitution without stripping extra output. > > ```bash theme={null} > npx githits@latest auth token > ``` > > **Credential precedence** > > * If `GITHITS_API_TOKEN` is 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. > > **Exit behavior** > > If no token is available (neither `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 example** > > Use command substitution to hand the current session token off to another tool: > > ```bash theme={null} > TOKEN=$(npx githits@latest auth token) > curl -H "Authorization: Bearer $TOKEN" https://api.githits.dev/v1/packages/npm/express > ``` > > > [!WARNING] > > > > Treat the printed token like a password. Do not log it, echo it to shared terminals, or write it to files that get committed or shipped in bug reports. Prefer assigning it to a shell variable (as above) rather than interpolating it into commands that get recorded in shell history. > [accordion] npx githits\@latest settings > > View and update account preferences, privacy, terms, and limits. > > View and update GitHits account settings for the authenticated credential. The bare command and `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. > > ```bash theme={null} > npx githits@latest settings > npx githits@latest settings show > ``` > > **Flags** > > **--json** `flag` > > Output the canonical settings object as JSON. > > Use the `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 keys** > > | Key | Values | Clearable | > | - | - | - | > | `default-language-id` | A single language UUID | Yes | > | `license-mode` | `safe`, `yolo`, or `custom` | No | > | `blocked-license-ids` | One or more license UUIDs (atomic list replacement) | Yes | > | `marketing-emails` | `enabled` or `disabled` | No | > > > [!NOTE] > > > > Only `default-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. > [accordion] npx githits\@latest settings get > > Read one writable account setting. > > Read one account setting using its public CLI name. > > ```bash theme={null} > npx githits@latest settings get > npx githits@latest settings get license-mode > ``` > > **Arguments** > > **key** `string` *required* > > One of `default-language-id`, `license-mode`, `blocked-license-ids`, or `marketing-emails`. > > **Flags** > > **--json** `flag` > > Output the setting name and value as `{"key", "value"}` JSON. > [accordion] npx githits\@latest settings set > > Update one account setting. > > Update one writable account setting. The value is validated against the schema for that key and sent as a single selective PATCH. > > ```bash theme={null} > npx githits@latest settings set > ``` > > **Arguments** > > **key** `string` *required* > > One of `default-language-id`, `license-mode`, `blocked-license-ids`, or `marketing-emails`. > > **values** `string` *required* > > The typed value or list of values for the key. `blocked-license-ids` accepts one or more UUIDs and replaces the stored list atomically; all other keys take exactly one value. > > **Flags** > > **--json** `flag` > > Output the updated canonical settings object as JSON. > > ```bash Set license mode theme={null} > npx githits@latest settings set license-mode safe > ``` > > ```bash Opt out of marketing emails theme={null} > npx githits@latest settings set marketing-emails disabled > ``` > > ```bash Replace blocked license IDs theme={null} > npx githits@latest settings set blocked-license-ids \ > 0198a7d0-6750-7ace-a68c-418062117d95 \ > 0198a7d0-6750-7ace-a68c-418062117d96 > ``` > > ```bash Set default language theme={null} > npx githits@latest settings set default-language-id 0198a7d0-6750-7ace-a68c-418062117d95 > ``` > [accordion] npx githits\@latest settings clear > > Clear the default language or blocked license IDs. > > Clear one of the clearable account settings. `clear default-language-id` sends an explicit null; `clear blocked-license-ids` replaces the list with an empty list. > > ```bash theme={null} > npx githits@latest settings clear > npx githits@latest settings clear blocked-license-ids > ``` > > **Arguments** > > **key** `string` *required* > > One of `default-language-id` or `blocked-license-ids`. Other keys cannot be cleared and must be updated with `settings set`. > > **Flags** > > **--json** `flag` > > Output the updated canonical settings object as JSON. > [accordion] npx githits\@latest settings terms > > Show Terms of Service acceptance status. > > Show whether the authenticated account currently needs to accept the GitHits Terms of Service. > > ```bash theme={null} > npx githits@latest settings terms > ``` > > **Flags** > > **--json** `flag` > > Output `{"terms_required": boolean}` as JSON. > [accordion] npx githits\@latest settings terms accept > > Accept the current Terms of Service. > > Confirm and accept the current GitHits Terms of Service for the authenticated account. Interactive by default; pass `--yes` for non-interactive use. > > ```bash theme={null} > npx githits@latest settings terms accept > npx githits@latest settings terms accept --yes --json > ``` > > Works with both browser OAuth sessions and opaque `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. > > **Flags** > > **--yes** `flag` > > Accept without an interactive confirmation. Required when running in a non-TTY environment such as CI. > > **--json** `flag` > > Output the acceptance result as JSON, including `accepted`, `token_refreshed`, and the updated `settings` object. *** ## MCP server > [accordion] npx githits\@latest mcp > > Show manual MCP setup instructions or start stdio mode in non-TTY contexts. > > 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. > > ```bash theme={null} > npx githits@latest mcp > ``` > > Use this command to see the JSON snippet you need to add to your tool's MCP configuration manually. > [accordion] npx githits\@latest mcp start > > Start the GitHits MCP server over stdio for coding tool configs. > > 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. > > ```bash theme={null} > npx githits@latest mcp start > ``` > > A typical MCP config entry looks like this: > > ```json MCP config theme={null} > { > "mcpServers": { > "githits": { > "command": "npx", > "args": ["-y", "githits@latest", "mcp", "start"] > } > } > } > ``` *** ## Deterministic ### Code > [accordion] npx githits\@latest list > > List files and documentation in a package, repository, or hosted site. > > Browse one inventory with `githits list`, added in 0.23.0. Package and repository targets list source files, including repository documentation. Use an explicit `site:` target for hosted documentation; a package inventory does not combine its source tree with its hosted docs. > > ```bash theme={null} > npx githits@latest list npm:express@5.2.1 > npx githits@latest list npm:express@5.2.1 lib/ --recursive > npx githits@latest list github:expressjs/express@v5.2.1 'lib/**/*.js' --silent > npx githits@latest list site:expressjs.com --recursive --limit 20 --json > ``` > > Pass literal paths or quoted globs as `[paths...]`. `--recursive` traverses matched directories. Text output starts with a `Sources:` section, including the commit and known UTC commit date for repository snapshots. A `Read files:` or `Read pages:` line with the `read` template follows, then one path per line; directories end in `/`. An empty inventory prints `No files.` or `No pages.` instead, or `No files available yet.` while the source is still indexing. When more entries exist, a `More results:` footer shows the `--after` cursor. Follow the `Read files:` or `Read pages:` guidance or each JSON entry's `read` action. For site pages, preserve the emitted `site:` target and target-relative page path as separate arguments. > > **Flags** > > **-R, --recursive** `flag` > > Traverse matched directories recursively. > > **--file-type** `string` > > Filter source entries by case-insensitive file type, such as `source` or `doc`. Repeat for multiple types. Not accepted for site targets. > > **--language** `string` > > Filter source entries by case-insensitive language name. Repeat for multiple languages. Not accepted for site targets. > > **--intent** `string` > > Filter source entries by `production`, `test`, `benchmark`, `example`, `generated`, `fixture`, `build`, or `vendor`. Repeat for multiple intents. Not accepted for site targets. > > **--limit** `number` > > Maximum entries per page, 1–500. When omitted, GitHits uses the service default. > > **--after** `string` > > Opaque cursor printed in text or returned as `nextCursor` in JSON. Replay the same target, paths, filters, recursion, and limit with the cursor unchanged. > > **--wait** `number` > > Milliseconds to wait for source indexing, 0–300000 (default 30000). Pass `0` to return immediately. > > **-s, --silent** `flag` > > Output paths only in text mode, without the `Sources:` section, read guidance, or spinner. Does not change JSON output. > > **--json** `flag` > > Preserve entries, read actions, pagination cursors, and inventory metadata in JSON. > > **Pagination** > > ```bash theme={null} > npx githits@latest list npm:express@5.2.1 --recursive --limit 20 --json > npx githits@latest list npm:express@5.2.1 --recursive --limit 20 --json --after '' > ``` > > Replace `` with the exact value from the first response when `hasMore` is true. If the cursor is rejected, restart without `--after` and use the new result's cursor. > > > [!NOTE] > > > > `githits code files` remains available for compatibility and is deprecated in its help. Its flags and output differ from `list`. `githits docs list` still browses a package's combined hosted and repository documentation. MCP 0.24.0 replaces `code_files` and `docs_list` with [`list`](/tools/code-navigation#list). Refresh local tool discovery after upgrading. > [accordion] npx githits\@latest search > > Search indexed package or repository code, docs, and symbols. > > Run a unified indexed search across dependency and repository code, documentation, and symbols. > > ```bash theme={null} > npx githits@latest search "" --in > npx githits@latest search "router middleware" --in npm:express > npx githits@latest search '"body parser" OR multer' --in npm:express --source docs > npx githits@latest search "compose" --in npm:lodash --source code --kind function > ``` > > When a response supplies an active `searchRef` and continuation guidance, pass it to `npx githits@latest search-status`. See [search results and JSON migration](/tools/code-navigation#search) for the 0.23.0 result fields. > > **Flags** > > **--in** `string` > > Scope search to a package, repository, or site target. Repeat for multiple targets. Examples: `npm:react@18.2.0`, `github:owner/repo@ref`, and `site:react.dev`. > > **--source** `string` > > Restrict results to `docs`, `code`, or `symbol`. Omit to let GitHits choose the best indexed sources. > > **--kind** `string` > > Restrict symbol results by kind, such as `function`, `method`, `class`, `interface`, `module`, or `doc_section`. > > **--category** `string` > > Restrict symbol results by category: `callable`, `type`, `module`, `data`, or `documentation`. > > **--path-prefix** `string` > > Restrict code or symbol results to paths under a literal prefix. > > **--intent** `string` > > Restrict code or symbol results by file intent: `production`, `test`, `benchmark`, `example`, `generated`, `fixture`, `build`, or `vendor`. > > **--public** `flag` > > Restrict symbol results to public symbols. > > **--name** `string` > > Restrict symbol results to a specific symbol name. > > **--lang** `string` > > Restrict results by programming language. > > **--allow-partial** `flag` > > Return available hits while other targets or sources prepare. Enabled by default from 0.27.0. > > **--no-allow-partial** `flag` > > Wait for all runnable targets and sources before returning hits. > > **--limit** `number` > > Maximum results to return (1-100, default 10). > > **--offset** `number` > > Offset for pagination. > > **--wait** `number` > > Integer milliseconds to wait for indexing before returning a `searchRef` (0–120000, default 30000). Pass `0` to return immediately. Seconds values such as `30s` are rejected; use `--wait 30000` instead. When the response carries indexing-time estimates, GitHits suggests a longer follow-up wait up to the 120000 ms ceiling. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest search-status > > Poll a prior async indexed search by its searchRef. > > Follow up on a prior `npx githits@latest search` using the `searchRef` returned in the initial response. > > ```bash theme={null} > npx githits@latest search-status > ``` > > **Flags** > > **--wait** `number` > > Maximum integer milliseconds to wait for progress before returning the latest status, 0–120000 (default 30000). Pass `0` to return immediately. Seconds values such as `30s` are rejected. GitHits also uses indexing-time estimates from the initial search to suggest a longer wait, up to the 120000 ms ceiling. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest read > > Read an indexed source file, code symbol, or documentation section. > > Read an indexed source file, code symbol, or documentation page with the same command. Provide ` ` for a source file, an emitted ` ` for a hosted page, or a `docsReadTarget`/page ID alone for a documentation page. The CLI writes complete content to stdout without the MCP surface's 150/300-line cap so you can pipe it into other tools. Repository documentation resolves to indexed file content with snapshot identity; hosted documentation reads current indexed page content. > > ```bash theme={null} > npx githits@latest read [path] > npx githits@latest read npm:express@5.2.1 lib/application.js --lines 120-200 > npx githits@latest read github:expressjs/express@v5.2.1 lib/express.js > npx githits@latest read 'npm:express@5.2.1#createApplication' > npx githits@latest read https://expressjs.com/en/5x/api/express/ > npx githits@latest read https://expressjs.com/en/5x/api/express/#expressjson > npx githits@latest read npm:express@5.2.1 --selector createApplication > npx githits@latest read npm:express@5.2.1 lib/express.js --selector createApplication > npx githits@latest read https://expressjs.com/en/5x/api/express/ --selector expressjson > ``` > > Pass documentation targets through unchanged, including URL fragments. A fragment selects its heading and full subtree through the next equal-or-higher heading; either explicit line bound replaces that selection with a page-relative range. For site reads, use the target and path returned by `list`, with an optional `--selector `. > > Since `githits` 0.22.0, `--selector` reads an indexed code symbol or a documentation heading by its logical ID. A code symbol read returns the symbol's definition range. An optional `` restricts symbol lookup to that exact file. When a symbol selection is ambiguous, missing, or unsupported by the indexed snapshot, the CLI prints a typed `AMBIGUOUS`, `NOT_FOUND`, or `SNAPSHOT_UNSUPPORTED` outcome with candidates, suggestions, or an exact-path workaround. See the [`read` tool](/tools/code-navigation#read) for details. > > > [!NOTE] > > > > `npx githits@latest code read` and `npx githits@latest docs read` remain available as deprecated commands with their existing flags. Use `read` for site paths, compact symbol targets, and `--selector`. > > **Flags** > > **--repo-url** `string` > > Repository URL addressing. When set, the first positional argument is the file path. > > **--git-ref** `string` > > Git ref to use with `--repo-url`. Rejected for documentation reads. > > **--lines** `string` > > Inclusive line range, such as `120-200`, `120-`, or `-200`. From 0.38.0, `--lines 120` reads exactly one line. You can also append `:120-200` to the file path. > > **--selector** `string` > > Indexed code symbol name or logical documentation heading ID, such as `createApplication` or `expressjson`. The path is optional for code symbols. Do not combine with a docs URL fragment. With `--repo-url`, pass at most one positional path; the CLI rejects an extra path. Added in 0.22.0. > > **--start** `number` > > Starting line number for source or documentation reads. Use `--start`/`--end` as an alternative to `--lines`. > > **--end** `number` > > Inclusive ending line number for source or documentation reads. Use `--start`/`--end` as an alternative to `--lines`. > > **--wait** `number` > > Code indexing wait in milliseconds (0–60000, default 30000). Validated for documentation reads but not forwarded. > > **-v, --verbose** `flag` > > Add a metadata header and line gutter to text output. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest grep > > Grep packages, repositories, and hosted documentation in one page. > > Find regex or literal matches across one to 20 ordered package, repository, and `site:` hosted-documentation targets with `githits grep`, added in 0.24.0. GitHits returns one page of matches across all targets. Use it when you know the exact string or pattern and want matches from both source and documentation. Matching runs against indexed content, not local files. > > ```bash theme={null} > npx githits@latest grep > npx githits@latest grep 'router' npm:express --path lib/express.js > npx githits@latest grep -Fi 'router' npm:express site:expressjs.com > npx githits@latest grep -C 2 'app\.use\(' github:expressjs/express --glob 'lib/**/*.js' > npx githits@latest grep -F -- '--foo' github:example/repository > ``` > > Defaults follow grep and rg conventions, and differ from `code grep`: > > * Patterns are 1–200 UTF-8 bytes and use RE2 regex. Pass `-F` for literal matching. `foo|bar` matches either alternative; `foo\|bar` matches a literal pipe. Lookaround and backreferences are unsupported. Content-index searches require literal text in the pattern; a single exact-file route accepts anchorless regex, but a path selector alone does not guarantee that route. > * Matching is case-sensitive. Pass `-i` to ignore case. > * Output has zero context lines. Pass `-A`, `-B`, or `-C` to add context. > * Repository targets search all indexed files, source and documentation. > > Package targets also include their selected hosted documentation, independent of `--corpus` and path filters. `--corpus source` therefore does not exclude a package's hosted docs. Path flags and `--corpus` apply to every package and repository operand. `site:` operands accept only the target, so source flags with only `site:` operands fail. Put `--` before a pattern that starts with a dash. > > Text output starts with an outcome headline, such as `Found 4 matches on 3 lines in 2 files.`, and a `Sources:` section naming the resolved scopes. Targets still indexing appear under `Preparing:`. Matches are grouped under numbered `[1]`, `[2]` file or page headers. Each header begins with a copyable read locator you can pass to [`read`](#npx-githits-latest-read) with `--lines`. Match rows use `:` after the line number and context rows use `-`. After the matches, footers appear in a fixed order: `Read:` with the read templates, `More results:` with the `--cursor` value, and `Follow-up:` with a `--wait` retry for omitted targets. > > ```text theme={null} > Found 1 match on 1 line in 1 file. > > Sources: > - npm:express@5.2.1 > > [1] npm:express@5.2.1 lib/router/index.js > 42: function router(options) { > > Read: > Files: githits read --lines $start-$end -- $target $path > ``` > > Pass `--json` for the detailed lossless page, including read actions and byte coordinates. > > **Flags** > > **-F, --fixed-strings** `flag` > > Match the pattern as a literal string instead of an RE2 regex. > > **-i, --ignore-case** `flag` > > Ignore case with Unicode case folding. > > **-s, --case-sensitive** `flag` > > Match case sensitively. Follows the rg convention; traditional grep uses `-s` to suppress errors. The last case flag wins. > > **-A, --after-context** `number` > > Trailing context lines per match. From 0.38.0, nonnegative safe integers above 10 are capped at 10 and reported in text or JSON output. > > **-B, --before-context** `number` > > Leading context lines per match, capped at 10 with the same reporting as `-A`. > > **-C, --context** `number` > > Context lines on both sides, capped at 10 per side. `-A` and `-B` override their side regardless of order. Use `read` for more context. > > **--path** `string` > > Exact source path, applied to every package and repository operand. Repeatable. > > **--path-prefix** `string` > > Source path prefix. Repeatable. > > **--glob** `string` > > Source path glob. Repeatable. Path selectors are OR-ed within each source operand. > > **--corpus** `string` (default: all) > > Repository files to search: `source`, `documentation`, or `all`. > > **--limit** `number` > > Global match cap for the whole page, 1–1000. When omitted, GitHits uses the service default of 100. Unlike grep or rg `-m`, this is not a per-file limit. > > **--cursor** `string` > > Continue from a previous page. Reuse the same ordered targets and controls with the cursor unchanged. > > **--wait** `number` > > First-page preparation wait in milliseconds, 0–300000 (default 30000). Pass `0` to return immediately. Continuation pages never wait. > > **--json** `flag` > > Emit the detailed lossless JSON page. > > **Pagination and coverage** > > When more matches are available, the summary line ends with `more available` and the output ends with a ready-to-copy `--cursor` value. Rerun the same command with that flag to fetch the next page. A small `--limit` can fill the page before every scope is searched. GitHits then lists those scopes as `not visited in this page`, and the cursor continues into them. If the cursor expires, restart without `--cursor`. > > **Path and source notices** > > Since 0.36.0, when a path selector wrongly includes the package path prefix, text output shows a compact warning such as `Warning: Path is prefixed with package path "drizzle-orm". Did you mean "src/pg-core"?`. Matches, failures, and cursors are unchanged, and the CLI does not retry automatically. `--json` output adds a `pathWarnings` array with the same strings, empty when there are no warnings. > > When GitHits cannot confirm that a package version matches the served source revision, the `Source:` line says so inline, for example `(commit 5c71d2a, match to guava-testlib@33.4.0-jre unconfirmed)`. Targets still preparing use `Selected source:`. An unconfirmed match is not a claim about the published binary. See [package source correspondence](/tools/code-navigation#package-source-correspondence). > > > [!NOTE] > > > > `githits code grep` remains available with its existing literal, case-insensitive defaults. MCP 0.25.0 replaces `code_grep` with [`grep`](/tools/code-navigation#grep), using the same matching defaults as top-level CLI `grep`. Refresh tool discovery and migrate arguments. > [accordion] npx githits\@latest code grep > > Legacy single-target source grep; prefer npx githits\@latest grep. > > Search for a text pattern across the indexed files of a package or repository. For new CLI usage, prefer [`githits grep`](#npx-githits-latest-grep), which searches multiple targets and hosted documentation in one page. > > ```bash theme={null} > npx githits@latest code grep > npx githits@latest code grep npm:express "Router" > npx githits@latest code grep npm:express "use\(.*middleware" --regex > npx githits@latest code grep npm:express "createServer" src/ --ext js > ``` > > **Flags** > > **--repo-url** `string` > > Use a supported public GitHub, GitLab.com, Codeberg, Launchpad Git, or Googlesource (0.38.0+) repository URL instead of a compact target. > > **--git-ref** `string` > > Git ref to use with `--repo-url`. > > **--path** `string` > > Restrict grep to one exact target-relative file path. > > **--glob** `string` > > Restrict grep to files matching a glob. Repeat for multiple globs. > > **--ext** `string` > > Restrict grep to files with this extension, without the leading dot. Repeat for multiple extensions. > > **--regex** `flag` > > Treat the pattern as a regex. Literal matching is the default. > > **--case-sensitive** `flag` > > Use case-sensitive matching. > > **-C, --context** `number` > > Include this many lines before and after each match, capped at 10 per side from 0.38.0. The CLI reports when it caps the requested context. > > **-B, --before-context** `number` > > Include this many lines before each match, capped at 10. > > **-A, --after-context** `number` > > Include this many lines after each match, capped at 10. > > **--exclude-docs** `flag` > > Exclude documentation files. > > **--exclude-tests** `flag` > > Exclude test files. > > **--limit** `number` > > Maximum matches to return (default 50). > > **--per-file-limit** `number` > > Maximum matches to return per file. > > **--cursor** `string` > > Pagination cursor from a previous grep response. > > **--symbol-field** `string` > > Include a symbol field in grep output. Repeat for multiple fields. > > **--wait** `number` > > Milliseconds to wait for indexing (0–60000, default 30000). > > **-v, --verbose** `flag` > > Include additional metadata in text output. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest code files > > Legacy file inventory; prefer npx githits\@latest list. > > Deprecated in 0.23.0 help. Use [`list`](#npx-githits-latest-list) for new inventory workflows. This command keeps its existing flags and output for compatibility; it is not a flag-compatible alias for `list`. > > List the files included in an indexed package or repository. > > ```bash theme={null} > npx githits@latest code files [path-prefix] > npx githits@latest code files npm:express > npx githits@latest code files npm:express lib/ > npx githits@latest code files npm:express --ext ts --ext js > ``` > > **Flags** > > **--repo-url** `string` > > Use a supported public GitHub, GitLab.com, Codeberg, Launchpad Git, or Googlesource (0.38.0+) repository URL instead of a compact target. > > **--git-ref** `string` > > Git ref to use with `--repo-url`. > > **--path** `string` > > Return one exact target-relative file path. > > **--glob** `string` > > Include files matching a glob. Repeat for multiple globs. > > **--ext** `string` > > Include files with this extension, without the leading dot. Repeat for multiple extensions. > > **--file-type** `string` > > Include files with this file type. Repeat for multiple types. > > **--language** `string` > > Include files with this language. Repeat for multiple languages. > > **--file-intent** `string` > > Include files with this intent. Repeat for multiple intents. > > **--exclude-intent** `string` > > Exclude files with this intent after inclusive filtering. Repeat for multiple intents. > > **--exclude-docs** `flag` > > Exclude documentation files. > > **--exclude-tests** `flag` > > Exclude test files. > > **--hidden** `flag` > > Include hidden files. > > **--limit** `number` > > Maximum files to return (default 200). > > **--wait** `number` > > Milliseconds to wait for indexing (0–60000, default 30000). > > **-v, --verbose** `flag` > > Include metadata with text output. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest code read > > Deprecated alias for npx githits\@latest read on a source file. > > Read a specific file from an indexed package or repository by path. Since `githits` 0.17.0, this command is a deprecated alias for [`npx githits@latest read`](#npx-githits-latest-read). Behavior and flags are unchanged; prefer the unified command in new scripts. > > ```bash theme={null} > npx githits@latest code read > npx githits@latest code read npm:express@5.2.1 lib/application.js > npx githits@latest code read npm:express@5.2.1 lib/application.js --lines 120-200 > ``` > > **Flags** > > **--repo-url** `string` > > Use a supported public GitHub, GitLab.com, Codeberg, Launchpad Git, or Googlesource (0.38.0+) repository URL instead of a compact target. > > **--git-ref** `string` > > Git ref to use with `--repo-url`. > > **--lines** `string` > > Read an inclusive line range, such as `120-200`, or a single line with `--lines 120` (from 0.38.0). You can also append `:120-200` to the file path. > > **--start** `number` > > Starting line number for the read. > > **--end** `number` > > Ending line number for the read. > > **--wait** `number` > > Milliseconds to wait for indexing (0–60000, default 30000). > > **-v, --verbose** `flag` > > Add a metadata header and line gutter to text output. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest code diff > > Compare repository trees resolved from two package versions or refs. > > Compare repository trees resolved from two package versions or public repository refs, left-to-right. The range is required, uses two-dot syntax, and both endpoints must be exact — package targets must omit a version and repository targets must omit a ref. > > Available by default since 0.26.0. > > Launchpad targets are accepted from 0.33.0, but comparisons between different commits currently return nonretryable `RAW_DIFF_UNAVAILABLE`. Refs resolving to the same commit return an empty inventory. See [source diff](/tools/code-navigation#code-diff). > > ```bash theme={null} > npx githits@latest code diff .. > npx githits@latest code diff npm:express 4.18.1..4.18.2 > npx githits@latest code diff npm:express 4.18.1..4.18.2 --stat > npx githits@latest code diff npm:express 4.18.1..4.18.2 --name-status -- 'lib/**/*.js' > npx githits@latest code diff --repo-url https://github.com/expressjs/express v4.18.1..v4.18.2 --name-only > ``` > > > [!WARNING] > > > > Every raw diff is repository-wide. Package addressing resolves package, repository, version, and exact-commit identity, but `code diff` does not filter to a package directory. Sibling package paths may appear, and a bounded result may contain no files from the addressed package. That absence does not prove the package is unchanged. For an upgrade review, call `pkg upgrade-review` instead. > > **Flags** > > **--repo-url** `string` > > Address a supported public GitHub, GitLab.com, Codeberg, Launchpad Git, or Googlesource (0.38.0+) repository directly. Use repository refs in the required `..` range. > > **--patch** `flag` > > Default view. Unified-diff output; may omit some Git metadata such as index and mode headers. > > **--stat** `flag` > > Diffstat view. Mutually exclusive with `--patch`, `--name-only`, and `--name-status`. > > **--name-only** `flag` > > List changed paths only. > > **--name-status** `flag` > > List changed paths with change-status letters. > > **--max-files** `number` > > Cap on files. Applied after deterministic relevance ranking. No client default. > > **--max-patch-bytes** `number` > > Byte cap for the `--patch` view. No client default. > > **-v, --verbose** `flag` > > Show exact resolution and repository-scope diagnostics in text output. > > **--json** `flag` > > Emit a lean selected-view envelope that keeps package target identity, exact resolutions, effective repository scope, caller filters, completeness, and truncation as separate facts. > > Pass one repository-relative glob after `--` to narrow paths without changing scope. Three-dot merge-base syntax and `--git-ref` are rejected. > > Since 0.36.0, when GitHits cannot confirm that a package version matches its source revision, stderr includes a `From source:` or `To source:` line for that side, such as `From source: github:google/guava@v33.4.0 (commit 5c71d2a, match to guava-testlib@33.4.0-jre unconfirmed)`. An unconfirmed match is not a claim about the published binary. `--json` keeps the source assessments. See [package source correspondence](/tools/code-navigation#package-source-correspondence). > > 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 results. *** ### Documentation Use [`search --source docs`](#code) to find documentation by topic, then list or read pages with these commands. > [accordion] npx githits\@latest docs list > > List hosted and repo-backed documentation pages for a package. > > List documentation pages available for a package. Specs accept an optional `@version`; Go module versions are accepted with or without the leading `v`. > > Each entry provides read guidance using the page's `docsReadTarget`. JSON output retains the `docsReadTarget`, the stable `pageId`, and the provenance `sourceUrl` for every page. For a standalone hosted site, use [`list`](#npx-githits-latest-list) with a `site:` target. > > ```bash theme={null} > npx githits@latest docs list > npx githits@latest docs list npm:express > npx githits@latest docs list pypi:requests --limit 20 > ``` > > **Flags** > > **--limit** `number` > > Maximum pages to return. > > **--after** `string` > > Pagination cursor from a previous `docs list` response. > > **-v, --verbose** `flag` > > Include additional page metadata in text output. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest docs read > > Deprecated alias for npx githits\@latest read on a documentation page. > > Read a specific documentation page. Prefer the `docsReadTarget` URL emitted by `docs list` and search results; historical page IDs remain accepted. URL targets resolve only already-indexed documentation and never enqueue crawling. > > Since `githits` 0.17.0, this command is a deprecated alias for [`npx githits@latest read`](#npx-githits-latest-read). Behavior and flags are unchanged; prefer the unified command in new scripts. > > ```bash theme={null} > npx githits@latest docs read https://expressjs.com/en/5x/api/express/ > npx githits@latest docs read https://expressjs.com/en/5x/api/express/ --lines 50-150 > npx githits@latest docs read > ``` > > **Flags** > > **--lines** `string` > > Read an inclusive line range, such as `50-150`, or a single line with `--lines 50` (from 0.38.0). > > **-v, --verbose** `flag` > > Include page metadata in text output. > > **--json** `flag` > > Output the result as JSON. *** ### Package Intelligence From 0.32.0, package targets accept `cargo:` as an alias for public crates.io `crates:`, such as `cargo:serde`. Canonical registry identities remain `crates`. > [accordion] npx githits\@latest pkg info > > Inspect package metadata, popularity, downloads, and vulnerability status. > > Show a package overview for the default selected release, including version, license, repository popularity, download counts, and vulnerability summary. From 0.39.0, if the registry's latest pointer is skipped (for example, because it is deprecated or a prerelease), the output explains why. > > ```bash theme={null} > npx githits@latest pkg info : > npx githits@latest pkg info npm:express > npx githits@latest pkg info pypi:requests --verbose > ``` > > **Flags** > > **-v, --verbose** `flag` > > Include GitHub language/topics/last-pushed, published-version count, download refresh date, package-wide advisory history, and recent changes in text output. > > **--json** `flag` > > Output the result as JSON, including the selected version, the registry's latest version, and any `registryLatestDifference`. > > See [Package Intelligence](/tools/package-inspection) for the full parameter reference. > [accordion] npx githits\@latest pkg vulns > > List known CVE and OSV advisories for a package or version. > > List CVE and OSV vulnerability advisories for a package or a specific version. Go module versions are accepted with or without the leading `v` (`go:golang.org/x/crypto@0.17.0` or `@v0.17.0`). > > ```bash theme={null} > npx githits@latest pkg vulns : > npx githits@latest pkg vulns npm:lodash > npx githits@latest pkg vulns npm:lodash@4.17.20 --severity high > ``` > > **Flags** > > **-s, --severity** `string` > > Minimum advisory severity: `low`, `medium`, `high`, or `critical`. > > **--scope** `string` > > Advisory rows to return: `affected` (default), `non_affecting`, `unknown` (could not be evaluated), or `all`. Unknown scope is available from 0.31.0 and includes assessment reasons. Summary counts cover all scopes. > > **--include-withdrawn** `flag` > > Include retracted advisories. Affects direct package rows only; transitive withdrawn advisories remain excluded. > > **--transitive** `flag` > > Audit vulnerabilities in versions resolved by the dependency graph. Opt-in because it adds graph-analysis cost. `--severity` and `--scope` apply to direct and transitive rows. > > **--details** `flag` > > From 0.40.0, fetch full advisory text and source metadata from OSV for every selected direct advisory. Adds live source reads and can produce long output. Source failures preserve assessments and exit nonzero. For a dependency advisory's full report, use `vulns --verbose`. > > **-v, --verbose** `flag` > > Expand assessment fields: aliases, dates where relevant, malicious-advisory markers, and complete range/fix details. CLI text already shows every selected direct and transitive advisory row. Full source reports require `--details`. > > **--json** `flag` > > Output structured assessment data. Combine with `--details` to include full source reports in `sourceDetails`. > [accordion] npx githits\@latest vulns > > Look up CVE, OSV, or GHSA IDs and the packages they affect. > > From 0.39.0. Look up one or more advisory IDs and show the packages each one affects. Use this when you start from an advisory ID, such as a CVE in a security report, and need to know which packages and versions it covers. To check whether a specific installed version is affected, use `pkg vulns` instead. > > ```bash theme={null} > npx githits@latest vulns > npx githits@latest vulns CVE-2026-26996 GHSA-3ppc-4f35-3m26 > npx githits@latest vulns CVE-2026-26996 --verbose > npx githits@latest vulns CVE-2026-26996 --json > ``` > > Text output leads with the requested ID, the reported CVSS score when the source provides one, and the advisory summary. Each affected package shows a registry link, normalized affected ranges, and source-reported fixes. The default shows up to ten ranges per package and states how many were omitted. IDs are case-sensitive. Input order and duplicates are preserved. > > If a lookup is only partly successful, the CLI keeps the evidence it retrieved, states the cause, and exits nonzero. Diagnostics include recovery actions, such as `githits login` when authentication is required. > > **Flags** > > **-v, --verbose** `flag` > > Add the full source report: untruncated advisory text, raw range expressions, CVSS vectors, aliases, dates, and references. From 0.40.0, also includes OSV schema version, related and upstream IDs, and credits. Works with `--json`. > > **--json** `flag` > > Output one result per input ID. Each result separates package evidence (`packages`), shared source records (`sources`), acquisition `coverage`, and `diagnostics` with retryability and recovery actions. Compact JSON caps normalized affected ranges at ten per package and reports omissions; combine with `--verbose` for original source detail. `affectedRanges` and `sourceFixVersions` are independent lists and are not index-aligned. > > > [!WARNING] > > > > Source-reported fix lists are not verified releases and do not establish a safe upgrade. A range boundary is not necessarily a fix. Withdrawn and malicious-package markers are kept and shown beside the affected evidence. Missing evidence does not establish safety. Assess an installed version with `npx githits@latest pkg vulns :@`. > > This command is CLI-only. MCP has no equivalent tool. > [accordion] npx githits\@latest pkg deps > > Show direct dependencies and optional transitive dependency details. > > Show direct dependencies, dependency groups, and optionally the full transitive dependency graph. Go module versions are accepted with or without the leading `v`. > > ```bash theme={null} > npx githits@latest pkg deps : > npx githits@latest pkg deps npm:express > npx githits@latest pkg deps npm:webpack --depth 3 > ``` > > **Flags** > > **-l, --lifecycle** `string` > > Dependency lifecycle breadth. Use `runtime`, `development`, `build`, `peer`, `optional`, or `all`. > > **--depth** `number` > > Add transitive dependency data and cap traversal at this depth (1-10). > > **--issues** `flag` > > Compute deprecated, outdated, duplicate, and conflict analysis across the resolved dependency graph. Use `--verbose` for complete issue details. > > **-v, --verbose** `flag` > > Include additional dependency metadata in text output. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest pkg changelog > > Retrieve release notes and changelog entries for a package. > > Retrieve release notes and changelog entries for a package. Since 0.21.0, repository targets, `--repo-url`, and `--git-ref` are rejected. Use the published package target. Results preserve backend and source order, which may interleave maintained release lines. Do not assume newest-first ordering. From 0.30.0, default text and JSON contain parsed statements with available classifications and sources. > > ```bash theme={null} > npx githits@latest pkg changelog : > npx githits@latest pkg changelog npm:express --limit 5 > npx githits@latest pkg changelog npm:express --from 4.18.0 --to 4.19.0 > npx githits@latest pkg changelog npm:express@5.2.1 > npx githits@latest pkg changelog npm:express@4.21.2..5.2.1 > ``` > > **Flags** > > **--from** `string` > > Exclusive start of a version range. Returns entries after this version through `--to` or latest. Range mode has no count cap and cannot be combined with `--limit`. Go module versions are accepted with or without the leading `v`. > > **--to** `string` > > Inclusive end of a version range, or an upper version cap for latest mode when used alone. Defaults to latest when `--from` is set. Do not repeat a bound already supplied in the positional target. > > **--limit** `number` > > Maximum latest-mode or upper-cap entries (1–50, default 10). Rejected with an exact version, a lower range bound, or `--from`. > > **--changes** `string` (default: all) > > Filter statements to `actionable`, `important` (actionable plus "should know"), or `all`. Includes uncertain classifications in the selected tiers. Ignored with `--verbatim` or `--no-body`. > > **--verbatim** `flag` > > Show complete original notes instead of parsed statements. Use `--verbatim --json` for original Markdown bodies. Cannot be combined with `--no-body`. > > **-v, --verbose** `flag` > > Deprecated alias for `--verbatim`, in text and JSON. > > **--no-body** `flag` > > Return only the version/date/URL timeline; skip parsing and classification. Cannot be combined with `--verbatim` or `--verbose`. > > **--json** `flag` > > Output the result as JSON. > [accordion] npx githits\@latest pkg upgrade-review > > Compare package versions with security, changelog, and dependency changes. > > Review a package upgrade by comparing the current version with a target version. The command checks vulnerabilities, changelog entries in the version range, target deprecation metadata, peer dependency changes, dependency changes, and optional transitive dependency checks. > > ```bash theme={null} > npx githits@latest pkg upgrade-review :@.. > npx githits@latest pkg upgrade-review npm:zod@4.3.6..4.4.3 > npx githits@latest pkg upgrade-review npm:zod@4.3.6 --to 4.4.3 > npx githits@latest pkg upgrade-review --package npm:zod@4.3.6..4.4.3 --package npm:lint-staged@16.2.7..16.4.0 > ``` > > Use `..` as the range delimiter for the positional range and for repeatable `--package` entries. The legacy `->` delimiter is rejected with guidance to switch to `..`. A positional range already contains its target, so combining it with `--to` or `--package` is rejected. Go module versions are accepted with or without the leading `v`. > > Text output includes all matching release-note statements in release/source order, with available classifications, uncertainty markers, and changelog coverage. Batch output ranks packages by confident action count across the whole version range. Direct security summaries retain unknown vulnerability counts from 0.31.0. From 0.37.0, detailed reports and compact batch rows link to available migration guides, and JSON keeps them in `migrationGuides`. The classifications are evidence, not a safety verdict. See [Package Intelligence](/tools/package-inspection) for the JSON fields. > > **Flags** > > **--to** `string` > > Target version for single-package mode. Cannot be combined with a positional `..` range. > > **--package** `string` > > Batch package spec in `:@..` format. Repeat the flag for multiple packages, up to 30 per batch. > > **--no-transitive-security** `flag` > > Skip the transitive vulnerability summary diff. > > **--dependency-issues** `flag` > > Include deprecated, outdated, duplicate, and conflict summary diffs. > > **--min-severity** `string` > > Minimum direct-advisory severity: `low`, `medium`, `high`, or `critical`. > > **--changes** `string` > > Filter detailed changelog statements to `actionable`, `important` (actionable plus "should know"), or `all`. Omit for the default focused view, which includes actionable, "should know", and too-long-to-classify statements. Do not pass `focused` explicitly. Batch triage and coverage still include the whole version range. > > **-v, --verbose** `flag` > > Show full per-package batch reports, expand statement quotes, and include dependency change examples in text output. > > **--json** `flag` > > Output the result as JSON. > > See [Package Intelligence](/tools/package-inspection) for the full parameter reference. *** ### Target resolution `resolve` is available by default from 0.27.0. See [Target resolution](/tools/target-resolution) for MCP parameters and guidance on choosing a result. > [accordion] npx githits\@latest resolve > > Rank canonical package, repository, or documentation-site targets for a fuzzy name. > > Resolve a fuzzy, misspelled, or ambiguous name to grouped canonical targets such as `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. > > From 0.33.0, mutable Launchpad defaults such as `lp:project` can resolve to their current canonical repository. Complete owner-qualified Launchpad targets go directly to the next command. See [Launchpad targets](/tools/code-navigation#launchpad-git-targets). > > ```bash theme={null} > npx githits@latest resolve > npx githits@latest resolve express > npx githits@latest resolve codex --prefer-kind repository > npx githits@latest resolve "example sdk docs" --prefer-kind site > npx githits@latest resolve guava --registry maven --limit 3 > ``` > > Use the best match directly only when it is non-ambiguous, has `EXACT` or `HIGH` confidence, and its latest-version malicious-content status is `clear` or `not_applicable`. For `MEDIUM`, `LOW`, or ambiguous results, narrow the input or explicitly choose a candidate. > > Affected or uncertain malicious-content decisions render a warning that links the relevant `MAL-*` advisories on OSV and suppress the automatic next-command suggestion. See [malicious-content gating](/tools/target-resolution#malicious-content-gating) for the status meanings. > > **Flags** > > **--registry** `string` > > Comma-separated list of package registries. Constrains package candidates only; repository and site candidates remain eligible. > > **--prefer-kind** `string` > > `package`, `repository`, or `site`. Soft preference, not a filter. > > **-q, --query** `string` > > Ranking context. Ranks retrieved candidates and does not expand candidate retrieval. Must not contain credentials, personal data, private code, or proprietary content. > > **--intent-hint** `string` > > Repeatable ranking hint. Same semantics and content restrictions as `--query`. > > **-n, --limit** `number` (default: 8) > > Direct ranked list size, 1–20. Protected exact-name and related targets may appear in addition to the ranked list. > > **-v, --verbose** `flag` > > Include coarse lexical name similarity in text output. This is not a reranking score. JSON includes available numeric similarity without this flag. > > **--json** `flag` > > Emit the stable compact envelope `{best?, ambiguous, ambiguousReason?, candidates, protectedMatches}`. `best` is absent whenever there are no candidates. > > Exit code is `1` when there are no candidates because the command did not resolve a target. *** ## Agentic > [accordion] npx githits\@latest example > > Find implementation examples from real open-source usage. > > Search for implementation examples from open-source repositories, issues, discussions, and pull requests using a natural-language query. > > ```bash theme={null} > npx githits@latest example "" > ``` > > **Flags** > > **-l, --lang** `string` > > Optional programming language. Omit it to let GitHits infer the language from your query. If GitHits cannot match it, retry with a suggested language from the error, or omit `--lang`. > > **--license** `string` (default: strict) > > Control license filtering for implementation 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`. > > ```bash Basic example search theme={null} > npx githits@latest example "connect to postgres with connection pooling" > ``` > > ```bash Specify a language theme={null} > npx githits@latest example "parse JWT" --lang python > ``` > > ```bash Include all licenses theme={null} > npx githits@latest example "retry with backoff" --license yolo > ``` > > ```bash With explanation theme={null} > npx githits@latest example "JWT verification in Go" --explain > ``` > [accordion] npx githits\@latest research > > Answer a question about a public package or repository with cited sources. > > Research one public package or repository. Ask the question directly; sources are always included. Pass a quoted question alone to let GitHits identify the target, or precede it with an explicit package or repository target. Do not use `site:` targets; Research covers both code and documentation. Available by default from 0.31.0, with no experimental opt-in. > > ```bash theme={null} > npx githits@latest research "How does Express handle middleware errors?" > npx githits@latest research npm:express "How are async middleware errors handled?" > npx githits@latest research --thread '' "Which source files implement that?" > ``` > > Replace `` with the UUID returned by an earlier answer. Do not combine an explicit target with `--thread`. If GitHits returns target candidates, repeat the question with a selected canonical target. A clarification exits successfully and has no answer or thread ID. > > The CLI prints the answer with cited sources and follow-up guidance. Use the returned thread ID to continue the conversation. By default, source citations are copyable `npx githits@latest read` commands. > > **Flags** > > **--thread** `string` > > Continue an existing research thread using its returned UUID. > > **--source-format** `string` (default: cli) > > Source citations inside the returned Markdown as executable `read` commands (`cli`) or upstream links (`url`). > > **--json** `flag` > > Return `display_markdown` containing the answer or target clarification, plus optional `tool_call_id` (run ID) and `thread_id` (for follow-ups). Target clarifications omit both IDs. > > From 0.35.0, `research` and `example` show live stages in interactive terminals without changing JSON or piped output. See [Research](/tools/research) for progress, thread, rate-limit, and MCP behavior. # GitHits CLI configuration: config.toml reference Source: https://docs.githits.com/cli/configuration Reference for GitHits config.toml: file locations, OAuth storage, and automatic skill refresh. The GitHits CLI reads a TOML configuration file at startup. The config file is optional — the CLI works without it, using sensible defaults. You only need to create it when you want to change a setting, such as switching from keychain to file-based OAuth storage. ## Config file location | Platform | Path | | - | - | | macOS / Linux | `~/.config/githits/config.toml` | | macOS / Linux (XDG override) | `$XDG_CONFIG_HOME/githits/config.toml` | | Windows | `%APPDATA%\githits\config.toml` | The config directory may be empty on a fresh install. GitHits writes auth metadata to that directory automatically, but it does not create `config.toml` for you. Create the file yourself if you need to override any defaults. > [!NOTE] > > On older macOS installs, GitHits may have stored auth data in `~/Library/Application Support/githits`. The CLI still reads that location for migration, but all new auth config and file storage now uses `~/.config/githits`. *** ## The \[auth] section The `[auth]` section controls how OAuth credentials are stored on disk. ```toml ~/.config/githits/config.toml theme={null} [auth] storage = "keychain" ``` ### storage **storage** `string` (default: keychain) Controls the OAuth credential storage backend. Accepted values: * `"keychain"` — stores credentials in the system keychain (macOS Keychain Access, Windows Credential Manager, Linux Secret Service). This is the default and the most secure option. * `"file"` — stores credentials as JSON files in the GitHits config directory. The files are written with private permissions where the platform supports it, but they are not encrypted. *** ## Keychain storage (default) With `storage = "keychain"`, GitHits reads and writes OAuth credentials through the operating system's credential manager. This means: * On **macOS**, credentials are stored in Keychain Access. The first access may show a system prompt — choose **Always Allow** to prevent repeated prompts. * On **Windows**, credentials are stored in Credential Manager. * On **Linux**, credentials are stored in the available Secret Service or keyring backend. GitHits also writes a small non-secret metadata file to the config directory so that routine startup checks do not need to hit the keychain on every run. The keychain is only read when GitHits actually needs the token — for example during a tool call, a token refresh, `npx githits@latest auth status`, or a login check after metadata is stale or expired. *** ## File storage With `storage = "file"`, GitHits stores OAuth credentials as JSON files in the config directory instead of the system keychain. This is useful when: * You are connecting over SSH and don't have access to a graphical keychain prompt. * You are running in a CI or headless environment where no keychain is available. * The system keychain keeps showing prompts even after granting access. To switch to file storage, create or edit `config.toml`: ```toml ~/.config/githits/config.toml theme={null} [auth] storage = "file" ``` Then re-authenticate to write credentials in file mode: ```bash theme={null} npx githits@latest login --force ``` You can also switch for a single login without editing the config file: ```bash theme={null} GITHITS_AUTH_STORAGE=file npx githits@latest login --force ``` > [!WARNING] > > File storage is not encrypted. Any process running as your OS user can read the stored tokens. For CI and automation pipelines, use `GITHITS_API_TOKEN` instead of file-based OAuth credentials. *** ## The \[experimental] section From 0.31.0, `[experimental] tools` no longer controls any CLI commands or MCP tools. You can remove this legacy setting. [`research`](/tools/research) is available by default even when the setting is absent or `false`. [`resolve_target`](/tools/target-resolution) and `githits resolve` are available by default from 0.27.0. [`code_diff`](/tools/code-navigation#code-diff) and `githits code diff` are available by default from 0.26.0. Neither requires this setting. *** ## The \[skills] section From CLI 0.26.0, local MCP startup refreshes older, unchanged GitHits-managed `githits-mcp` skills in user roots and project roots under its startup directory. It does not install missing skills or replace edited, unrecognized, or newer content. Hosted MCP does not refresh local files. Disable refresh with: ```toml theme={null} [skills] auto_update = false ``` `auto_update` defaults to `true` and must be a boolean. A non-empty [`GITHITS_DISABLE_SKILL_UPDATE`](/cli/environment-variables#githits_disable_skill_update) also disables refresh. Invalid settings skip refresh with a warning; MCP startup continues. Explicit `githits init` still installs and repairs skills. ## Checking your current configuration Run `npx githits@latest auth status` to see which storage backend is active and where credentials are stored: ```bash theme={null} npx githits@latest auth status ``` The output includes the storage location so you can confirm whether keychain or file mode is in effect. # GitHits CLI environment variable reference Source: https://docs.githits.com/cli/environment-variables GitHits CLI environment variables for authentication, request grouping, storage, profiling, and output. The GitHits CLI reads several environment variables at startup. You can use them to authenticate without a browser, switch credential storage modes, or suppress update notifications. | Variable | Purpose | Default | | - | - | - | | `GITHITS_API_TOKEN` | API token for authentication (format: `ghi-...`) | — | | `GITHITS_AUTH_STORAGE` | Override OAuth storage mode: `keychain` or `file` | `keychain` | | `GITHITS_SESSION_ID` | Explicit request-grouping identifier, 1–64 ASCII letters, digits, `_`, or `-` | Automatically detected and hashed | | `GITHITS_TELEMETRY` | Emit end-of-run timing spans to stderr when set to `1`, `true`, `yes`, or `on` | — | | `GITHITS_DISABLE_UPDATE_CHECK` | Disable npm latest-version update notices | — | | `GITHITS_DISABLE_SKILL_UPDATE` | Disable automatic refresh of installed MCP guidance | — | | `NO_COLOR` | Disable ANSI color output when present, including an empty value | — | *** ## GITHITS\_API\_TOKEN Set an API token to authenticate without browser OAuth. This is the recommended approach for CI pipelines, automation scripts, and headless environments where a browser login isn't practical. Tokens follow the format `ghi-...` and can be generated from your [GitHits account settings](https://githits.com). When `GITHITS_API_TOKEN` is set, the CLI skips local OAuth storage entirely. You can verify this with `npx githits@latest auth status`, which reports the credential source. ```bash Shell export theme={null} export GITHITS_API_TOKEN=ghi-your-token-here npx githits@latest auth status ``` ```bash Inline (single command) theme={null} GITHITS_API_TOKEN=ghi-your-token-here npx githits@latest auth status ``` ```yaml GitHub Actions theme={null} - name: Run GitHits env: GITHITS_API_TOKEN: ${{ secrets.GITHITS_API_TOKEN }} run: npx githits@latest example "retry with exponential backoff" ``` > [!NOTE] > > `GITHITS_API_TOKEN` takes precedence over stored OAuth credentials. If both are present, the environment variable is used. *** ## GITHITS\_AUTH\_STORAGE Override the OAuth credential storage mode for a single process or for all GitHits commands in the current shell session. * `keychain` (default) — stores OAuth credentials in the system keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service). * `file` — stores OAuth credentials as JSON files in the GitHits config directory. Use `file` mode in SSH sessions, CI environments, or when persistent keychain prompts remain even after granting access. ```bash Login with file storage (one-off) theme={null} GITHITS_AUTH_STORAGE=file npx githits@latest login --force ``` ```bash Set for the current shell session theme={null} export GITHITS_AUTH_STORAGE=file npx githits@latest login ``` > [!WARNING] > > File storage is not encrypted. Any process running as your OS user can read the stored tokens. For CI and automation, use `GITHITS_API_TOKEN` instead. ## GITHITS\_SESSION\_ID Since `githits` and `@githits/mcp` 0.25.1, set `GITHITS_SESSION_ID` to group requests from a CLI or local MCP run under an explicit identifier. Set it before starting the process. The value is sent unchanged in `x-githits-session-id` and takes precedence over automatic terminal detection. Use 1–64 ASCII letters, digits, underscores, or hyphens (`[A-Za-z0-9_-]{1,64}`). GitHits does not trim or hash an explicit value. Empty values, whitespace, Unicode, slashes, and longer values are invalid; errors do not echo the supplied value. Unset the variable to restore automatic detection, which hashes a terminal identifier, parent process ID, or fallback UUID. ```bash theme={null} GITHITS_SESSION_ID=ci_run-42_agent-a npx githits@latest search "routing" --in npm:express ``` Choose an opaque identifier without credentials or personal data because it is transmitted as supplied. This value groups requests; it does not authenticate them or replace a Research `thread_id`. For local MCP, set it in the server process environment. A client-side environment variable does not configure the hosted MCP service. ## GITHITS\_DISABLE\_SKILL\_UPDATE Set any non-empty value to disable automatic refresh of installed `githits-mcp` skills when the local CLI MCP server starts. Available from 0.26.0. See [skill refresh configuration](/cli/configuration#the-skills-section). ```bash theme={null} GITHITS_DISABLE_SKILL_UPDATE=1 npx githits@latest mcp start ``` ## GITHITS\_TELEMETRY Set `GITHITS_TELEMETRY` to `1`, `true`, `yes`, or `on` to emit end-of-run timing spans to stderr. Matching is case-insensitive and ignores surrounding whitespace. Other values leave profiling disabled. The output goes to stderr only and does not affect stdout. ```bash theme={null} GITHITS_TELEMETRY=1 npx githits@latest example "connect to redis" ``` *** ## GITHITS\_DISABLE\_UPDATE\_CHECK When set to any non-empty value, suppresses the npm latest-version check and update notice that the CLI prints when a newer version is available. Useful in CI environments where the notice would pollute log output. ```bash theme={null} export GITHITS_DISABLE_UPDATE_CHECK=1 ``` *** ## NO\_COLOR Set the standard `NO_COLOR` variable to disable ANSI color output. Any present value disables color, including an empty value. ```bash theme={null} NO_COLOR=1 npx githits@latest pkg upgrade-review npm:zod@4.3.6 --to 4.4.3 ``` For one CLI invocation, you can also pass the global `--no-color` option. # Use GitHits in agentic coding workflows Source: https://docs.githits.com/guides/agentic-workflow Prompts for planning, implementation, debugging, review, and maintenance. Name the package, API, or behavior in your prompt. Your agent can read dependency versions from the project's lockfile. ## Planning and research ### Inspect a dependency ```text theme={null} Use GitHits to inspect at our installed version. Read the relevant API documentation and source before proposing a plan. ``` ### Evaluate a package ```text theme={null} Use GitHits Package Intelligence to check 's license, vulnerabilities, dependencies, and release history before recommending it. ``` ### Find an implementation pattern ```text theme={null} Use GitHits get_example to find how other projects implement . Compare the approaches and check their APIs against our dependency versions. ``` ## Implementation and debugging ```text theme={null} Use GitHits Code to find in at our installed version. Read the implementation and explain the behavior before changing our code. ``` ## Code review ```text theme={null} Use GitHits to check the APIs and dependency behavior this change relies on. Cite the source and flag any assumptions you cannot verify. ``` ## Maintenance and modernization ```text theme={null} Use GitHits Package Intelligence to compare with . Check advisories, release notes, and dependency changes, then inspect affected APIs and propose migration steps. ``` # Authenticate GitHits in CI and headless environments Source: https://docs.githits.com/guides/headless-ci Authenticate GitHits in CI pipelines, SSH sessions, and containers with an API token, tunneled OAuth, or file storage. CI environments, SSH sessions, and containers may not be able to open a browser for OAuth. Use an API token for automation. For an interactive SSH session, print the sign-in URL and forward the local callback port from the browser machine. ## Option 1: API token (recommended for CI) An API token lets you authenticate without any browser interaction. The token is read from an environment variable, so you can inject it as a CI secret without modifying your code or config files. **1. Get your API token** Open [your token settings](https://app.githits.com/settings/tokens) to create an API token. Copy your API token — it starts with `ghi-`. **2. Set the environment variable** Export the token in your shell or add it to your CI configuration as a secret: ```bash theme={null} export GITHITS_API_TOKEN=ghi-your-token-here ``` **3. Verify authentication** Confirm that GitHits picks up the token: ```bash theme={null} npx githits@latest auth status ``` The output should show you as authenticated and indicate that credentials are sourced from the environment variable. ### GitHub Actions example Add your API token as a repository secret named `GITHITS_API_TOKEN`, then reference it in your workflow: ```yaml theme={null} jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Run GitHits env: GITHITS_API_TOKEN: ${{ secrets.GITHITS_API_TOKEN }} run: | npx githits@latest auth status ``` The same pattern works for GitLab CI (`variables:`), CircleCI (project environment variables), and any other CI system that supports injecting secrets as environment variables. ### Group requests by run With CLI 0.25.1 or later, set [`GITHITS_SESSION_ID`](/cli/environment-variables#githits_session_id) before starting commands to group requests from one CI or agent run. Use an opaque value of 1–64 ASCII letters, digits, underscores, or hyphens, such as `ci_run-42_agent-a`. Keep the value consistent for related commands and choose a new value for a separate run. GitHits sends explicit values unchanged; leave it unset for automatic detection. ## Option 2: OAuth over an SSH tunnel If the CLI runs on a remote host but your browser runs locally, choose a fixed callback port on the remote host: ```bash Remote host theme={null} npx githits@latest login --no-browser --port 8765 ``` From the browser machine, forward the same port to the remote loopback listener: ```bash Browser machine theme={null} ssh -N -L 8765:127.0.0.1:8765 user@remote-host ``` Keep the tunnel open, then open the sign-in URL printed by the remote CLI. Replace `user@remote-host` with your SSH destination. ## Option 3: File storage OAuth (scripted environments) If you need OAuth credentials persisted for a scripted environment that runs repeatedly, you can store them in a file instead of the system keychain: ```bash theme={null} GITHITS_AUTH_STORAGE=file npx githits@latest login --force ``` Subsequent runs in that environment read credentials from the file without any browser or keychain interaction. > [!WARNING] > > File storage is **not encrypted**. The OAuth credentials are written as plain JSON files under your GitHits config directory. Any process that can read files as your OS user can read the tokens. For CI and automation, prefer `GITHITS_API_TOKEN` — it is easier to rotate and does not leave unencrypted credential files on disk. You can also set file storage permanently in your config: ```toml theme={null} # macOS/Linux: ~/.config/githits/config.toml # Windows: %APPDATA%\githits\config.toml [auth] storage = "file" ``` ## Choosing the right approach | Scenario | Recommended approach | | - | - | | GitHub Actions, GitLab CI, CircleCI | `GITHITS_API_TOKEN` secret | | SSH session with local browser available | `login --no-browser --port ` plus an SSH tunnel | | Long-running container, no browser | `GITHITS_API_TOKEN` | | Local scripted workflow, trusted machine | File storage OAuth | # Trigger GitHits manually Source: https://docs.githits.com/guides/trigger-githits Prompt your agent to use GitHits when it does not call the tools on its own. ## Prompt patterns ### Debug a dependency issue ```text theme={null} Use GitHits Code to inspect version that we have in use. Search for , then read the relevant source lines and debug the issue. ``` ### Read package documentation ```text theme={null} Use GitHits docs tools for and find the documentation page about . Summarize the relevant section before implementing. ``` ### Review a package or upgrade ```text theme={null} Use GitHits Package Intelligence for . Check vulnerabilities, dependencies, and relevant changelog entries for the version change in this repo. ``` ### Find a real implementation pattern ```text theme={null} Use GitHits get_example to find prior art and real implementation patterns for . Compare the sources, adapt the pattern to this repo, and cite what you used. ``` ## Agent instruction snippet Add to your project instructions: ```text theme={null} Use GitHits to verify dependency behavior. Use Code for source at the relevant version, Documentation for package docs, and Package Intelligence for metadata, vulnerabilities, dependencies, and release changes. Use get_example for implementation patterns, then check the APIs against our dependency versions. ``` # Troubleshooting GitHits: auth, MCP, and startup issues Source: https://docs.githits.com/guides/troubleshooting Fix common GitHits problems: keychain prompts, expired tokens, MCP server not loading, Node.js version errors, and slow npx startup. If something is not working as expected, start with `npx githits@latest auth status` to confirm you are authenticated and the CLI is reachable. The issues below cover the most common problems and how to resolve them. > [accordion] Commands or tools fail after upgrading > > Check the version with `npx githits@latest --version`, then update scripts for the current command contracts: > > * **Inventory tools:** MCP 0.24.0 replaces `code_files` and `docs_list` with [`list`](/tools/code-navigation#list). CLI `list` has different flags and JSON output from legacy `code files` and `docs list`, which remain available. > * **Grep tools:** MCP 0.25.0 replaces `code_grep` with [`grep`](/tools/code-navigation#grep). Pass ordered `targets` objects and migrate the options. The new defaults are regex, case-sensitive, and zero context; use `pattern_type: "literal"` and `ignore_case: true` for the old matching behavior. Legacy CLI `code grep` remains available. > * **Read options:** use top-level `read` for site paths, compact symbol targets, and `--selector`. The deprecated grouped readers retain their older flags. > * **Changelog targets:** replace `pkg changelog --repo-url` or `--git-ref` with a published package target. Those flags were removed in 0.21.0. > * **Search JSON:** replace the removed `summary`, `highlights.summary`, hit `contentSafety`, and `repositoryEvidence.focusedSource` fields with the [current result fields](/tools/code-navigation#search). > * **Research JSON:** from 0.24.0, read `display_markdown` and optional `tool_call_id` and `thread_id` instead of structured answer/source fields. See [Research output](/tools/research#output). > * **Changelog JSON:** from 0.30.0, default output contains parsed statements. Use CLI `--verbatim --json` or MCP `verbatim: true, format: "json"` for original bodies. Upgrade review JSON uses `changelog.statements` instead of `changelog.riskItems` and removes `riskCoverage.itemsOmitted`. > * **Research availability:** from 0.31.0, Research is stable. `[experimental] tools` no longer enables or disables it. Update the CLI and refresh local MCP discovery if it is missing. > > If a `list --after` cursor is rejected, restart the same listing without `--after` and use its new `nextCursor` unchanged. For `grep`, continue with its `cursor` and the same ordered targets and matching controls. Refresh MCP tool discovery after updating a local server. Hosted clients receive changes when the hosted service deploys the corresponding MCP version. > [accordion] Invalid GITHITS\_SESSION\_ID > > In 0.25.1 and later, an explicit session ID must match `[A-Za-z0-9_-]{1,64}` exactly. GitHits does not trim it. An empty value is invalid; unset the variable to restore automatic detection, or use a valid opaque identifier before restarting the CLI or local MCP process. The error omits the supplied value. See [session identifiers](/cli/environment-variables#githits_session_id). > [accordion] Package version or repository ref not found > > From CLI and MCP 0.31.0, `VERSION_NOT_FOUND` and `REF_NOT_FOUND` errors preserve available version/ref suggestions and return a retry action when one can be constructed. Follow the returned CLI command or MCP arguments instead of inventing a version or ref. Published package versions and indexed source snapshots are separate lists; a source lookup failure does not necessarily mean the release is unpublished. > > Text shows a concise selection of alternatives. Use CLI `--json` or MCP `format: "json"` when you need the complete returned lists. If no retry action is supplied, use the error's explanation to correct the target. > [accordion] Vulnerability report has unknown assessments > > From 0.31.0, `unknown` means GitHits could not evaluate whether an advisory affects the inspected version. Inspect the reasons with CLI `pkg vulns --scope unknown` or MCP `pkg_vulns` with `advisory_scope: "unknown"`. Add CLI `--transitive` or MCP `include_transitive: true` for the resolved dependency graph. > > Unknown and unsupported assessments do not establish that a package has no vulnerabilities. See [Package Intelligence](/tools/package-inspection) for scope and JSON details. > [accordion] Keychain prompts keep appearing on macOS > > macOS asks for permission when GitHits accesses the system keychain. When the prompt appears, click **Always Allow** to stop it from appearing again for this CLI binary. > > If prompts persist even after selecting **Always Allow** — for example, because your agent calls GitHits frequently and macOS keeps re-prompting — switch to file storage mode. Add the following to your config file, then run `npx githits@latest login --force` to re-store credentials: > > ```toml theme={null} > # ~/.config/githits/config.toml > [auth] > storage = "file" > ``` > > Or switch for a single session: > > ```bash theme={null} > GITHITS_AUTH_STORAGE=file npx githits@latest login --force > ``` > > Note that file storage is not encrypted. Use it only on machines where you trust local user-account access. > [accordion] Login token expired or refresh failed > > If the error code is `REAUTH_REQUIRED`, use the returned sign-in link and retry after signing in. See [sign-in required errors](/authentication#sign-in-required-errors). > > GitHits refreshes tokens automatically on next use. After an extended idle period, the refresh may fail and you will see an authentication error. > > Run `npx githits@latest login` again to re-authenticate: > > ```bash theme={null} > npx githits@latest login > ``` > > If you are in a headless environment, use: > > ```bash theme={null} > npx githits@latest login --no-browser --port 8765 > ``` > > The callback still listens on the remote machine. Forward the chosen port from the browser machine before opening the printed URL. See [CI and headless authentication](/guides/headless-ci#option-2-oauth-over-an-ssh-tunnel). > [accordion] Agent isn't calling GitHits tools > > First, confirm the GitHits MCP server is connected to your agent. In Claude Code, run `/mcp` and check that a GitHits entry appears in the list. In other tools, check your MCP server panel or equivalent. > > If GitHits is not listed: > > 1. Re-run `npx githits@latest init` to re-configure your tool: > > ```bash theme={null} > npx githits@latest init > ``` > > 2. If that does not detect your tool, check the MCP config file for your tool manually and verify the `githits` entry is present. > > 3. Verify you are authenticated: > > ```bash theme={null} > npx githits@latest auth status > ``` > > If GitHits is listed but the agent is not calling its tools, prompt it directly. See [Trigger GitHits manually](/guides/trigger-githits) for copy-paste prompt patterns. > [accordion] `npx githits@latest init` didn't detect my tool > > `npx githits@latest init` supports a fixed list of local coding tools. For any MCP-capable client that supports remote servers, configure GitHits manually by adding the remote MCP server entry to your client's config: > > ```json theme={null} > { > "mcpServers": { > "githits": { > "url": "https://mcp.githits.com" > } > } > } > ``` > > Check your client's documentation for the exact config file location and schema. See [Manual remote MCP setup](/installation/manual-setup) for a full walkthrough. > > If you would like your tool to be supported by `npx githits@latest init` auto-detection, [open a GitHub issue](https://github.com/githits-com/githits-cli/issues) to request it. > [accordion] Node.js version error > > GitHits requires Node.js `^20.18.1` or `>=22.13.0`. Check your current version: > > ```bash theme={null} > node --version > ``` > > If you are on an older version, upgrade using [nvm](https://github.com/nvm-sh/nvm): > > ```bash theme={null} > nvm install 24 > nvm use 24 > ``` > > Or download the latest LTS release from [nodejs.org](https://nodejs.org). > [accordion] MCP server is slow to start > > GitHits is normally started through `npx` so the MCP server uses the latest CLI. In an MCP config, use the explicit server command: > > ```json theme={null} > { > "mcpServers": { > "githits": { > "command": "npx", > "args": ["-y", "githits@latest", "mcp", "start"] > } > } > } > ``` > > If startup latency remains a problem, check whether your package manager or network is repeatedly downloading packages without cache reuse. > [accordion] Search returns no results > > If a search returns no results, the repository or package may not yet be indexed. Use `npx githits@latest search-status` to check indexing progress for a prior search, or run a new indexed search and follow up: > > ```bash theme={null} > npx githits@latest search "middleware errors" --in npm:express > npx githits@latest search-status > ``` > > Indexing time varies by repository. Follow any wait estimate or retry guidance in the response. If a completed search has no relevant results, try rephrasing the query or searching by a related package name. > > Keep polling `search-status` only while the status is `PENDING`, `INDEXING`, or `SEARCHING`. A `DEFERRED`, `TIMEOUT`, or `FAILED` status is terminal: the session will not advance, so use any results already returned and run a new search instead. See [Code](/tools/code-navigation) for the full session lifecycle. > [accordion] Auth status shows unauthenticated despite logging in > > If `npx githits@latest auth status` shows you as unauthenticated even though you have logged in, check the following: > > 1. **API token conflict**: If `GITHITS_API_TOKEN` is set in your environment, GitHits uses it instead of stored OAuth credentials. Check the credential source with `npx githits@latest auth status`; do not print the token value. > > 2. **Stale credentials**: Run `npx githits@latest login --force` to re-authenticate and overwrite any stale credentials: > > ```bash theme={null} > npx githits@latest login --force > ``` > > 3. **Wrong storage mode**: If you previously used file storage and later switched back to keychain, credentials may be missing from the keychain. Re-run `npx githits@latest login` to store them in the current mode. > > After re-authenticating, verify with: > > ```bash theme={null} > npx githits@latest auth status > ``` # GitHits documentation Source: https://docs.githits.com/index Choose MCP or the CLI for your agent, Scan (Alpha) for SBOMs, dependency audits, and license checks, or the REST API for deeper integration. Choose how you use GitHits: connect your agent through MCP, run commands in a shell, scan your repository, or integrate through the REST API. > [card] [Use MCP](/quickstart) > > Connect your coding agent or software factory to GitHits MCP tools. > [card] [Use the CLI](/cli/commands) > > Run GitHits commands in agent shells and software factory scripts. > [card] [Use Scan (Alpha)](/scan/overview) > > Install `githits-scan` separately to generate SBOMs, audit dependencies, and check licenses in your repository. > [card] [Use the REST API](/api/quickstart) > > Build deeper integrations with direct control over requests and response handling. ## Agent tools Through MCP, your agent can use the Deterministic and Agentic tools below. Beta: tool names, setup flows, and result formats may change as GitHits evolves. ### Deterministic > [card] [Code](/tools/code-navigation) > > Search indexed packages and repos, grep source, list files, and read exact lines. > [card] [Documentation](/tools/documentation-access) > > Search hosted and repo-backed package docs, then read targeted pages and line ranges. > [card] [Package Intelligence](/tools/package-inspection) > > Inspect package metadata, vulnerabilities, dependencies, changelogs, and upgrades. ### Agentic > [card] [Example](/tools/code-examples) > > Generate implementation examples from how other open-source projects solve a problem. > [card] [Research](/tools/research) > > Get answers about a package or repository with cited sources. # Automatic local MCP setup Source: https://docs.githits.com/installation/automatic-setup Use the GitHits hybrid CLI to automatically configure local MCP for supported AI coding tools. Use automatic local MCP setup when your coding tool is supported by the GitHits hybrid CLI. ```bash theme={null} npx githits@latest init ``` The CLI detects installed tools and writes the verified MCP configuration for each supported harness. Most tools use local stdio. Cursor uses the hosted remote MCP. Authentication is handled automatically for common local setup. ## Automatic install support `npx githits@latest init` supports automatic install for Claude Code, Cursor, Windsurf, Claude Desktop, Codex CLI, Pi, VS Code / Copilot, Cline, Gemini CLI, Google Antigravity, OpenCode, Hermes Agent, Zed, Junie, Qwen Code, Kiro, Kilo Code, Factory Droid, and Amazon Q CLI. Direct `githits init` installs a local stdio MCP server for every supported tool, with one exception: **Cursor is remote-only** even through direct init. Cursor entries use the hosted `https://mcp.githits.com` URL, and OAuth is completed inside Cursor. See [Manual remote MCP setup](/installation/manual-setup) for a full remote setup walkthrough. ## What gets configured For local stdio tools, GitHits adds a local MCP server entry that starts the CLI on demand: ```json theme={null} { "mcpServers": { "githits": { "command": "npx", "args": ["-y", "githits@latest", "mcp", "start"] } } } ``` Your agent can then call GitHits tools when it needs indexed source, package documentation, dependency metadata, vulnerability data, changelogs, or implementation examples. If it does not choose the tools on its own, use the prompts in [Trigger GitHits manually](/guides/trigger-githits). Plain MCP clients call [`quick_start`](/tools/quick-start) once per session to load shared routing and safety guidance. Guided setup installs the current `githits-mcp` skill with the stable guide already embedded, so agents that load the skill normally skip that call. ## Marketplace, plugin, and extension installs If you install GitHits through a host's plugin, extension, or marketplace surface instead of running `githits init`, you get the hosted remote MCP with host-managed OAuth. This applies to: * Claude Code plugin and the first-party Claude marketplace entry * Cursor plugin * Codex plugin * Gemini CLI extension * Google Antigravity plugin * Generic OpenPlugin and VS Code / GitHub Copilot OpenPlugin installs Every plugin and extension surface connects to `https://mcp.githits.com` through its host's native remote MCP field and delegates authentication to that host's OAuth flow. You do not need a separate GitHits login for these installs — sign in when the host prompts you. These connections do not install GitHits skills. Guided `npx githits@latest init` installs the four skills described below. Use a marketplace or plugin install when you want the host to manage MCP lifecycle and auth for you. Use `githits init` when you want a local stdio server for the tools that support it. ## Guided MCP setup (default) Interactive `githits init` defaults to the recommended **Install GitHits MCP + supporting instructions** path. In addition to the MCP server entry above, guided setup installs a small amount of supporting context so agents know when to reach for GitHits: * **GitHits skills** — the four packaged skills (`githits-onboarding`, `githits-mcp`, `githits-code`, and `githits-package`). The `githits-mcp` skill embeds the stable quick-start guide. The CLI-backed code and package skills provide a fallback when MCP tools are unavailable. They are copied only for the agents you select: tools that load shared Agent Skills use `~/.agents/skills/` at user scope or `.agents/skills/` at project scope, and tools with a native-only skill directory (for example `.claude/skills/`) use that directory. Rerunning guided setup repairs missing or stale skill files. * **Managed instruction block** — a single short paragraph inserted between `` markers in the appropriate instruction file for your tool (for example `AGENTS.md`, `CLAUDE.md`, or `GEMINI.md`). Reruns replace only the content between the markers, so it stays idempotent and easy to remove. ### Install review Before authentication or any config writes, interactive `githits init` prints a numbered review that lists the selected scope, tools, and guidance choice, then discloses what leaves your machine: * GitHits queries and public package, repository, and documentation targets are sent to GitHits services. * Installation itself does not upload the local workspace. * A new coding-agent session is needed to load the changed MCP configuration or supporting instructions. The terminal and machine do not need to be restarted. The step ends with a **Continue with GitHits setup?** confirmation. Declining or interrupting exits before authentication, config writes, guidance writes, or setup commands run. Interactive `--yes` prints the same review and treats it as acknowledgment without another prompt. Agent-assisted staged setup shows the review before asking which detected tools to configure. ### Opting out of guidance Both additions are opt-out. Use `--no-guidance` to install the plain MCP server only, or pick **Install plain GitHits MCP** at the interactive prompt: ```bash theme={null} npx githits@latest init --no-guidance ``` `--no-guidance` is preserved through the install and verification commands that guided setup generates for staged, non-interactive, and agent-assisted flows, so a plain-MCP run never re-offers or reinstalls guidance on rerun. To keep the guidance files when removing GitHits: ```bash theme={null} npx githits@latest uninstall --keep-guidance ``` If you prefer a skills-only setup with no MCP server, choose **Install Agent Skills instead** — see [Skills](/installation/skills). ## Want remote MCP instead? If you want to connect GitHits as a hosted remote MCP server, use [Manual remote MCP setup](/installation/manual-setup). Remote MCP works with any MCP-capable client that supports remote servers, not just coding agents. # Manual remote MCP setup Source: https://docs.githits.com/installation/manual-setup Configure the hosted GitHits MCP server in any MCP-capable client that supports remote servers. Use this guide when you want to connect GitHits to a remote MCP client. Remote MCP is not limited to coding agents: it works with any MCP-capable client that supports remote servers. GitHits remote MCP server URL: ```text theme={null} https://mcp.githits.com ``` For supported local tools, you can use [Automatic local MCP setup](/installation/automatic-setup) instead. > [!NOTE] > > Plain MCP clients call [`quick_start`](/tools/quick-start) once per session to load GitHits routing and safety guidance. Clients that already load the current `githits-mcp` skill normally skip the call because the skill embeds the stable guide. ## Generic remote MCP setup Use this generic flow when your MCP client supports remote servers but is not listed in the tool-specific examples below. **1. Locate your client's MCP configuration** Find the file or settings panel where your client accepts remote MCP server definitions. The exact name and location vary by client, so check your client's documentation for details. Common key names include `mcpServers`, `mcp`, or `servers`. **2. Add the GitHits MCP server entry** Add the remote GitHits MCP server URL to your client's MCP config. Many clients use this shape: ```json theme={null} { "mcpServers": { "githits": { "url": "https://mcp.githits.com" } } } ``` Some clients require an explicit HTTP type: ```json theme={null} { "mcpServers": { "githits": { "type": "http", "url": "https://mcp.githits.com" } } } ``` VS Code-style configs often use `servers` instead of `mcpServers`: ```json theme={null} { "servers": { "githits": { "type": "http", "url": "https://mcp.githits.com" } } } ``` > [!WARNING] > > Key names like `mcpServers`, `servers`, `url`, or `serverUrl` may differ in your client. Check your client's MCP documentation to confirm the exact schema before saving the config. **3. Verify the connection** Restart your client or reload its MCP server list. If your client supports MCP OAuth, complete the GitHits authorization prompt. Confirm that `githits` appears as a connected server, then ask it to inspect package context. A plain MCP client typically calls `quick_start` first, followed by a tool such as `search`, `read`, `list`, or `pkg_info`. ## Tool-specific remote setup Use these examples when you want to add the hosted GitHits MCP server directly to a coding harness. ### Codex CLI Run: ```bash theme={null} codex mcp add githits --url https://mcp.githits.com ``` If GitHits asks for OAuth authorization, run: ```bash theme={null} codex mcp login githits ``` Open Codex and run `/mcp` to confirm that `githits` is connected. ### Pi Install the MCP adapter package: ```bash theme={null} pi install npm:pi-mcp-adapter ``` Then add GitHits to `.mcp.json` for the current project, or `~/.config/mcp/mcp.json` for user-global setup: ```json theme={null} { "mcpServers": { "githits": { "url": "https://mcp.githits.com" } } } ``` Restart Pi after installing the adapter. Use `/mcp` inside Pi to inspect the server or complete authentication. ### Claude Code Run: ```bash theme={null} claude mcp add --transport http --scope user githits https://mcp.githits.com ``` If GitHits asks for OAuth authorization, run: ```bash theme={null} claude mcp login githits ``` You can also open Claude Code and run `/mcp` to complete authentication in the interactive MCP panel. ### Gemini CLI Run: ```bash theme={null} gemini mcp add --transport http --scope user githits https://mcp.githits.com ``` Gemini CLI stores MCP servers in `settings.json`. Use `/mcp` inside Gemini CLI to inspect the server after adding it. ### VS Code / GitHub Copilot Run: ```bash theme={null} code --add-mcp '{"name":"githits","type":"http","url":"https://mcp.githits.com"}' ``` You can also open the Command Palette and run **MCP: Add Server**, then choose an HTTP server and enter the GitHits URL. ### Cursor Cursor and Cursor CLI use the same MCP configuration. Add GitHits to `~/.cursor/mcp.json` for global use, or `.cursor/mcp.json` for the current project: ```json theme={null} { "mcpServers": { "githits": { "url": "https://mcp.githits.com" } } } ``` In Cursor CLI, run `agent mcp list` to verify that the server is available. ### OpenCode Run the interactive MCP wizard: ```bash theme={null} opencode mcp add ``` Choose a remote server and enter `https://mcp.githits.com`. You can also add GitHits to `opencode.json`: ```json theme={null} { "$schema": "https://opencode.ai/config.json", "mcp": { "githits": { "type": "remote", "url": "https://mcp.githits.com", "enabled": true } } } ``` ### Cline Run the interactive MCP wizard: ```bash theme={null} cline mcp ``` Choose **Add server**, select **Streamable HTTP**, and enter `https://mcp.githits.com`. You can also add GitHits to `~/.cline/mcp.json`: ```json theme={null} { "mcpServers": { "githits": { "type": "streamableHttp", "url": "https://mcp.githits.com", "disabled": false, "autoApprove": [] } } } ``` ### Windsurf / Devin Desktop Open **Settings** > **Tools** > **Windsurf Settings** > **Add Server**, or edit `~/.codeium/windsurf/mcp_config.json` directly: ```json theme={null} { "mcpServers": { "githits": { "serverUrl": "https://mcp.githits.com" } } } ``` Refresh the MCP server list after saving the config. ### Hermes Agent Add GitHits to `~/.hermes/config.yaml`, or to `$HERMES_HOME/config.yaml` if you use a custom Hermes home: ```yaml theme={null} mcp_servers: githits: url: "https://mcp.githits.com" auth: oauth ``` Restart Hermes after saving the config. Hermes opens the OAuth flow on first connect and stores MCP tokens under `~/.hermes/mcp-tokens/`. # GitHits CLI Skills setup Source: https://docs.githits.com/installation/skills Install GitHits Skills when you prefer a Skills workflow that calls the GitHits CLI instead of MCP tools. Guided `npx githits@latest init` installs four Skills alongside MCP by default: * `githits-onboarding` guides setup and sign-in. * `githits-mcp` routes public OSS research through MCP tools and embeds the stable quick-start guide. * `githits-code` uses equivalent CLI commands when MCP tools are unavailable. * `githits-package` uses package CLI commands when MCP tools are unavailable. Check that the CLI works in your agent's environment: ```bash theme={null} npx githits@latest auth status ``` For a Skills-only setup, choose **Install Agent Skills instead** during interactive `init`. You can also install the Skills directly: ```bash theme={null} npx skills add githits-com/githits-cli ``` Choose your agents and user or project scope during installation. Do not run the direct Skills installer on top of a guided `init` installation. Guided setup already installs and repairs the same four skill directories. ## Automatic refresh From CLI 0.26.0, local MCP startup [refreshes older, unchanged GitHits-managed `githits-mcp` skills](/cli/configuration#the-skills-section). It never installs missing skills. Hosted MCP does not refresh local files. Start a new agent session to load updated guidance. ## Relationship to MCP Skills prefer MCP tools when available and fall back to CLI commands. The `githits-mcp` skill includes the usage guide, so the agent normally skips [`quick_start`](/tools/quick-start). To switch from MCP to Skills: 1. Run `npx githits@latest uninstall --keep-guidance`, or disable the GitHits MCP server for that harness. 2. Confirm the GitHits CLI works with `npx githits@latest auth status`. 3. If you did not keep the packaged guidance, install the Skills with `npx skills add githits-com/githits-cli`. 4. Start a new harness session so it loads the updated instructions. # What is GitHits? Source: https://docs.githits.com/introduction Use MCP, the CLI, Scan (Alpha), or the REST API to work with open-source dependencies. Use GitHits to inspect the open-source dependencies behind your application: source code, APIs, documentation, package data, and release changes. ## Connect GitHits Use MCP or the CLI with your coding agent or software factory. Choose Scan (Alpha) for SBOMs, dependency audits, and license checks, or the REST API for deeper integration. Install Scan separately from the `githits` CLI and MCP server. | Interface | Setup | | - | - | | MCP | [Connect your agent](/quickstart) | | CLI | [Command reference](/cli/commands) | | Scan (Alpha) | [Generate SBOMs, audit dependencies, and check licenses](/scan/overview) | | REST API | [API quickstart](/api/quickstart) | ## Agent tools Through MCP, your agent can use the Deterministic and Agentic tools below. ### Deterministic | Tools | What agents can do | | - | - | | [Target resolution](/tools/target-resolution) | Find a package, repository, or documentation target from a dependency name | | [Code](/tools/code-navigation) | Search, grep, list files, and read source at a package version or repository ref | | [Documentation](/tools/documentation-access) | Search and read hosted documentation and repository docs | | [Package Intelligence](/tools/package-inspection) | Check metadata, licenses, vulnerabilities, dependencies, and upgrades | ### Agentic | Tool | What agents can do | | - | - | | [Example](/tools/code-examples) | Generate implementation examples from other open-source projects | | [Research](/tools/research) | Ask questions about a dependency and get answers with sources | # MCP quick start Source: https://docs.githits.com/quickstart Connect your coding agent or software factory to GitHits through MCP. **1. Check Node.js** GitHits requires Node.js `^20.18.1` or `>=22.13.0`. ```bash theme={null} node --version ``` Install or upgrade Node.js at [nodejs.org](https://nodejs.org). **2. Run setup** ```bash theme={null} npx githits@latest init ``` Select your coding tools and follow the setup prompts. Guided setup configures MCP, authentication, and supporting skills. See [supported tools](/installation/automatic-setup#automatic-install-support) or [manual remote setup](/installation/manual-setup). **3. Start a new agent session** Ask your agent to inspect a dependency: ```text theme={null} Use GitHits to inspect the package version used in this repo. Find the API or error involved, read the relevant source, and explain the behavior before editing code. ``` For other ways to use GitHits, see [CLI commands](/cli/commands), [Scan (Alpha)](/scan/overview), and the [API quickstart](/api/quickstart). Scan is a [separate install](/scan/installation) for generating SBOMs, auditing dependencies, and checking licenses in your repository. # Use Scan in CI Source: https://docs.githits.com/scan/ci Generate an SBOM and enforce license policy in GitHub Actions with a pinned githits-scan version and a secret token. Generate an SBOM in CI, then check its licenses against your policy. The workflow below checks the saved document, so license enforcement needs no second upload. Scan is **Alpha**. Pin a released version and review migration notes before upgrading. ## Prepare your repository Before adding the workflow: 1. [Review what Scan uploads](/scan/overview#review-what-you-upload). Upload commands send the full contents of selected package files without redacting them. 2. [Save a reviewed inventory](/scan/configuration#save-a-reviewed-inventory) in `githits-scan.toml` and commit it. 3. Enable a reviewed [`[licenses]` policy](/scan/configuration#license-policy) in that configuration. 4. Store an API token as the repository secret `GITHITS_API_TOKEN`. ## GitHub Actions Save this workflow as `.github/workflows/dependencies.yml`. It runs on pushes and manual dispatch, and installs version 0.3.0 from crates.io. ```yaml theme={null} name: Dependency checks on: [push, workflow_dispatch] permissions: contents: read jobs: sbom: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master with: toolchain: 1.99.1 - name: Install githits-scan run: cargo install githits-scan --version 0.3.0 --locked - name: Generate the SBOM (fails on inventory drift) env: GITHITS_API_TOKEN: ${{ secrets.GITHITS_API_TOKEN }} run: githits-scan sbom generate --output bom.cdx.json - name: Enforce the license policy on the same document run: githits-scan license check --sbom bom.cdx.json - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: sbom path: bom.cdx.json if-no-files-found: error ``` The generation step checks for [inventory drift](/scan/configuration#inventory-drift) before uploading. The license step reads `bom.cdx.json` offline and needs no token. GitHub Actions uploads the SBOM artifact after both steps succeed. Review reports before sharing them. They can contain private package names and paths. ## Add a dependency audit Run `githits-scan audit` in a separate step with `GITHITS_API_TOKEN` supplied from the same secret. An audit checks vulnerabilities, deprecated releases, outdated and duplicate versions, and manifest/lockfile disagreements. Any finding or incomplete check returns exit 1. The audit submits another analysis job. It does not read the SBOM generated above. ## Interpret failures | Exit | What to do | | - | - | | 0 | Continue. A license report is informational; use `license check` for enforcement. | | 1 | Review findings, incomplete audit checks, inventory drift, license violations, unresolved projects, or an empty selection. | | 2 | Fix the invocation, configuration, input, upload limits, token, or account access described in stderr. | | 3 | Investigate the network, I/O, rate limit, service, or protocol failure. Respect `Retry-After` when supplied before retrying. | Do not mask exit 1 with `|| true` when enforcing a check. If the inventory changes, review it before updating `githits-scan.toml`. Automatically running `detect --save` in CI would accept changes without that review. See the [exit code reference](/scan/commands#exit-codes) and [troubleshooting guide](/scan/troubleshooting) for details. ## Protect tokens and uploads Keep secrets out of untrusted fork jobs. Do not use `pull_request_target` to run untrusted code with a token. Keep shell tracing off and inject tokens into the steps that need them. Review [uploaded data](/scan/overview#review-what-you-upload) and [exclusions](/scan/configuration#exclusions-and-discovery) before enabling a workflow. Do not automatically resubmit failed jobs in a retry loop. Each new submission can consume quota again. The [HTTP API reference](/api/lockfile-analysis) describes upload limits, quota, and job results. # Scan command reference Source: https://docs.githits.com/scan/commands Find githits-scan commands, flags, output formats, offline replay inputs, and exit codes. Use `detect` to review your package files, then generate an SBOM, audit dependencies, or check licenses. This reference covers **Alpha** version 0.3.0. For help with a command, run `githits-scan --help`. For nested commands, use the full name, such as `githits-scan sbom generate --help` or `githits-scan license check --help`. ## Common options All five commands accept these output options: | Option | What it does | | - | - | | `-o, --output FILE` | Write the report to a file. Use `-` for stdout, which is the default. Existing report output files are overwritten. | | `-q, --quiet` | Suppress routine progress and success messages. Reports, findings, warnings, and errors remain. | | `--no-color` | Disable color. A nonempty `NO_COLOR` also disables it. Scan uses color when writing to a terminal. | Diagnostics go to stderr. Reports go to stdout or the output file. For discovery and online analysis, use these options to control [file selection](/scan/configuration): | Option | What it does | | - | - | | `PATH` | Scan this directory. Defaults to `.`. | | `--config FILE` | Read this configuration instead of `githits-scan.toml` in the scan root. Paths inside the configuration stay relative to the scan root. | | `--no-check` | Use the configured selection despite inventory drift. Does not widen the selection or disable audit findings or license policy. | | `--lockfiles-only` | Skip unconfigured projects that have a manifest without a lockfile. Keep associated manifests and eligible Cargo/npm workspace members. | | `--exclude GLOB` | Omit matching package files, including associated manifests and workspace member manifests. Repeat to add patterns. | Online analysis requires [`GITHITS_API_TOKEN`](/scan/installation#set-up-authentication). Review [what Scan uploads](/scan/overview#review-what-you-upload) before running it. The [HTTP API reference](/api/lockfile-analysis) describes upload limits, quota, and how to interpret results. ## Detect Preview the package files Scan would upload, without a token or network connection: ```bash theme={null} githits-scan detect githits-scan detect --json -o inventory.json ``` Scan reads the selected files locally and prepares the same selection as an upload, including eligible workspace members. The inventory distinguishes selected files from candidates that won't be uploaded. It lists skipped directory subtrees as patterns because their file counts are unknown. After reviewing the selection, save it to your configuration: ```bash theme={null} githits-scan detect --save ``` | Option | What it does | | - | - | | `--json` | Write inventory JSON (schema 2). `upload_paths` contains the exact selection prepared locally. | | `--save` | Record the reviewed inventory in the selected configuration. Create a commented template if needed, preserving existing comments, license policy, and excludes. Conflicts with `--no-check`. | If no package files are selected, Scan exits 1. If Scan cannot prepare an upload, JSON inventory is still available with null `upload_paths` and an `upload_error`. The command then exits 2 for usage errors or 3 for I/O errors. ## Generate an SBOM Generate a dependency inventory in the format you need: ```bash theme={null} githits-scan sbom generate -o bom.cdx.json githits-scan sbom generate --format spdx -o bom.spdx githits-scan sbom generate --format text -o bom.txt ``` Scan submits one analysis job and writes the complete document returned by GitHits. Use `--format` to choose the output: | Value | Document | | - | - | | `cyclonedx` (default) | CycloneDX 1.7 JSON | | `spdx` | SPDX 2.3 tag-value, not JSON | | `text` | Human-readable inventory report | ## Audit dependencies Check vulnerabilities, deprecated releases, outdated and duplicate versions, and manifest/lockfile disagreements: ```bash theme={null} githits-scan audit githits-scan audit --details githits-scan audit --json -o audit.json githits-scan audit --save-analysis analysis.json ``` Any finding or incomplete check returns exit 1. A clean audit covers the selected package files; it does not establish that an installed build is safe. Scan shows change suggestions when GitHits supplies them. It does not edit your dependencies. | Option | What it does | | - | - | | `--json` | Write compact findings and incomplete checks as JSON. | | `--details` | Include deprecated, outdated, and duplicate lists in human-readable output. | | `--save-analysis FILE` | Save analysis data to a **new** file for offline inspection. Conflicts with `--output` and `--from-analysis`. Does not accept `-`. | | `--from-analysis FILE` | Read a saved analysis offline. Conflicts with explicit `PATH`, `--config`, `--exclude`, `--lockfiles-only`, `--no-check`, and `--save-analysis`. Does not accept `-`. | | `--explain PACKAGE` | With `--from-analysis`, explain an exact vulnerable `registry:name@version` in the saved analysis. | JSON and saved analyses retain findings even when the human-readable output omits details. To inspect an analysis offline, save it with `--save-analysis`. Compact `audit --json` output cannot be used as a saved analysis. ## Report licenses Read license information without applying a policy: ```bash theme={null} githits-scan license report githits-scan license report --details githits-scan license report --json -o licenses.json ``` You don't need a license policy for this command. Exit 0 means Scan produced a report, even if license information is unknown or incomplete. Use `license check` to enforce a policy. | Option | What it does | | - | - | | `--json` | Write the complete experimental service report (schema 2). | | `--details` | Show source attribution, observations, and coverage gaps in human-readable output. | | `--from-report FILE` | Read saved report JSON offline. Accepts schemas 1 and 2; JSON output preserves the original bytes. Conflicts with explicit `PATH`, `--config`, `--no-check`, `--lockfiles-only`, and `--exclude`. Does not accept `-`. | The report separates reported licenses, publisher context, source observations, and coverage gaps. It does not give a policy verdict. ## Check license policy [Configure a license policy](/scan/configuration#license-policy), then check dependencies against it: ```bash theme={null} githits-scan license check githits-scan license check --sbom bom.cdx.json githits-scan license check --sbom bom.cdx.json --json ``` Without `--sbom`, Scan generates a CycloneDX JSON document online. With `--sbom`, it reads an existing document offline. Both forms require `[licenses]` in the selected configuration. Violations, missing or unrecognized licenses, and unresolved projects return exit 1. | Option | What it does | | - | - | | `--sbom FILE` | Read an existing CycloneDX JSON SBOM. Conflicts with `--no-check`, `--lockfiles-only`, and `--exclude`. | | `--json` | Write a policy verdict for automation. This output is not a license report or replay input. | | `--details` | Include violation component references and package URLs in human-readable output. | ## Offline replay Inspect a saved analysis, read a license report, or check an SBOM without contacting the API. These commands need no token: ```bash theme={null} githits-scan audit --from-analysis analysis.json githits-scan license report --from-report licenses.json githits-scan license check --sbom bom.cdx.json ``` Use the matching saved document for each command: | Saved document | Produce it with | Use it with | | - | - | - | | Audit analysis | `audit --save-analysis FILE` | `audit --from-analysis FILE` | | License report JSON | `license report --json -o FILE` | `license report --from-report FILE` | | CycloneDX JSON SBOM | `sbom generate -o FILE` | `license check --sbom FILE` (still needs policy) | Replay uses the saved information. It does not refresh data from GitHits. Compact audit JSON and policy verdict JSON are for automation and cannot be used as replay inputs. ## Exit codes | Exit | Meaning | | - | - | | 0 | Success. Checks have no findings; a license report is informational. | | 1 | Findings, incomplete audit, inventory drift, policy violations, unresolved license projects, or nothing selected. | | 2 | Invalid invocation, configuration, or input; upload limits; missing or rejected token; or account access requiring action. | | 3 | Network, I/O, rate limit, service, or protocol failure. | Use these distinctions to handle failures in [CI](/scan/ci). Read the diagnostic before rerunning an online command: it submits a new job and can consume quota again. # Configure Scan Source: https://docs.githits.com/scan/configuration Choose which package files Scan uploads, save a reviewed inventory, and set a license policy in githits-scan.toml. Record the projects you intend to scan and the licenses you allow in `githits-scan.toml`. Scan uses this file to check for inventory changes before uploading and to enforce your license policy. This repository configuration is separate from the [`githits` CLI configuration](/cli/configuration). ## Save a reviewed inventory Without configuration, Scan selects the lockfiles it discovers and projects that have a manifest without a lockfile. Start by previewing the selection locally: ```bash theme={null} githits-scan detect ``` Review the inventory and the [contents of the selected files](/scan/overview#review-what-you-upload). Then save the selection: ```bash theme={null} githits-scan detect --save git add githits-scan.toml ``` `--save` creates a commented configuration template or updates an existing file. It preserves comments, license policy, and exclusions. The example below selects two lockfiles and one project without a lockfile. Replace the paths with your own: ```toml githits-scan.toml theme={null} version = 1 [lockfiles] include = ["Cargo.lock", "web/package-lock.json"] exclude = ["examples/**"] manifests = ["services/legacy/package.json"] ``` | Key | Meaning | | - | - | | `version` | Configuration schema version; must be `1`. | | `lockfiles.include` | Exact lockfile paths in the reviewed inventory. | | `lockfiles.exclude` | Glob patterns for package files to omit. | | `lockfiles.manifests` | Exact manifest paths to scan, including projects without a lockfile. | | `licenses` | Optional license policy; required for `license check`. | Use forward slashes in paths. Paths stay relative to the scan root even if you keep the configuration elsewhere. Use `--config FILE` to select another file. Scan rejects unknown keys, unsupported versions, and a missing file supplied with `--config`. To create a new configuration at a chosen path, run `detect --config FILE --save`. ## Inventory drift When you have a saved configuration, Scan calls new or missing projects **inventory drift**. Commands return exit 1. Online analysis stops before submitting a request. Run `detect` to inspect the changes. If the new inventory is intended, run `detect --save` and review the configuration diff before committing it. To scan the configured selection despite drift, pass `--no-check`. This does not add newly discovered projects, disable audit findings, or bypass license policy. You cannot combine it with `detect --save`. ## Exclusions and discovery Scan honors Git ignore rules. It skips hidden entries, symbolic links, and installed-dependency directories such as `node_modules` and `vendor`. By default, Scan also skips directories named `fixtures`, `__fixtures__`, `testdata`, `test-data`, or `test_data`, ignoring ASCII case. Ordinary test, eval, and `truth` directories remain eligible. Review the inventory for your repository. ### Exclude package files Use repeated `--exclude` options to omit package files: ```bash theme={null} githits-scan detect --exclude 'examples/**' --exclude 'test/**' ``` These patterns also apply to associated manifests and workspace member manifests. A pattern ending in `/**` skips the matching directory subtree before Scan reads its contents. Unreadable directories that haven't been excluded stop discovery with exit 3. Selection follows these rules: * Explicit configuration entries can select projects from the default fixture exclusions and override configuration exclude patterns. They preserve any parent directories Scan needs to reach those files. * Command-line exclusions take precedence over configuration inclusions. * `detect --save` saves command-line exclude patterns. Existing inclusion overrides remain unless a command-line pattern excludes them. ### Scan projects without lockfiles Scan includes projects that have a manifest without a lockfile by default. GitHits resolves their declared dependency constraints, so the result can differ from an installed or previously locked build. Use `--lockfiles-only` to skip unconfigured projects without lockfiles. Scan still includes associated manifests and eligible declared Cargo/npm workspace members. Other nested manifests need explicit configuration. A manifest's location near a lockfile does not establish that the lockfile covers its dependencies. ## Supported package files Scan recognizes exact filenames, including case. Renaming a file does not convert its format. When a lockfile has an associated manifest, Scan includes that manifest if present. | Ecosystem | Lockfiles | Associated manifest or input without a lockfile | | - | - | - | | Rust | `Cargo.lock` | `Cargo.toml` | | JavaScript (npm, pnpm, Yarn, Bun) | `package-lock.json`, `npm-shrinkwrap.json`, `pnpm-lock.yaml`, `yarn.lock`, text `bun.lock` | `package.json` | | Python (uv, Poetry, PDM) | `uv.lock`, `poetry.lock`, `pdm.lock` | `pyproject.toml` | | Python (Pipenv) | `Pipfile.lock` | No paired manifest | | Swift | `Package.resolved` | `Package.swift` | | Gradle | `gradle.lockfile`, `buildscript-gradle.lockfile`, `settings-gradle.lockfile`, `gradle/dependency-locks/*.lockfile` | `build.gradle` or `build.gradle.kts` as an input without a lockfile or when explicitly configured | | .NET / NuGet | `packages.lock.json` | A single `.csproj` in its directory; multiple files make the lockfile ambiguous | | Dart / Flutter | `pubspec.lock` | `pubspec.yaml` | | PHP / Composer | `composer.lock` | `composer.json` | | Elixir / Mix | `mix.lock` | `mix.exs` | | Ruby / Bundler | `Gemfile.lock`, `gems.locked` | `Gemfile` pairs with `Gemfile.lock`, not `gems.locked` | | Erlang / Rebar3 | `rebar.lock` | `rebar.config` | | C/C++ / Conan | `conan.lock` | No paired manifest | | Go dep (legacy) | `Gopkg.lock` | No paired manifest | | Go modules | None | `go.mod` | | C/C++ / vcpkg | None | `vcpkg.json` | | Zig | None | `build.zig.zon` | Resolution and audit coverage vary by ecosystem. Check the results for incomplete information. Recognizing a file does not guarantee that GitHits can resolve all of its dependencies. | Unsupported input | Alternative or limitation | | - | - | | Python `requirements.txt`, `constraints.txt`, `setup.py`, `setup.cfg` | Use a supported lockfile or `pyproject.toml`. | | Deno `deno.lock`, Maven `pom.xml` | No native Deno or Maven input support. | | Binary Bun `bun.lockb` | Use text `bun.lock`. | | Go `go.sum`, `go.work` | Scan selects `go.mod`; these files are not uploaded. | | CocoaPods `Podfile.lock`, Nix `flake.lock`, NuGet `packages.config` / `project.assets.json` | Not supported by Scan. | For upload limits and result interpretation, see [lockfile analysis](/api/lockfile-analysis). ## License policy Use `license report` to read license information without a policy. To enforce a policy, first run `detect --save`, then enable or edit `[licenses]` in the generated configuration: ```toml theme={null} [licenses] allow = ["MIT", "Apache-2.0", "Apache-2.0 WITH LLVM-exception", "BSD-3-Clause", "ISC"] ``` Check the policy online or against a saved CycloneDX JSON document: ```bash theme={null} githits-scan license check githits-scan license check --sbom bom.cdx.json ``` Use explicit SPDX identifiers and `AND`/`OR`/`WITH` expressions. Scan does not guess license names or interpret slash-separated license text. Missing or unrecognized licenses, policy violations, and unresolved projects return exit 1. Scan excludes nodes marked as project roots or local sources from the check. It still checks their children. A local path alone does not establish first-party ownership. ### Package exceptions Add package exceptions with `[[licenses.exceptions]]` entries containing a versionless `purl` and a `reason`. An exception exempts the entire package from the allow list. Review that scope before adding one. Each applied exception's reason appears in the report. # Install Scan Source: https://docs.githits.com/scan/installation Install githits-scan with Homebrew on macOS or Linux, or use prebuilt binaries or Cargo. Set an API token and preview your package files. Install `githits-scan` to scan a repository from your terminal or CI. On macOS and Linux, use [Homebrew](#install-with-homebrew). On Windows, [download a prebuilt binary](#prebuilt-binaries) or [install with Cargo](#install-with-cargo). You can also use prebuilt binaries or Cargo on macOS and Linux. For CI, use a [pinned version](/scan/ci). Scan is **Alpha**. These pages cover version 0.3.0. ## Install with Homebrew On macOS or Linux, [install Homebrew](https://brew.sh) if you don't already have it, then run: ```bash theme={null} brew install githits-com/tap/githits-scan ``` Homebrew provides prebuilt packages for macOS 15 on Apple Silicon and Linux x86\_64/ARM64. If a prebuilt package isn't available for your system, including Intel Macs, Homebrew builds Scan from source and installs the required build dependencies. ## Prebuilt binaries 1. Download your archive and `SHA256SUMS` from the same [v0.3.0 GitHub release](https://github.com/githits-com/githits-scan/releases/tag/v0.3.0). 2. Check the archive's checksum using the commands below. 3. Extract the archive and put `githits-scan` (or `githits-scan.exe`) in a directory on `PATH`. | Operating system | Architecture | Archive | | - | - | - | | Linux | x86\_64 | [Download `.tar.gz`](https://github.com/githits-com/githits-scan/releases/download/v0.3.0/githits-scan-v0.3.0-x86_64-unknown-linux-gnu.tar.gz) | | Linux | ARM64 | [Download `.tar.gz`](https://github.com/githits-com/githits-scan/releases/download/v0.3.0/githits-scan-v0.3.0-aarch64-unknown-linux-gnu.tar.gz) | | macOS | Intel | [Download `.tar.gz`](https://github.com/githits-com/githits-scan/releases/download/v0.3.0/githits-scan-v0.3.0-x86_64-apple-darwin.tar.gz) | | macOS | Apple Silicon | [Download `.tar.gz`](https://github.com/githits-com/githits-scan/releases/download/v0.3.0/githits-scan-v0.3.0-aarch64-apple-darwin.tar.gz) | | Windows | x86\_64 | [Download `.zip`](https://github.com/githits-com/githits-scan/releases/download/v0.3.0/githits-scan-v0.3.0-x86_64-pc-windows-msvc.zip) | Run the checksum command in the directory containing both downloads: ```bash Linux theme={null} sha256sum --check --ignore-missing SHA256SUMS ``` ```bash macOS theme={null} shasum -a 256 --check --ignore-missing SHA256SUMS ``` ```powershell Windows theme={null} Get-FileHash -Algorithm SHA256 .\githits-scan-v0.3.0-x86_64-pc-windows-msvc.zip ``` On Linux and macOS, confirm that your archive is marked `OK`. On Windows, compare the hash with the matching archive entry in `SHA256SUMS`. Extract the archive after the checksum matches. The binaries are built on Ubuntu 24.04, macOS 15, and Windows Server 2025. Older systems are not tested. ## Install with Cargo You need Rust 1.99 or newer. Install the latest published version from [crates.io](https://crates.io/crates/githits-scan): ```bash theme={null} cargo install githits-scan --locked ``` For a reproducible installation, pin the version: ```bash theme={null} cargo install githits-scan --version 0.3.0 --locked ``` ## Check the installation After installing, run: ```bash theme={null} githits-scan --version ``` For the pinned 0.3.0 release, the expected output is `githits-scan 0.3.0`. From your repository root, preview the package files Scan would upload: ```bash theme={null} githits-scan detect ``` This step stays local and needs no token. Review the selection and the [upload privacy guidance](/scan/overview#review-what-you-upload) before running an online analysis. ## Set up authentication Sign in or create an account at [app.githits.com](https://app.githits.com). Create an API token in [Settings → Tokens](https://app.githits.com/settings/tokens), then set `GITHITS_API_TOKEN` in the shell that will run Scan. In **Bash**, read the token without putting it in shell history. Keep shell tracing (`set -x`) disabled: ```bash theme={null} printf 'GitHits API token: ' read -r -s GITHITS_API_TOKEN printf '\n' export GITHITS_API_TOKEN ``` Online commands read the token from `GITHITS_API_TOKEN`. Scan does not run credential commands or read the `githits` CLI's stored login. In CI, inject the variable from your secret store. See [API authentication](/api/authentication) for account and token guidance, and [Scan in CI](/scan/ci) for a workflow. Local `detect` and [offline replay](/scan/commands#offline-replay) need no token. Next, [generate an SBOM, audit dependencies, or report licenses](/scan/overview#start-with-a-local-preview). ## Uninstall For a Homebrew installation: ```bash theme={null} brew uninstall githits-scan ``` For a Cargo installation: ```bash theme={null} cargo uninstall githits-scan ``` For an extracted binary, remove the executable you put on `PATH`. Scan has no daemon or installed background service. Uninstalling leaves generated reports and repository configuration in place. Remove those separately if you no longer need them. Unset `GITHITS_API_TOKEN` in your shell or CI configuration, and revoke unused tokens in [token settings](https://app.githits.com/settings/tokens). # Scan your dependencies Source: https://docs.githits.com/scan/overview Generate an SBOM, audit dependencies, and check license policy from your repository with githits-scan. Use Scan to generate a software bill of materials (SBOM), audit dependencies, or enforce a license policy in CI. The `githits-scan` command finds lockfiles and manifests in your repository and sends them to GitHits for analysis. You can run Scan from a terminal or CI. Install it separately from the [`githits` CLI](/cli/commands) and MCP server. > [!WARNING] > > **Alpha.** These pages cover `githits-scan` 0.3.0. Commands and JSON can change before 1.0. Pin a released version in CI and review migration notes before upgrading. > > Scan uses the experimental lockfile-jobs API. The [v1 API contract](/api/versioning) is not finalized, and license report JSON uses experimental schema 2. ## Start with a local preview [Install Scan](/scan/installation), then run this command from the repository you want to scan: ```bash theme={null} githits-scan detect ``` `detect` shows which package files Scan would upload. It reads those files locally and makes no API request. You don't need a token for this step. Review the selection and the file contents before continuing. Then [set your API token](/scan/installation#set-up-authentication) and choose the report you need: | Task | Command | | - | - | | Generate an SBOM | `githits-scan sbom generate -o bom.cdx.json` | | Audit dependencies | `githits-scan audit` | | Read license information | `githits-scan license report` | | Enforce a license policy | `githits-scan license check` | The default SBOM format is CycloneDX 1.7 JSON. You can also choose SPDX 2.3 tag-value or a text inventory. An audit checks vulnerabilities, deprecated releases, outdated and duplicate versions, and manifest/lockfile disagreements. A license report is informational. To enforce a policy with `license check`, [configure the licenses you allow](/scan/configuration#license-policy) first. GitHits parses the uploaded files and resolves dependencies. Scan checks upload limits and writes the returned reports. Use the [command reference](/scan/commands) for output formats, flags, and exit codes. ## Review what you upload Upload commands send the **full contents** of selected lockfiles and manifests, with paths relative to the scan root. Package files can contain private package names, registry URLs, and other sensitive values. **Scan does not redact their contents.** Review both `detect` and the selected files before uploading. The `detect` preview prepares the same files as upload commands, including eligible Cargo and npm workspace member manifests. Scan does not upload source files outside its [supported package files](/scan/configuration#supported-package-files), Git history, or `githits-scan.toml`. It has no telemetry or analytics reporting. You can also work with saved reports without a token or network connection: `audit --from-analysis`, `license report --from-report`, and `license check --sbom`. Reports can reveal dependency names and paths. Review them before sharing. Read the [Privacy Policy](https://githits.com/privacy) and [Terms of Service](https://githits.com/legal/terms-of-service/) for how GitHits processes submitted data. ## Set up repeatable checks [Save a reviewed inventory](/scan/configuration#save-a-reviewed-inventory) to record which projects you intend to scan. Scan can then stop a CI run when that inventory changes. [The CI guide](/scan/ci) shows how to generate an SBOM and check its licenses with a pinned Scan version. For an integration that submits files and manages analysis jobs directly, use the [HTTP API](/api/lockfile-analysis). Its reference covers upload limits, quota rules, and how to interpret results. If a command fails, use the [troubleshooting guide](/scan/troubleshooting) to check its exit code and diagnostic message. # Troubleshoot Scan Source: https://docs.githits.com/scan/troubleshooting Resolve githits-scan authentication, file selection, upload, network, and saved-report errors. When a Scan command fails, check its message on stderr and its [exit code](/scan/commands#exit-codes). Run `githits-scan --version` to confirm which version you're using. This guide covers **Alpha** version 0.3.0. ## Authentication and account access | Symptom | What to do | | - | - | | Missing or rejected token (exit 2) | Set `GITHITS_API_TOKEN` in the process running Scan. Create or replace the token in [token settings](https://app.githits.com/settings/tokens). Scan does not read the `githits` CLI's stored login. Never paste the token into a report. | | Access denied or terms required (exit 2) | Sign in at [app.githits.com](https://app.githits.com) and follow the message's instructions for account access, feature access, or terms. Retrying cannot grant access. | ## File selection and uploads | Symptom | What to do | | - | - | | Inventory drift or nothing selected (exit 1) | Run `detect` and review the configuration, ignore rules, and scan root. Save an updated inventory after reviewing it. See [inventory drift](/scan/configuration#inventory-drift). | | Upload too large (exit 2) | Scan a smaller root or explicitly exclude unrelated projects. Workspace member manifests count toward the limits too. See [file selection](/scan/configuration#exclusions-and-discovery) and [upload limits](/api/lockfile-analysis#prepare-files). | | Unsupported file or `UNUSABLE_MANIFEST` (exit 2 for rejected input) | Check the [supported package files](/scan/configuration#supported-package-files), file contents, and paths named in the diagnostic. Scan does not convert formats. One unusable selected file rejects the whole upload. Exclude a file if you intend to leave it out of the analysis. | | Permission denied or unreadable file/output (usually exit 3) | Check that Scan can read the scan root and selected files and write to the output directory. A missing input or configuration exits 2 instead. Fix file access or selection rather than running Scan as administrator. | ## Network and service errors | Symptom | What to do | | - | - | | Proxy, TLS, timeout, or connection failure (exit 3) | Check connectivity and proxy settings. Proxies must allow authenticated HTTPS and streaming progress responses. Scan refuses redirects. Do not disable TLS checks. | | Rate limit or service failure (exit 3) | Keep the request ID and wait for `Retry-After` when supplied before retrying. Rerunning submits a new job and can consume quota again. Scan does not automatically retry submission or result requests. | Scan uses these timeouts: | Operation | Allowance | | - | - | | Establish a connection | 15 seconds | | Receive submission/result headers or read each part of the body | 210 seconds | | Read progress events | 60 seconds | An established progress stream can reconnect without resubmitting the analysis job. ## Saved reports and policy If an offline command rejects a saved file, check that you're using the [matching replay input](/scan/commands#offline-replay): | Command | Required input | | - | - | | `audit --from-analysis FILE` | An audit analysis saved with `--save-analysis` | | `license report --from-report FILE` | License report JSON saved with `license report --json` | | `license check --sbom FILE` | A CycloneDX JSON SBOM | Compact audit JSON and license policy verdicts are not replay inputs. Offline `license check` still needs a [`[licenses]` policy](/scan/configuration#license-policy). An informational `license report` can exit 0 with unknown licenses or incomplete information. That exit code means the report was produced; it does not mean a policy check passed. ## Report a problem Include the following in a [bug report](https://github.com/githits-com/githits-scan/issues): * Scan version and OS. * The command and exit code. * Stderr with credentials and sensitive values removed. Inventory and reports can reveal private paths and package names. Review attachments before sharing, and never include credentials. Report security concerns privately using [Scan's security policy](https://github.com/githits-com/githits-scan/security/policy). # Example Source: https://docs.githits.com/tools/code-examples Generate implementation examples from how open-source projects use libraries and APIs. Use the `get_example` MCP tool or the `example` CLI command: ```bash theme={null} npx githits@latest example "broadcast messages using python-socketio with Redis pub/sub" ``` Examples draw on projects across open source. The result includes generated code, source repository citations, and a `solution_id`. From 0.27.1, the CLI and MCP request source-reading follow-ups alongside citations. When the service returns them, your agent can use the CLI `read` commands or MCP `read` calls to inspect the source behind an example. > [!NOTE] > > Examples are not version-pinned. Check their APIs against your dependency version with [Code](/tools/code-navigation). ## Live progress In CLI 0.35.0 and later, `example` shows the current stage with an animated mark in interactive terminals. JSON and piped output are unchanged. From 0.34.0, local MCP forwards stages for `get_example` when the client sends a progress token; display depends on the client, and hosted MCP requires deployment support. Progress is best effort and does not change the final result. From 0.35.0, calls do not wait for the progress connection. Custom MCP hosts can configure the same [progress options as Research](/tools/research#live-progress). ## Parameters | MCP parameter | CLI flag | Description | | - | - | - | | `query` | Positional argument | Required description of the pattern or API usage | | `language` | `--lang` | Optional language; inferred from the query when omitted | | `license_mode` | `--license` | `strict` (default), `yolo` (unfiltered), or `custom` (your configured blocklist) | If the language is unrecognized, use a suggestion from the error or omit it. If example search returns `REAUTH_REQUIRED`, follow the [sign-in guidance](/authentication#sign-in-required-errors), then retry. For an explicit agent prompt, see [Find a real implementation pattern](/guides/trigger-githits#find-a-real-implementation-pattern). # Code: search, grep, files, and source Source: https://docs.githits.com/tools/code-navigation Search indexed code, grep matches, list files, and read exact source lines. The deterministic Code tools let your agent search indexed packages and repositories, grep source, list files, and read exact lines at a package version or repository ref. For generated implementation examples, use [Example](/tools/code-examples). GitHits indexes public repositories on demand. When a search needs indexing, follow the response's progress or retry guidance. If it includes a `searchRef` and an active status (`PENDING`, `INDEXING`, or `SEARCHING`), use `search_status` to follow that search. Some responses also include provisional hits you can use while indexing continues. **Supported languages for code indexing:** Bash, C#, C++, CSS, Dart, Elixir, Erlang, Go, Java, JavaScript, Kotlin, Lua, Markdown, PHP, Proto, Python, R, Ruby, Rust, Scala, SCSS, Swift, TypeScript, Zig, and more. ## Choose a target Use a package target for that package's source, a repository target for the whole repository, or an explicit `site:` target for hosted documentation. Pass a known target directly to the tool. Use [target resolution](/tools/target-resolution) when you only know a dependency's name. | Source | Target | Optional version or ref | | - | - | - | | Package | `npm:express`, `pypi:requests`, `crates:serde`, `pub:http` (from 0.38.0) | `npm:express@4.18.2` | | GitHub | `github:expressjs/express` | `github:expressjs/express@v4.18.2` | | Codeberg | `codeberg:owner/repo` | `codeberg:owner/repo@ref` | | GitLab.com | `gitlab:group/subgroup/project` | `gitlab:group/subgroup/project@ref` | | Launchpad Git | `lp:project` or an owner-qualified path below | `lp:project@ref` | | Googlesource | `https://go.googlesource.com/time` | `https://go.googlesource.com/time@v0.16.0` | | Hosted documentation | `site:expressjs.com` | Follow the returned page or section locator | Omit a package version for the latest release or a repository ref for its default branch. Repository refs can be branches, tags, or commits and may contain additional `@` characters. Use `@` to introduce a ref; `#` selects a symbol or documentation heading, not a revision. Preserve returned targets, paths, selectors, and line bounds when following a `read` action. From CLI and MCP 0.32.0, `cargo:` aliases public crates.io `crates:` targets. Canonical identities remain `crates`; the alias does not select alternate Cargo registries. ### Repository hosts GitLab and Codeberg targets are available from CLI and MCP 0.15.0; Launchpad Git targets from 0.33.0. Hosted MCP availability depends on the deployed package version. Full HTTPS repository URLs are also accepted on `github.com`, `codeberg.org`, `gitlab.com`, `code.launchpad.net`, `git.launchpad.net`, and public `*.googlesource.com` hosts. GitLab paths can contain nested subgroups. Use a repository root, not a file, tree, issue, or merge-request URL. Bare `owner/repo` names and other hosts, including self-hosted GitLab instances, are not supported. GitHub additionally accepts `github.com/owner/repo` and HTTP URLs. ### Launchpad Git targets Use `launchpad:` or its case-insensitive `lp:` alias with one of these paths. The owner, project, distribution, source, and repository names below are placeholders. | Repository | Target | | - | - | | Project default | `lp:project` | | Distribution-source default | `lp:distro/+source/source` | | Owner/project default | `lp:~owner/project` | | Owner/distribution-source default | `lp:~owner/distro/+source/source` | | Personal repository | `launchpad:~owner/+git/repo` | | Project repository | `launchpad:~owner/project/+git/repo` | | Distribution-source repository | `launchpad:~owner/distro/+source/source/+git/repo` | Append `@ref` to select a branch, tag, or commit. HTTPS URLs on both Launchpad hosts accept these paths. `git://git.launchpad.net` requires a complete owner-qualified path. Bazaar branches are unsupported. Default shortcuts can change their owner or repository. GitHits resolves them to canonical `launchpad:` identities; reuse the returned target and exact ref for follow-ups instead of guessing the owner. ```bash theme={null} npx githits@latest list lp:beautifulsoup npx githits@latest search func_file_conv --in lp:ubuntu/+source/hello --source code ``` ### Googlesource targets From CLI and MCP 0.38.0, `search`, `read`, `list`, `grep`, and `diff` accept public `*.googlesource.com` project URLs. Hosted MCP gets this support after deployment. Googlesource has no compact prefix, so use the full HTTPS project URL. Append `@ref` to select a branch, tag, or full or short commit SHA. * Use HTTPS only. GitHits rejects HTTP and other transports. * Omit ports, credentials, query strings, and fragments. GitHits rejects every explicit port, including `:443`. * Use the project root, not a Gitiles web route such as `/+/refs/heads/master`. * Project path case is preserved. Nested project paths are accepted. * GitHits removes one trailing `.git` and one trailing slash, so `https://go.googlesource.com/time.git/` and `https://go.googlesource.com/time` are the same target. ```bash theme={null} npx githits@latest list https://go.googlesource.com/time@v0.16.0 npx githits@latest search "func Every" --in https://go.googlesource.com/time --source code ``` For HTTP requests, see [API target inputs](/api/requests-and-responses#choose-a-target). ## Code tools > [accordion] search — unified code, docs, and symbol search > > `search` is the primary discovery tool. It searches across code, documentation, and explicit symbols in indexed packages and supported public repositories. Use it when you need to find where something is defined, which files handle a specific concern, or which docs page explains a behavior. > > Query syntax supports implicit AND, uppercase OR, grouping with parentheses, negation with `-`, quoted phrases, and semantic qualifiers: > > | Qualifier | Description | Example | > | - | - | - | > | `kind:` | Symbol kind | `kind:function` | > | `category:` | Symbol category | `category:callable` | > | `path:` | File path component | `path:src/auth` | > | `lang:` | Language | `lang:typescript` | > | `name:` | Symbol name | `name:createServer` | > | `intent:` | File intent | `intent:test` | > > Choose a [package, repository, or documentation target](#choose-a-target). In the CLI, pass targets with repeatable `--in` flags. In MCP, pass `target` for one target or `targets` for multiple targets. > > **CLI usage** > > ```bash theme={null} > npx githits@latest search "createServer" --in npm:express > npx githits@latest search "middleware error handling" --in npm:express@4.18.0 > npx githits@latest search "kind:function authentication" --in https://github.com/supabase/supabase > npx githits@latest search "pub sub Redis" --in pypi:python-socketio > ``` > > **Key parameters** > > **query** `string` *required* > > Discovery query string. Supports AND (implicit), OR (uppercase), parentheses, `-` negation, quoted phrases, and semantic qualifiers (`kind:`, `category:`, `path:`, `lang:`, `name:`, `intent:`). > > **target** `string` > > Single package, repository, or documentation target, such as `npm:react@18.2.0`, `gitlab:group/subgroup/project`, or `lp:beautifulsoup`. See [target syntax](#choose-a-target). > > **targets** `array` > > Multiple search targets. Use either `target` or `targets`, not both. > > **source** `string` > > Restrict results to `code`, `symbol`, or `docs`. Omit to let GitHits choose the best indexed sources. See [Documentation](/tools/documentation-access) for docs-focused search, listing, and reading workflows. > > **allow\_partial\_results** `boolean` (default: true) > > Returns available hits while other targets or sources prepare, plus a `searchRef` for continuation. From 0.27.0, defaults to `true`. Set `false` to wait for all runnable targets and sources before returning hits; a complete interim result may still be returned during a refresh. > > **limit** `number` > > Maximum results to return (default 10, max 100). > > **Provisional results** > > While a target is still indexing, `search` can return provisional repository-code results. Provisional hits come from an exact-commit snapshot and are immediately usable, but the session is not finished. The response marks the results as still indexing, reports the exact served identity and `PROVISIONAL` freshness instead of the ref you requested, and keeps the active `searchRef` so you can continue with `search_status`. > > **Text output** > > Since 0.27.1, `search` and `search_status` text starts with a plain outcome headline that counts returned results by kind, such as `Found 2 code results and 1 documentation result.` Empty responses say `No results found.`, `No results available yet.`, or `No results on this page.` for an empty continuation page. A `Sources:` section lists each searched source. Repository rows show the exact served commit and, when known, the UTC commit date and the ref it was indexed from, for example `github:owner/repo@aaaaaaaa (committed 2026-09-01, indexed from ref HEAD)`. A commit date is not an indexing time or a freshness claim. Since 0.36.0, an unconfirmed package-to-source match is noted inline; see [package source correspondence](#package-source-correspondence). Targets still indexing appear under `Preparing:` with their estimate. When the backend reports omitted results that nothing else explains, the text adds `These results do not cover the full request.` > > The hits follow, then up to three footers in a fixed order: > > * `Read:` shows one example `read` call for a returned hit, pinned to the served revision. > * `More results:` tells you to repeat the original search with the exact next offset. > * `Follow-up:` offers a conditional `search_status` wait, shown only when waiting could change the results. > > ```text theme={null} > Found 1 code result. > > Read: > Use these results now; example read: > read target="github:anomalyco/opencode@bbd72fb8" path="..." start_line=480 end_line=490 > > Follow-up: > If you need current HEAD, wait (hits and order may change): > search_status search_ref="..." wait_timeout_ms=120000 > ``` > > JSON output did not change. > > **Semantic matches** > > Repository code and repository docs hits show the matched source: the enclosing declaration scopes around the match, followed by the exact matched source with its original line numbers: > > ```text theme={null} > [1] npm:pkg@1.2.3 src/client.ts:142-145 [repo code] > - class Client | lines 20-620 > - method Client.send | lines 120-165 > 142 | const response = await transport(request); > > 143 | return response; > ``` > > * The header carries the read target, path, and matched line range. Package hits pair the registry, package, and version with the package-relative path. Repository hits pair the repository with its exact served commit and the repository-root path. > * Scope rows list the enclosing declarations outer-to-inner, each with its kind, qualified name, and inclusive declaration line range. Pick your follow-up `read` range directly from these rows: the header range for the local match context, or an enclosing declaration range for the full definition. No separate per-hit read command is printed. > * Source lines keep their original numbering, indentation, and boundaries. A `>` gutter marks lines that contain matches and stays visible without color. Omitted lines, cropped long lines, truncated scope chains, and incompletely highlighted matches carry explicit ASCII notices. > > Search text only shows source the backend proved matched: > > * A repository hit without proven matched source renders as a single `candidate` header line. No source lines, scope rows, or summary appear under it: > > ```text theme={null} > [2] npm:pkg@1.2.3 examples/auth/index.js:75-82 [repo code, candidate; visible terms: login, auth, session] > ``` > > * The line range is the backend's bounded read window. Use it as a place to inspect with `read`. It does not prove the match location. > * For a bare identifier query, `visible terms:` lists the query fragments (split on camel case and underscores) visible in the title or displayed path when those indexed fields contributed to the hit. If no fragment is visible, the header names the contributing indexed fields instead, for example `indexed: path/identifiers`. If field provenance is unknown, the header shows only `candidate`. > * When a known declaration in the same file contains the window, the header ends with its kind and qualified name, for example `- interface AuthSessionStore`. > * `visible terms` are substrings observed in the returned text. They do not prove a match and do not explain the ranking. > * Older results without matched source still show `Snippet unavailable` and keep their locators. > * Crawled documentation pages use a structural preview of the page with match highlighting instead of source lines. > * Explicit symbol hits show qualified identity with signature detail, kind, and any differing definition range, without a summary body. > > In JSON output, each repository hit's `locator` keeps the legacy `filePath`, `startLine`, and `endLine` and adds: > > * `commitSha` — the exact served revision > * `repositoryFilePath` — the repository-root path (as opposed to the target-relative `filePath`) > * `evidenceRange` — the focused match range > * `indexedRange` — the originally indexed range > * `symbolContext` — the enclosing symbol's `name`, optional `qualifiedPath` and `kind`, and a normalized lowercase `relation`: `encloses_match` (a proven enclosing definition, always with a complete `definitionRange`) or `associated_with_indexed_chunk` (associated context, `definitionRange` optional) > > JSON hits additionally carry the structured results behind the text rendering: > > * `repositoryEvidence.semanticContext` — the enclosing declaration `scopes` (outer-to-inner, with kind, qualified path, inclusive declaration ranges, parameter names, and return type) and a `preferredRead` locator with exact attributed read coordinates > * `repositoryEvidence.matchedSource` — the proven numbered source: inclusive line bounds, match anchor, range kind, per-line text with grapheme-offset highlights, and crop/omission flags > * `repositoryEvidence.bm25MatchFields` — the indexed fields that contributed matches (`SYMBOL_NAME`, `FILE_PATH`, `DOCUMENTATION`, `SOURCE_IDENTIFIER`). A known list is complete and ordered; `null` means the breakdown is unknown, not that nothing matched. > * `documentationPreview` — the structural preview text and highlight ranges for crawled documentation hits > > Since 0.23.0, `search` and `search_status` no longer emit `summary`, `highlights.summary`, hit `contentSafety`, or `repositoryEvidence.focusedSource`. JSON consumers must use `matchedSource`, indexed-field provenance, semantic context, and `documentationPreview` as appropriate. A candidate header is a navigation aid; inspect its bounded window before treating it as a source match. > > Repository hits also provide a `followUp` `read` command. Prefer this emitted action so the target, path, and bounds stay consistent. Package-attributed repository code and docs use the served package target and target-relative path; repository targets retain the served revision and repository-root path. JSON keeps snapshot provenance. When a preferred range exceeds the 300-line MCP `read` cap, the generated command requests a bounded window while the structured ranges remain unchanged. > > Search text does not print a read command under each hit. The `Read:` footer shows one example. Use the target and location from each hit header for other direct reads. For the exact backend-selected section, request JSON and replay the complete `followUp`, including its target, path, selector, and bounds. > > **Follow-up tools** > > Each hit's `type` field tells you which follow-up tool to use: > > * `repository_code` or `repository_symbol` → `read` with the compact `target` and exact `path`. In text output, build the call from the hit header and scope rows. In JSON, prefer the hit's `followUp` command, which reads the preferred range at the exact served revision. > * Repository documentation hits → use the emitted `followUp`, or the target, path, and range in the text header. These reads return indexed file content. > * Hosted documentation hits → `read` with the result's `docsReadTarget` as `target` (and no `path`), or its `pageId` when no target is emitted. > [accordion] search\_status — poll async indexing progress > > `search_status` lets you follow up on a `search` response that returned a `searchRef` instead of hits. This happens when indexing is still running. Pass the `searchRef` from the prior search response to check progress, fetch partial hits, or retrieve final results. > > **Session states** > > Every `search` and `search_status` response reports a session status. The status set is open: the backend can introduce new values, and clients preserve them instead of rejecting the response. > > | State | Statuses | What to do | > | - | - | - | > | Active | `PENDING`, `INDEXING`, `SEARCHING` | Poll `search_status` with the same `searchRef`. | > | Provisional results | Active status with `PROVISIONAL` freshness | Use the returned hits now. They come from an exact-commit snapshot served while indexing continues. The `searchRef` stays active for continuation. | > | Terminal | `DEFERRED`, `TIMEOUT`, `FAILED` | Stop polling. Use any results the response returned, then run a new `search` later for a fresher snapshot. | > | Unrecognized | Any other value | The status is preserved verbatim with any returned results. Do not poll the same `searchRef`, and do not treat it as "no hits" or as completion. Run a new `search` later. | > > `DEFERRED` is terminal on both the initial `search` response and `search_status` progress. It means background lifecycle work continues outside the session, so the `searchRef` no longer advances. Any hits already disclosed remain usable. > > **CLI usage** > > ```bash theme={null} > npx githits@latest search-status > ``` > > **Parameters** > > **search\_ref** `string` *required* > > The `searchRef` value from a prior `search` response. Pass it through unchanged (the response field uses camelCase; this parameter uses snake\_case). > > **wait\_timeout\_ms** `number` > > Maximum time to wait for progress, 0–120,000 milliseconds (default 30,000). Pass `0` to return immediately. The 120-second ceiling matches the upstream HTTP deadline; GitHits picks a longer wait automatically when the response carries indexing-time estimates. > > **format** `string` (default: text) > > `text` (default) for compact output, or `json` for the structured result. The former `text-v1` value is no longer accepted; omit the parameter or pass `text` instead. > > > [!TIP] > > > > With the default `allow_partial_results: true`, the `search_status` response may include hits from sources that have finished so far, with pagination support via `nextOffset`. > [accordion] grep — find regex or literal matches across source and docs > > `grep` searches ordered package, repository, and hosted documentation targets for a known pattern. Use `search` for topics, `list` to find paths, and `read` for more context. > > Since `@githits/mcp` 0.25.0, `grep` replaces `code_grep`. Refresh local MCP tool discovery and migrate the arguments; this is not just a rename. Hosted availability depends on the deployed server version. CLI `githits grep` was added in 0.24.0; legacy `githits code grep` remains available with its older flags and defaults. > > The defaults are RE2 regex, case-sensitive matching, zero context lines, and all indexed repository files. To preserve the old literal, case-insensitive behavior, set `pattern_type: "literal"` and `ignore_case: true` explicitly. > > **MCP example** > > ```json theme={null} > { > "targets": [ > {"target": "npm:express@5.2.1", "path_selectors": [{"kind": "prefix", "value": "lib/"}]}, > {"target": "site:expressjs.com/en/5x"} > ], > "pattern": "router", > "pattern_type": "literal", > "ignore_case": true, > "context_lines_after": 2 > } > ``` > > Package targets also include their selected hosted documentation. `corpus` and `path_selectors` filter repository files only; they do not exclude a package's hosted docs. Site entries accept only `target`. > > **CLI usage** > > ```bash theme={null} > npx githits@latest grep -Fi 'router' npm:express site:expressjs.com/en/5x > npx githits@latest grep -C 2 'app\.use\(' github:expressjs/express --path-prefix lib/ > ``` > > See the [`grep` CLI reference](/cli/commands#npx-githits-latest-grep) for all flags. > > From CLI 0.38.0, `grep` and legacy `code grep` cap context requests above 10 lines per side and report the adjustment. MCP still requires context values within 0–10. Use `read` for a larger range. > > From CLI and MCP 0.33.0, text output distinguishes a complete search with no matches from sources that are preparing, unavailable, or only partly covered. Check coverage before treating an empty result as absence. Follow the response's named retry targets, cursor, and wait controls; do not assume an unchanged retry will help when retryability is unknown or unsupported. > > **Parameters** > > **targets** `array` *required* > > One to 20 ordered objects. Each contains `target`, plus optional `corpus` (`source`, `documentation`, or `all`) and `path_selectors` for package or repository targets. Each path selector has `kind` (`exact`, `prefix`, or `glob`) and `value`; selectors form a union relative to that target's root. Omit both controls for `site:` targets. > > **pattern** `string` *required* > > Pattern of 1–200 UTF-8 bytes. RE2 regex does not support lookaround or backreferences. `foo|bar` matches either alternative; `foo\|bar` matches a literal pipe. Content-index searches require literal text; a single exact-file route accepts anchorless regex, but a path selector alone does not guarantee that route. Unsupported patterns fail explicitly. > > **pattern\_type** `string` (default: regex) > > `regex` or `literal` substring matching. > > **ignore\_case** `boolean` (default: false) > > Set to `true` for case-insensitive matching with Unicode folding. > > **context\_lines\_before** `number` (default: 0) > > Lines before each match, 0–10. > > **context\_lines\_after** `number` (default: 0) > > Lines after each match, 0–10. > > **max\_matches** `number` (default: 100) > > Maximum occurrences across all scopes on this page, 1–1000. This is a global cap, not a per-file limit. > > **cursor** `string` > > Opaque continuation cursor. Reuse the same ordered targets, pattern, and matching controls. Empty starts the first page. Restart without a cursor if it expires. > > **wait\_timeout\_ms** `number` (default: 30000) > > First-page preparation wait in milliseconds, 0–300,000. Pass `0` to return immediately. Continuation pages never wait. > > **format** `string` (default: text) > > `text` for grouped matches, read locators, coverage, and continuation guidance. Use `json` for detailed hit and scope fields, read actions, and byte coordinates. > > Since 0.27.1, text starts with a plain outcome headline that counts matches, distinct lines, and files or pages on this page, such as `Found 4 matches on 3 lines in 2 files.` An empty page says `No matches found.`, `No matches on this page.` when a cursor remains, or `No matches available yet.` when only indexing targets were omitted. A `Sources:` section names the searched scopes, followed by `Preparing:` for targets still indexing and `Omitted:` for other skipped targets. Text then groups matches under numbered file or page headers. Each header starts with the read locator. After the matches, a footer lists `Read:` templates for files and pages, `More results:` with the cursor, and `Follow-up:` with a retry for omitted targets, in that order. Use the emitted read locator and line numbers for more context. Match rows use `:` after the line number; context rows use `-`. Coverage and counts describe this page only. A small match cap can leave scopes unvisited; follow the returned cursor to continue. Hosted pages may change between `grep` and `read`. > > **Package-path warnings** > > Since CLI and MCP 0.36.0, `grep` flags path selectors that wrongly include a package's path inside its repository. Package target paths are relative to the package root. For example, `drizzle-orm/src/pg-core` on `npm:drizzle-orm` repeats the package path. Text output then shows one compact line per distinct correction: > > ```text theme={null} > Warning: Path is prefixed with package path "drizzle-orm". Did you mean "src/pg-core"? > ``` > > The warning is advisory. Matches, failures, pending targets, and cursors are unchanged, and the client does not retry automatically. Rerun with the suggested path when you meant the package-relative location. > > JSON output adds a `pathWarnings` array containing the same strings. The array is empty when there are no warnings, so JSON callers can always read it. Custom grep providers injected into the client must also supply `pathWarnings`. > > Package source correspondence notices also apply to `grep`. See [package source correspondence](#package-source-correspondence). > [accordion] list — list files and docs in a package, repo, or site > > `list` lists the files and documentation paths in one known package, repository, or hosted documentation site. Use it to discover paths before calling `read`, to scope a `grep`, or to explore the structure of an unfamiliar package. Use `search` instead when your agent knows the topic. > > Since `@githits/mcp` 0.24.0, `list` replaces the retired `code_files` and `docs_list` MCP tools. If you upgrade an existing MCP client, refresh its tool catalog so it discovers `list`. The hosted MCP server exposes `list` once GitHits deploys `@githits/mcp` 0.24.0 to it. > > A package target covers that package's own source tree. A repository target covers the whole snapshot. Both include source and documentation files. Hosted documentation is a separate inventory that requires an explicit `site:` target. See [Documentation](/tools/documentation-access#list) for site inventories. > > Select entries with `paths`. Each entry is a target-relative literal path or glob, and multiple entries form a union. Selected directories show their immediate children unless `recursive` is `true`. Glob depth is independent of recursion. > > Since 0.27.0, source text output starts with a `Sources:` section naming the served source. Repository rows show the exact commit and, when known, its UTC commit date and the ref it was indexed from. Since 0.36.0, the output also notes when a package-to-source match is unconfirmed; see [package source correspondence](#package-source-correspondence). A `Read files:` line follows with the `read` template for the listed paths, then one path per line. Directory entries end in `/`. An empty inventory starts with `No files.`, or `No files available yet.` while the source is still indexing. Indexing sources also get a `Preparing:` section and a retry hint. When more entries exist, a `More results:` footer shows the `after` cursor to pass on the next call. Reuse the same target, paths, and options with that cursor, and treat it as opaque. > > ```text theme={null} > Sources: > - npm:express@5.2.1 > Read files: read target="npm:express@5.2.1" path=$path > History.md > LICENSE > lib/ > > More results: repeat this list, adding: > after="" > ``` > > **CLI usage** > > ```bash theme={null} > npx githits@latest list npm:express@5.2.1 > npx githits@latest list npm:express@5.2.1 lib/ --recursive --limit 100 > npx githits@latest list github:expressjs/express 'lib/**/*.js' > npx githits@latest list github:expressjs/express --intent test --recursive -s > ``` > > `npx githits@latest code files` is deprecated but keeps its existing behavior for compatibility. See the [`list` command](/cli/commands#npx-githits-latest-list) for all CLI flags. > > **Parameters** > > **target** `string` *required* > > Package such as `npm:express@5.2.1`, repository such as `github:expressjs/express`, or hosted docs site such as `site:expressjs.com`. > > **paths** `array` > > Target-relative literal paths or globs, such as `["lib/", "lib/**/*.js"]`. Entries form a union. Omit or pass `[]` to browse the root. > > **recursive** `boolean` > > Expand selected directories to all descendant files. Without it, selected directories show immediate children. > > **file\_types** `array` > > Source inventories only. Case-insensitive classifications such as `source` or `doc`. Use `paths` globs for extensions. > > **languages** `array` > > Source inventories only. Case-insensitive language names such as `javascript` or `typescript`. > > **intents** `array` > > Source inventories only. File intents: `PRODUCTION`, `TEST`, `BENCHMARK`, `EXAMPLE`, `GENERATED`, `FIXTURE`, `BUILD`, or `VENDOR`. > > **limit** `number` > > Maximum entries to return (1–500). > > **after** `string` > > Opaque `nextCursor` from a prior `list` response. Reuse the same target, paths, filters, recursion, and limit. > > **wait\_timeout\_ms** `number` > > Maximum wait for source indexing in milliseconds, 0–300,000 (default 30,000). Pass `0` to return immediately. > > **format** `string` > > `text` (default) or `json`. Use `json` for exact entry kinds (`FILE`, `PAGE`, or `DIRECTORY`), read and browse actions, lifecycle metadata, and `nextCursor`. > [accordion] read — read source files or documentation pages > > `read` is the one advertised reader on the MCP surface. Pass a package or repository `target` and exact `path` to read a file, including repository documentation. For hosted documentation, pass a page locator alone or, since 0.23.0, an emitted `site:` target plus its target-relative page path. The resolved result determines code or documentation presentation. See [Documentation](/tools/documentation-access#read) for hosted page reads. > > Use the read locator from `search`, `grep`, or `list` to target a file, then set `start_line` and `end_line` to fetch only the window you need. Repository search hits supply read coordinates directly: the hit header and scope rows in text output, or the ready-made `followUp` read command in JSON, both pinned to the exact served revision. > > Since 0.36.0, code reads note when GitHits cannot confirm that the package version matches the served revision. See [package source correspondence](#package-source-correspondence). > > Since `githits` and `@githits/mcp` 0.22.0, you can pass `selector` to read an indexed code symbol, such as a function or class name, without knowing its line range. A symbol read returns the symbol's indexed definition range by default. Add `path` to restrict the lookup to that exact file, or omit it to search the whole code target. `path` always means an exact target-relative file. Either explicit bound overrides the definition range. The hosted MCP server exposes `selector` once GitHits deploys `@githits/mcp` 0.22.0 to it. > > When a symbol selection returns no source, the response carries a typed status with recovery guidance: > > * `AMBIGUOUS`: several indexed symbols match. The response lists up to 10 candidates. Retry with one candidate's exact `path`. > * `NOT_FOUND`: no indexed symbol matches. The response lists up to 10 suggestions. Retry with a suggestion, or locate the symbol with `search`. > * `SNAPSHOT_UNSUPPORTED`: the indexed snapshot does not support symbol selection. Find the definition with `search` or `grep`, then `read` the exact `path` with `start_line` and `end_line`. > > The MCP surface returns **150 lines by default** and allows explicit ranges up to **300 lines per call**. When you omit `end_line`, the read returns 150 lines from your start point. When you pass an explicit `start_line`/`end_line` range, the read honors it up to 300 lines. Broader ranges truncate and include a `hint` describing what was returned versus requested, with the continuation `start_line` for the next call. The CLI command `npx githits@latest read` has no line cap for piping. > > **CLI usage** > > ```bash theme={null} > npx githits@latest read npm:express@5.2.1 lib/application.js > npx githits@latest read npm:express@5.2.1 lib/application.js --lines 120-200 > npx githits@latest read npm:express@5.2.1 lib/application.js --lines 120 > npx githits@latest read github:expressjs/express@v5.2.1 lib/express.js > npx githits@latest read 'npm:express@5.2.1#createApplication' > npx githits@latest read npm:express@5.2.1 --selector createApplication > npx githits@latest read npm:express@5.2.1 lib/express.js --selector createApplication > npx githits@latest read --repo-url https://github.com/expressjs/express --git-ref v5.2.1 --selector createApplication > ``` > > With `--repo-url` and `--selector`, pass at most one positional path. The CLI rejects an extra path argument. > > CLI 0.22.1 and MCP 0.22.0 also support compact `target#symbol` reads, with an optional exact path. Do not combine a compact fragment with `selector`. > > The `npx githits@latest code read` and `npx githits@latest docs read` commands remain available as deprecated commands with their existing flags. Use top-level `read` for site paths, compact symbol targets, and `--selector`. > > **Parameters** > > **target** `string` *required* > > With `path`: a compact package or repository target, or an emitted `site:` target for hosted documentation. Without `path`: a documentation locator, a compact `target#symbol`, or a code target with `selector`. Pass emitted locators through unchanged. > > **path** `string` > > Exact package- or repository-relative file path from discovery results, or a target-relative page path for an explicit `site:` target. Omit when passing a complete documentation locator; an empty string counts as omitted. Use `list` to discover source paths. > > **selector** `string` > > Indexed code symbol name, or a logical documentation heading ID. With a code path, searches only that exact file; with a site path, selects a hosted heading. Without a code path, searches the whole code target. Selected code returns its definition range unless you set a bound. Do not combine with a URL fragment or compact `target#symbol`. > > **start\_line** `number` > > Starting line (1-indexed). For code reads, omit to start at line 1. For documentation pages, either bound replaces a URL fragment with a page-relative range. > > **end\_line** `number` > > Ending line (inclusive). Must be ≥ `start_line` when both are set. Text output returns 150 lines without an end, up to 300 with one. Code JSON is also bounded; documentation JSON preserves the backend selection. > > **wait\_timeout\_ms** `number` > > Code indexing wait, 0–60,000 ms (default 30,000). Validated for documentation reads but not forwarded, because the docs backend has no indexing wait. > > > [!WARNING] > > > > Read only the lines you need — a focused window around the symbol or grep match you are investigating. The 150-line default keeps reads focused; use an explicit range up to 300 lines when you know the required bounds, such as reading a modest whole file without pagination. Each retry costs additional context budget, so aim for one well-sized read per location. > > Response fields for code reads: `{path, language, totalLines, startLine, endLine, content, isBinary, hint?}`. Binary files set `isBinary: true` and omit `content`. Documentation reads keep their existing docs-side response shape. > [accordion] code\_diff — compare source versions > > Available by default in CLI and MCP 0.26.0. Hosted availability depends on the deployed MCP version. > > `code_diff` compares repository trees resolved from two package versions or two public repository refs, left-to-right. Use it to inspect changes between exact versions when you want git-shaped output. For upgrade review — vulnerabilities, changelog entries, deprecation, peer/dependency changes — call `pkg_upgrade_review` instead; raw diffs do not prove API compatibility or upgrade safety. > > Pass an unversioned target with separate MCP `from` and `to` values. The CLI uses a required `..` range; three-dot merge-base syntax and `--git-ref` are rejected. > > **Scope is always repository-wide.** Package addressing resolves package, repository, version, and exact-commit identity, but every raw diff is repository-wide. `code_diff` does not discover or filter to a package directory. Sibling package paths may appear in a monorepo, and a bounded relevance-ranked result may contain no files from the addressed package. That absence does not prove the package is unchanged. > > MCP `path_glob` or a CLI glob after `--` narrows repository paths without changing the scope. > > Launchpad targets are accepted, but comparisons between different commits currently return nonretryable `RAW_DIFF_UNAVAILABLE`. If both refs resolve to the same commit, the result is an empty inventory. > > MCP defaults to `name-status`; the CLI defaults to `--patch`. Use `stat` for change counts or a scoped `patch` for content. File bounds apply after relevance ranking; patch-byte bounds apply only to patches. > > MCP text previews each patch at 320 UTF-8 bytes. Use `format: "json"` for the full returned patch, still subject to byte limits and content coverage. Check truncation and content-safety warnings before using a patch; incomplete, filtered, byte-escaped, or omitted content is not safely applicable. > > **MCP parameters** > > | Parameter | Description | > | - | - | > | `target` | Required unversioned target, such as `npm:express` or `github:expressjs/express` | > | `from`, `to` | Required exact package versions or repository refs | > | `view` | `name-status` (default), `name-only`, `stat`, or `patch` | > | `path_glob` | One non-empty repository-relative glob; supports literals, `*`, `?`, whole-component `**`, and backslash escapes. No braces, character classes, `!`, or Git pathspec magic | > | `max_files` | Returned-file limit, 1–300 | > | `max_patch_bytes` | Aggregate patch-byte limit, 1,024–2,097,152; requires `view: "patch"` | > | `format` | `text` (default) or `json` | > > Pass `--verbose` to show exact version or ref resolution and effective repository-scope diagnostics in text output. > > **CLI usage** > > ```bash theme={null} > npx githits@latest code diff npm:express 4.18.1..4.18.2 > npx githits@latest code diff npm:express 4.18.1..4.18.2 --stat > npx githits@latest code diff npm:express 4.18.1..4.18.2 --name-status -- 'lib/**/*.js' > npx githits@latest code diff --repo-url https://github.com/expressjs/express v4.18.1..v4.18.2 --name-only > ``` > > The selected Git-like view goes to stdout. Truncation, content-safety, display-only path warnings, and `From source:` or `To source:` [correspondence notices](#package-source-correspondence) go to stderr. Empty authoritative diffs exit `0`. Caller-selected `--max-files` and `--max-patch-bytes` bounds may intentionally produce partial patches and still exit `0` with warnings. Unexpectedly incomplete or non-applicable plain patches are suppressed and exit `1`; the `--stat`, `--name-only`, `--name-status`, and JSON views preserve their structured partial results. ## Package source correspondence Since CLI and MCP 0.36.0, `search`, `search_status`, `grep`, `list`, `read`, and `code_diff` disclose when GitHits cannot confirm that a package version matches the source revision it serves. The notice appears inline beside the exact source revision: ```text theme={null} Source: github:google/guava@v33.4.0 (commit 5c71d2a, match to guava-testlib@33.4.0-jre unconfirmed) ``` The label depends on the source's role: | Label | Meaning | | - | - | | `Source:` | The revision GitHits searched or read | | `Selected source:` | The revision GitHits selected for a target that is still preparing | | `From source:`, `To source:` | The left and right sides of a `code_diff` comparison. The CLI writes these to stderr. | The notice wording describes the assessment: * `match to @ unconfirmed` means GitHits could not confirm that the revision corresponds to that version. * `version tag, match to @ unconfirmed` means GitHits selected the revision from a version tag without further confirmation. * `listed revision for @ unavailable; another revision selected` means the revision the package lists could not be served, so GitHits selected a different one. An unconfirmed match is not a claim about the published binary. It means only that GitHits could not confirm the correspondence. Results remain usable. When exact correspondence matters, check the published artifact yourself before relying on the source. These notices are independent of index freshness. JSON output keeps the backend source assessments in the target resolution and diff side data, so JSON callers can apply their own policy. ## Output formats Every format-selectable MCP tool accepts a `format` parameter with exactly two values: `text` (the default) and `json`. Use `text` for reading and tool follow-ups; it is token-efficient, and you can pass returned paths, IDs, and line ranges directly to subsequent tools. Use `json` only to parse responses in code or to obtain fields absent from text. The former `text-v1` value is rejected as of CLI and `@githits/mcp` 0.13.0; callers that passed it explicitly should omit `format` or send `text`. Rendering and JSON payloads are unchanged. ## MCP tool reference | MCP tool | CLI command | Purpose | | - | - | - | | `search` | `npx githits@latest search` | Unified discovery across code and symbols | | `search_status` | `npx githits@latest search-status` | Poll async indexing and fetch results by `searchRef` | | `grep` | `npx githits@latest grep` | Find regex or literal matches across ordered source and documentation targets | | `list` | `npx githits@latest list` | Browse a package, repository, or explicit hosted documentation site | | `read` | `npx githits@latest read` | Read an exact file, code symbol, hosted page, or documentation heading | | `code_diff` | `npx githits@latest code diff` | Compare source across versions or refs | For target discovery, use [`resolve_target`](/tools/target-resolution). # Documentation: hosted and repo-backed docs Source: https://docs.githits.com/tools/documentation-access Use search, list, and read to find, browse, and read hosted docs and repository-backed docs for indexed packages. Use `search` to find a topic, `list` to browse pages, and `read` to retrieve a page or section. These tools cover hosted documentation and repository docs. MCP 0.24.0 replaces `docs_list` and `code_files` with `list`. Refresh your client's tool catalog after updating; hosted availability depends on the deployed version. CLI `docs list` still returns a package's combined documentation catalog. > [accordion] search — find documentation by topic > > `search` is the primary discovery tool for documentation questions. It can search indexed package docs alongside code and symbols, then return documentation hits that chain into `read`. > > Use it when your agent knows the package and topic, such as an option name, guide title, error message, migration note, or API behavior. > > **CLI usage** > > ```bash theme={null} > npx githits@latest search "middleware error handling" --in npm:express --source docs > npx githits@latest search "streaming responses" --in pypi:requests --source docs > ``` > > **Key parameters** > > **query** `string` *required* > > Discovery query string. Describe the documentation topic, API, option, behavior, or error message you need. > > **target** `string` > > Single search target. Package format: `npm:react@18.2.0` or `npm:react` for latest. Repository format: `https://github.com/facebook/react`. > > **source** `string` > > Set to `docs` when you only want documentation results. Omit it when documentation can be mixed with code and symbol results. > > **limit** `number` > > Maximum results to return. > > For hosted documentation hits, pass the emitted `docsReadTarget` URL or fragment unchanged as `target` to `read`, with no `path`. If no `docsReadTarget` is emitted, use the `pageId`. Hosted URLs address mutable current content. For the exact section selected by the backend, request JSON and replay the complete `followUp`, including its target, selector, and bounds. When constructing a read directly from a URL, add bounds only to intentionally select a page-relative range. > > Repository documentation hits use snapshot identity. Since 0.23.0, package-attributed repo docs display the served package target, target-relative path, and line range, matching source code headers. Prefer the generated `followUp` or those exact coordinates; JSON retains snapshot provenance. See [search results](/tools/code-navigation#search) for the current JSON fields. > [accordion] list — browse documentation pages > > `list` browses the paths in one known package, repository, or hosted documentation site. Since `@githits/mcp` 0.24.0, it replaces the retired `docs_list` and `code_files` MCP tools. Refresh your MCP client's tool catalog after upgrading. The hosted MCP server exposes `list` once GitHits deploys `@githits/mcp` 0.24.0 to it. > > Package and repository targets include documentation files shipped in their source tree. Hosted documentation is a separate inventory. Browse it with an explicit `site:` target, such as `site:expressjs.com`. `list` does not discover sites for you. For a package's hosted docs, run `search` with `source` set to `docs`, then pass the `site:` target from a `[docs page]` result header to `list`. > > Site text output starts with a `Sources:` row marking the site as hosted documentation. When the listed pages share a read target, a `Read pages:` line follows with the `read` template. Pair listed paths with that target; a full URL row is its own read target. Paths are relative to the supplied `site:` target, and `/` denotes that target's root. A trailing `/` marks a directory; a page path has no trailing `/`, even if its publisher URL does. Use JSON when you need exact entry kinds or per-entry read actions. Pass the `site:` target as `target` and the page path as `path` to `read`. An empty inventory prints `No pages.`, or `No pages available yet.` while the site is still being prepared. When more entries exist, a `More results:` footer shows the `after` cursor for the next call. > > To narrow a site inventory, pass target-relative `paths`. A selector with one leading `/` stays within the supplied target, and `/` alone selects its root. Source-only filters such as `languages`, `file_types`, and `intents` do not apply to sites. See the [`list` parameters](/tools/code-navigation#list) for the full reference. > > **CLI usage** > > ```bash theme={null} > npx githits@latest list site:expressjs.com --limit 20 > npx githits@latest read site:expressjs.com / > ``` > > To list documentation files shipped inside a package or repository, run `list` on that package or repository target, such as `npx githits@latest list npm:express@5.2.1 --recursive`. > > `npx githits@latest docs list` remains available as a legacy CLI browser with its existing behavior. > [accordion] read — read a documentation page > > `read` accepts a complete documentation locator as `target` with no `path`. Since CLI and MCP 0.23.0, it also accepts an emitted `site:` target plus a target-relative page `path`, with an optional heading `selector`. Hosted clients receive this after the service adopts and deploys MCP 0.23.0. > > Repository documentation resolves to indexed file content with snapshot identity and the [code read response](/tools/code-navigation#read), including its MCP JSON bounds. Hosted/crawled pages use the documentation response described below. A nonempty `path` does not by itself imply source code: a site target still reads hosted documentation. > > URL targets resolve only documentation that GitHits has already indexed. Reading an unknown URL returns a `NOT_FOUND` error and never enqueues crawling. > > A hosted docs URL fragment selects its heading and full subtree through the next equal-or-higher heading. Supplying either `start_line` or `end_line` replaces the fragment with a page-relative range on the same page. Line ranges work the same with URL targets and page IDs. In text mode, the MCP surface returns 150 lines by default and allows explicit ranges up to 300 lines per call; broader ranges truncate and report the returned range. The response carries `totalLines` so the agent can continue reading the next slice when needed. JSON responses retain the `docsReadTarget`, the stable `pageId` for replays, and the provenance `sourceUrl` — and, unlike code JSON, keep the full backend selection instead of applying the 150/300-line cap. > > Since `githits` and `@githits/mcp` 0.22.0, you can pass `selector` with a logical heading ID to read one heading's section. The heading ID is the fragment without `#`, for example `expressjson` for `#expressjson`. Use it when you know the heading ID but the target has no fragment. Do not combine `selector` with a target that already contains a URL fragment. Either explicit bound overrides the heading selection. `selector` also reads indexed code symbols; see the [Code tools page](/tools/code-navigation#read) for symbol reads and their `AMBIGUOUS`, `NOT_FOUND`, and `SNAPSHOT_UNSUPPORTED` outcomes. The hosted MCP server exposes `selector` once GitHits deploys `@githits/mcp` 0.22.0 to it. > > **CLI usage** > > ```bash theme={null} > npx githits@latest read https://expressjs.com/en/5x/api/express/ > npx githits@latest read https://expressjs.com/en/5x/api/express/ --lines 50-150 > npx githits@latest read https://expressjs.com/en/5x/api/express/#expressjson > npx githits@latest read > npx githits@latest read https://expressjs.com/en/5x/api/express/ --selector expressjson > npx githits@latest read --selector > ``` > > For a site inventory, use the emitted read action. The following placeholders must be replaced with the target and path returned by `list`: > > ```bash theme={null} > npx githits@latest list site:expressjs.com --recursive --json > npx githits@latest read '' '' > ``` > > `npx githits@latest docs read` remains available with its older flags. Use top-level `read` for site paths, `--selector`, and `--start`/`--end`. > > **Parameters** > > **target** `string` *required* > > Read target from discovery results: an emitted `docsReadTarget` URL (including fragments), historical page ID, or explicit `site:` target with a separate page path. Pass emitted values through unchanged. > > **path** `string` > > Target-relative page path when `target` is an emitted `site:` target. Omit for complete documentation URLs or page IDs. With a package or repository target, this is an exact source file path instead. > > **selector** `string` > > Logical heading ID to read, such as `expressjson`. Returns that heading's section. Do not combine with a URL fragment in `target`. Added in 0.22.0. > > **start\_line** `number` > > Starting line (1-indexed). Omit to start at line 1. Setting either bound replaces a URL fragment with a page-relative range. > > **end\_line** `number` > > Ending line (inclusive). Must be ≥ `start_line` when both are set. In text mode, omitting it returns 150 lines from `start_line`, and an explicit range may request up to 300 lines. Documentation JSON keeps the backend selection. > > **wait\_timeout\_ms** `number` > > Validated for compatibility with source reads (0–60,000 ms), but not forwarded to the documentation backend, which has no indexing wait. ## MCP tool reference | MCP tool | CLI command | Purpose | | - | - | - | | `search` | `npx githits@latest search` | Find documentation pages by topic, API, option, behavior, or error | | `list` | `npx githits@latest list` | Browse a package or repository tree, or an explicit hosted documentation site | | `read` | `npx githits@latest read` | Read a page or heading by URL/page ID, or an emitted site target plus page path | # Experimental tools Source: https://docs.githits.com/tools/experimental-tools Migrate from experimental opt-ins to stable GitHits CLI and MCP tools. From `githits` and `@githits/mcp` 0.31.0, all previously gated tools are available by default. No tool currently requires `[experimental] tools = true`. ## Stable tools | MCP tool | CLI command | Stable since | | - | - | - | | [`research`](/tools/research) | `githits research` | 0.31.0 | | [`resolve_target`](/tools/target-resolution) | `githits resolve` | 0.27.0 | | [`code_diff`](/tools/code-navigation#code-diff) | `githits code diff` | 0.26.0 | ## Availability These tools are part of the CLI, local stdio MCP server, and public MCP package. Hosted MCP availability depends on the package version adopted and deployed by the service. Local configuration does not change hosted tool availability. ## Migrate an existing opt-in Update the CLI, then restart your agent to refresh local MCP tool discovery. You can remove `[experimental] tools` from [your configuration](/cli/configuration#the-experimental-section); setting it to `false` no longer hides or disables these tools. ```bash theme={null} npx githits@latest research --help ``` See [Research](/tools/research) for targets, citations, and follow-up threads. # Package Intelligence: metadata, vulnerabilities, dependencies, and upgrades Source: https://docs.githits.com/tools/package-inspection Check package metadata, vulnerabilities, dependencies, changelogs, and upgrades. All five tools are available as MCP tools and as subcommands under `npx githits@latest pkg`. > [!NOTE] > > The Package Intelligence tools support **13 registries**: npm, PyPI, Hex, Crates, vcpkg, Zig, NuGet, Maven, Packagist, RubyGems, Go, Swift, and Pub. Dependency data supports all 13 registries. Vulnerability data is unavailable for vcpkg and Zig. From CLI and MCP 0.38.0, `pub:` targets select Dart and Flutter packages from Pub, such as `pub:http` or `pub:http@1.2.2`. All five Package Intelligence tools accept Pub targets; `pkg_info` requires an unversioned target. Package names keep their native case, and exact versions keep build metadata. Dependency output can show SDK graph namespaces such as `flutter_sdk` next to a package or importer. These identify the dependency's source in the graph and cannot be passed as target registries. Hosted MCP availability depends on the deployed package version. From CLI and MCP 0.32.0, `cargo:` is an input alias for public crates.io `crates:` targets. Structured registry inputs also accept `cargo`. For example, `cargo:serde` and `crates:serde` select the same package; canonical registry identities remain `crates`. Hosted MCP receives this support after adoption and deployment of that package version. > [accordion] pkg\_info — package overview > > `pkg_info` returns a quick triage summary for any package: the default selected release and its publish date, license, repository popularity, download volume, and vulnerability status. The vulnerability summary keeps two counts separate: advisories that affect the selected release, and package-wide advisory history across all versions. Pass `verbose: true` to add GitHub language breakdown, topics, last-pushed date, published-version count, download refresh date, package-wide advisory history, and recent changes. > > **CLI usage** > > ```bash theme={null} > npx githits@latest pkg info npm:express > npx githits@latest pkg info pypi:requests --verbose > npx githits@latest pkg info crates:serde > ``` > > **Parameters** > > **target** `string` *required* > > Unversioned package target in `registry:name` form, for example `npm:express` or `npm:@types/node`. Scoped names are supported. Registries: `npm`, `pypi`, `hex`, `crates`, `vcpkg`, `zig`, `nuget`, `maven`, `packagist`, `rubygems`, `go`, `swift`, or `pub`. `pkg_info` describes the default selected release, so omit any `@version` pin; supplying one is rejected. > > **verbose** `boolean` > > When `true`, adds GitHub language/topics/last-pushed, published-version count, download refresh date, package-wide advisory history (all versions), and recent changes to the text output. Has no effect when `format: "json"` is set. > > **Example** > > ```bash theme={null} > npx githits@latest pkg info npm:express > ``` > > Returns, when available: selected version, license, description, GitHub stars/forks/open issues, monthly or total downloads, publish age, and a compact vulnerability status line with separate selected-release and package-wide advisory counts. > > From CLI and MCP 0.39.0, the overview describes the default selected release, which can differ from the registry's latest pointer. When GitHits skips that pointer, the output explains why: the release may be deprecated, yanked, unlisted, have no files, or be a prerelease. The vulnerability line then uses `Selected:` instead of `Latest:`. Some packages have no default release; the selected version is omitted. For a prerelease-only package, the output explains that installation requires an explicit version. Hosted MCP gets this behavior after the released package is adopted and deployed. > > JSON output includes `version` and `publishedAt` for the selected release, `latestVersion` and `latestVersionPublishedAt` for the registry's latest pointer, and `registryLatestDifference: {version, reason}` when the two differ. `reason` is one of `DEPRECATED`, `YANKED`, `NO_FILES`, `UNLISTED`, or `PRERELEASE_EXCLUDED`. `version` is omitted when no release is selected. JSON also includes `versionCount` (published versions), `downloads.refreshedAt` (download data freshness), and `advisoryHistory.total` (package-wide advisory count). The `vulnerabilities.affectsLatest` key keeps its name but describes the selected release. To list the historical advisories themselves, use `pkg_vulns` with `advisory_scope: "all"`. > > From CLI and MCP 0.33.0, package info can show a `Package registry` row naming the registry repository that supplied the metadata, such as Google Maven. This is separate from the package's source-code repository. `pkg_info`, `pkg_deps`, and `pkg_vulns` JSON include `registryRepository: {id, name, url}` when that registry is known; otherwise the row and field are omitted. Hosted MCP availability depends on the deployed package version. > [accordion] pkg\_vulns — vulnerability advisories > > `pkg_vulns` fetches CVE and OSV security advisories for a package or a specific pinned version. It returns a count summary, each advisory with its OSV ID, severity, affected version ranges, and fix versions. Malicious-package advisories appear in a separate bucket. > > Reports distinguish affected, non-affecting, and unknown assessments. From CLI and MCP 0.31.0, use `advisory_scope: "unknown"` (CLI `--scope unknown`) to inspect advisories that could not be evaluated and the reasons why. `advisory_scope: "all"` includes every outcome. A historical advisory does not mean the inspected version is affected, and an unknown assessment does not establish that it is unaffected. > > By default the tool checks only the inspected package. Pass `include_transitive: true` (CLI `--transitive`) for an npm-audit-style audit that also reports vulnerabilities in the versions resolved by the dependency graph. Transitive audits are opt-in because they add graph-analysis cost. > > **CLI usage** > > ```bash theme={null} > npx githits@latest pkg vulns npm:lodash > npx githits@latest pkg vulns npm:lodash@4.17.20 --severity high > npx githits@latest pkg vulns npm:express --transitive > npx githits@latest pkg vulns npm:express --transitive --scope unknown > npx githits@latest pkg vulns pypi:pillow --verbose > npx githits@latest pkg vulns npm:lodash@4.17.20 --details > ``` > > **Parameters** > > **target** `string` *required* > > Package target in `registry:name[@version]` form, for example `npm:lodash@4.17.20`. Omit the version to check the latest release. Scoped names are supported. Go module versions are accepted with or without the leading `v` (`1.24.0` or `v1.24.0`); other registries reject tag-style `v`-prefixed inputs except Swift. Vulnerability data is unavailable for vcpkg and Zig. > > **min\_severity** `string` > > Filter to advisories at or above this level: `low`, `medium`, `high`, or `critical`. Omit to include all advisories, including those with no assigned severity. Applies to both direct and transitive rows. > > **include\_withdrawn** `boolean` > > When `true`, includes retracted advisories. Defaults to `false`. Affects direct package rows only; transitive withdrawn advisories remain excluded. > > **include\_transitive** `boolean` > > When `true`, audits vulnerabilities in the versions resolved by the dependency graph in addition to the inspected package. Defaults to `false` because the audit adds graph-analysis cost. In the CLI, use `--transitive`. > > **advisory\_scope** `string` > > Which advisory rows to return: `affected` (default), `non_affecting` (confirmed not to affect the inspected version), `unknown` (could not be evaluated), or `all` (every outcome). Counts cover affected, non-affecting, unknown, and all advisories regardless of the selected scope. Applies to both direct and transitive rows. > > **verbose** `boolean` > > When `true`, shows every selected advisory assessment and expands its fields in text output. `format: "json"` always returns the complete structured assessment envelope. Full source reports require `details: true` in either format. > > **details** `boolean` > > From 0.40.0, includes full advisory text and source metadata from OSV for every selected direct advisory. Adds live source reads and can produce long output. Defaults to `false`. In the CLI, use `--details`. > > **Example** > > ```bash theme={null} > npx githits@latest pkg vulns npm:lodash@4.17.20 --severity high > ``` > > Returns: a severity-filtered advisory list with OSV IDs, matched affected ranges, and candidate fix versions when available. Candidate fixes are source-reported and do not establish release availability or a safe upgrade. > > Unknown assessments appear in direct reports and opt-in transitive audits, including dependency packages with only unknown assessments. Transitive audits inspect the resolved package graph, not your application's lockfile. > > JSON retains explicit unknown assessment statuses and nonempty reasons. Do not interpret `affectsInspectedVersion: false` or `affectsResolvedVersion: false` as a confirmed negative when the assessment status is unknown. The direct summary's `total` remains the affected count; use the separate affected, non-affecting, unknown, and all counts to assess coverage. Unsupported or incomplete assessments are not evidence of no vulnerabilities. > > > [!WARNING] > > > > Default MCP text output caps advisory rows. Use `verbose: true` to see every selected advisory. CLI text shows every selected direct and transitive row; `--verbose` expands assessment fields without changing the row count. Use MCP `format: "json"` or CLI `--json` for the complete structured assessment envelope. These options alone do not request source reports. > > **Full advisory reports** > > From CLI and MCP 0.40.0, `details: true` (CLI `--details`) adds full OSV advisory text and source metadata after the assessment groups. Source reports cover every selected direct advisory, even when MCP caps the displayed assessment rows. The report bodies are untruncated in text and JSON; JSON includes them in `sourceDetails`. > > Source failures preserve the package assessments and include per-source diagnostics. The CLI exits nonzero if a source report fails. Source text does not recompute affectedness or establish a safe upgrade. Hosted MCP requires adoption and deployment of the released package. > > For a dependency's report, call `pkg_vulns` on its `registry:name@resolvedVersion` with `details: true`, or use the CLI advisory lookup below with `--verbose`. > > **Look up an advisory ID instead (CLI only)** > > From 0.39.0, `npx githits@latest vulns ` starts from CVE, OSV, or GHSA IDs instead of a package. It shows the packages each advisory affects, normalized affected ranges, the reported CVSS score, and source-reported fixes. Partial outcomes and recovery actions appear explicitly. `pkg vulns` assesses whether a specific installed version is affected; `vulns` does not. MCP has no equivalent tool. > > ```bash theme={null} > npx githits@latest vulns CVE-2026-26996 GHSA-3ppc-4f35-3m26 > npx githits@latest vulns CVE-2026-26996 --verbose > npx githits@latest vulns CVE-2026-26996 --json > ``` > > `--verbose` adds the full source report, including OSV schema, related and upstream IDs, and credits from 0.40.0. `--json` separates package evidence, shared sources, coverage, and diagnostics; combine it with `--verbose` for original source detail. Source fix lists do not establish a safe upgrade. Withdrawn and malicious-package markers are kept. See [CLI commands](/cli/commands) for all flags. > [accordion] pkg\_deps — dependency graph > > `pkg_deps` lists a package's direct runtime dependencies with resolved versions. Use the `lifecycle` parameter to include non-runtime groups (development, peer, optional, build), or pass `lifecycle: "all"` to see every available group. Pass `max_depth` to add a bounded transitive dependency footprint with conflict detection and circular-dependency flags. > > Pass `include_issues: true` (CLI `--issues`) to compute deprecated, outdated, duplicate, and conflict analysis across the resolved dependency graph, including actionable conflict constraints and importer provenance. > > **CLI usage** > > ```bash theme={null} > npx githits@latest pkg deps npm:express > npx githits@latest pkg deps npm:react --lifecycle all > npx githits@latest pkg deps npm:webpack --depth 3 > npx githits@latest pkg deps npm:express --issues > ``` > > **Parameters** > > **target** `string` *required* > > Package target in `registry:name[@version]` form, for example `npm:express@5.2.1`. Omit the version to inspect the latest release. Scoped names are supported. Go module versions are accepted with or without the leading `v` (`1.24.0` or `v1.24.0`); other registries reject tag-style `v`-prefixed inputs (e.g., `v4.18.0`) except Swift — pass the canonical version number (`4.18.0`). Dependency data is available on all 13 registries: npm, PyPI, Hex, Crates, NuGet, Maven, Zig, vcpkg, Packagist, RubyGems, Go, Swift, and Pub. > > **lifecycle** `string` > > Dependency group breadth. Omit for runtime-only. Use `runtime` for explicit runtime-only, a concrete non-runtime lifecycle (`development`, `build`, `peer`, `optional`) to add matching groups, or `all` for every available group. Accepts a single value, a comma-separated string, or an array. `all` cannot be combined with other values. > > **include\_issues** `boolean` > > When `true`, computes deprecated, outdated, duplicate, and conflict analysis across the resolved dependency graph. Without `max_depth`, the analysis traverses the full graph; set `max_depth` to bound analysis cost and scope. Defaults to `false`. Use `format: "json"` (CLI `--json`) for complete issue rows, or `--verbose` in the CLI for complete issue details in text. In the CLI, use `--issues`. > > **include\_importers** `boolean` > > When `true`, each entry in `transitive.packages[]` also carries an `importers` array showing every upstream package that pulls it in. If `max_depth` is omitted, this also requests the full transitive block. Off by default because enabling it roughly quadruples envelope size on heavy graphs. > > **max\_depth** `number` > > Add a `transitive` block and cap traversal at this depth (1-10). Omit for direct dependencies only. In the CLI, use `--depth`. > > **Example** > > ```bash theme={null} > npx githits@latest pkg deps npm:express --lifecycle all > ``` > > Returns: runtime, development, and peer dependency groups with resolved versions for each direct dependency. > [accordion] pkg\_changelog — release notes > > `pkg_changelog` retrieves release notes for a package. Latest mode returns up to ten entries by default. Results preserve source order, which may interleave maintained release lines, so do not assume newest-first ordering. A `@from..to` range returns entries after `from` through `to`, with the starting version excluded and the ending version included. Use `@from` separately for the starting release's own notes. > > From CLI and MCP 0.30.0, default text and JSON return parsed statements with available agent classifications, uncertainty markers, coverage, and sources. All matching statements are retrieved. Use `changes` to filter them, `verbatim: true` for complete original notes, or `omit_bodies: true` for just the version/date/URL timeline. > > From 0.38.0, changelog and upgrade-review output marks generated notes and their generation status. Generated notes are derived from commits; distinguish them from the project's published release notes when citing changes. > > Since `githits` and `@githits/mcp` 0.21.0, `pkg_changelog` is package-only: the retired `registry`, `package_name`, `repo_url`, `git_ref`, `from_version`, and `to_version` inputs are replaced by a single required `target`, and the CLI drops `--repo-url` and `--git-ref`. Standalone repository targets are rejected. Look them up by their published package instead. > > **CLI usage** > > ```bash theme={null} > npx githits@latest pkg changelog npm:express > npx githits@latest pkg changelog npm:express --limit 5 > npx githits@latest pkg changelog npm:express@5.2.1 > npx githits@latest pkg changelog npm:express --from 4.18.0 --to 4.19.0 > npx githits@latest pkg changelog npm:express@4.21.2..5.2.1 > ``` > > **Parameters** > > **target** `string` *required* > > Package target in one of three shapes: `registry:name` for latest mode, `registry:name@version` for one selected release, or `registry:name@from..to` for releases after `from` through `to`. Open bounds `@from..` and `@..to` are also accepted. Scoped names are supported. Go module versions are accepted with or without the leading `v`; other registries reject tag-style `v`-prefixed inputs except Swift. Package targets only — repository and `site:` targets are rejected. > > **limit** `number` > > Maximum number of entries to return (1–50, default 10). Applies only to latest mode and upper-cap `@..to` targets. Rejected with an exact `@version`, a `@from..to` range, or a lower-open `@from..` target. Ranges with a starting version have no count cap. > > **omit\_bodies** `boolean` > > When `true`, returns only the version/date/URL timeline and skips parsing and classification. Cannot be combined with `verbatim: true` or `verbose: true`. In the CLI, use `--no-body`. > > **changes** `string` (default: all) > > Filter statements: `actionable` includes statements classified as requiring action, including uncertain classifications; `important` also includes "should know" statements; `all` includes every parsed statement, including no-impact and unassessed statements. Coverage still includes every selected release. Ignored in original-note and timeline views. In the CLI, use `--changes`. > > **verbatim** `boolean` > > Return complete original notes instead of parsed statements, including original bodies in JSON. Skips classification. Cannot be combined with `omit_bodies: true`. In the CLI, use `--verbatim`. > > **verbose** `boolean` > > Deprecated alias for `verbatim: true`, in text and JSON. Overrides `body_lines`; cannot be combined with `omit_bodies: true`. > > **body\_lines** `number` > > Deprecated text-only original-note preview request and line cap (1–50). Omit for the default statement view. Ignored with JSON, `omit_bodies: true`, `verbatim: true`, or `verbose: true`. > > **Example** > > ```bash theme={null} > npx githits@latest pkg changelog npm:express --limit 3 > ``` > > Returns: up to three releases in source order with their parsed statements, available classifications, and sources. An exact version selects one release or returns `VERSION_NOT_FOUND`; a release without notes succeeds with `hasChangelog: false`. Empty latest or range selections also succeed. > > For scripts that need the original Markdown bodies, use `verbatim: true, format: "json"` or CLI `--verbatim --json`. > [accordion] pkg\_upgrade\_review — upgrade review > > `pkg_upgrade_review` compares the version you use today with a target version. It checks direct vulnerability changes, changelog entries in the version range, target deprecation metadata, peer dependency changes, dependency changes, and optional transitive dependency checks. > > From 0.31.0, direct security summaries also retain unknown vulnerability counts and assessment status. Follow the returned `pkg_vulns` action to inspect advisories that could not be evaluated. > > Use it when your agent needs upgrade facts instead of guessing from semver. The tool reports changes; it does not decide whether an upgrade is safe. > > **CLI usage** > > ```bash theme={null} > npx githits@latest pkg upgrade-review npm:zod@4.3.6..4.4.3 > npx githits@latest pkg upgrade-review npm:zod@4.3.6 --to 4.4.3 > npx githits@latest pkg upgrade-review --package npm:zod@4.3.6..4.4.3 --package npm:lint-staged@16.2.7..16.4.0 > ``` > > Use `..` as the range delimiter for the positional `:@..` form and for repeatable `--package` entries. The legacy `->` delimiter is rejected with guidance to switch to `..`. A positional range already contains its target, so combining it with `--to` or `--package` is rejected. > > **Parameters** > > **registry** `string` > > Package registry for single-package mode. Supported registries: `npm`, `pypi`, `hex`, `crates`, `nuget`, `maven`, `zig`, `vcpkg`, `packagist`, `rubygems`, `go`, `swift`, and `pub`. > > **package\_name** `string` > > Package name for single-package mode. Scoped names are supported. > > **current\_version** `string` > > The version you currently use. Go module versions are accepted with or without the leading `v`. Tag-style inputs with a leading `v` are rejected for other registries except Swift. > > **target\_version** `string` > > The version you want to review. Go module versions are accepted with or without the leading `v`. Tag-style inputs with a leading `v` are rejected for other registries except Swift. > > **packages** `array` > > Batch mode. Each entry includes `registry`, `package_name`, `current_version`, and `target_version`. Mutually exclusive with the single-package fields. A batch accepts at most 30 packages after blank entries are removed; larger batches are rejected before any backend call. > > **skip\_transitive\_security** `boolean` > > When `true`, skips current-vs-target transitive vulnerability summary diffs. Defaults to `false`, so transitive security checks is included unless explicitly skipped. In the CLI, use `--no-transitive-security`. > > **include\_dependency\_issues** `boolean` > > When `true`, diffs current vs target transitive deprecated, outdated, duplicate, and conflict summaries. Defaults to `false`. > > **min\_severity** `string` > > Minimum direct-advisory severity: `low`, `medium`, `high`, or `critical`. > > **changes** `string` > > Filter detailed changelog statements to `actionable`, `important` (actionable plus "should know"), or `all`. Omit for the default focused view: actionable, "should know", and too-long-to-classify statements. `focused` is not an accepted explicit value. Uncertain classifications remain in their selected tier. Batch triage and coverage still describe the whole version range. In the CLI, use `--changes`. > > **verbose** `boolean` > > Text output only. Shows full per-package reports in batch mode, expands classified statement quotes, and includes dependency change examples, including transitive version changes. > > **Example** > > ```bash theme={null} > npx githits@latest pkg upgrade-review npm:zod@4.3.6 --to 4.4.3 > ``` > > Returns: a current-vs-target comparison with direct vulnerability changes, agent-classified release-note statements grouped by version, lexical keyword matches, target deprecation status, peer dependency changes, and transitive security summaries. > > **Classified statement evidence** > > Text output includes a **Changes (classified by agent)** section. An agent classifies quoted release-note statements, and the section groups them by version. Changelog or release notes links appear beside each version. > > * **Action annotations** such as `[!]` mark statements that may need a code, configuration, or migration change. > * **Should-know annotations** mark statements worth knowing that are less likely to need action. > * **(uncertain)** marks statements the classifier could not tier with confidence. > > From 0.30.0, the detailed report includes all matching statements in release/source order. Its default focused view includes actionable, "should know", and too-long-to-classify statements. Pass `changes: "all"` to also include no-impact and unassessed statements. The section reports coverage: how many versions were classified, not assessed, without notes, or unparseable. Missing or unparseable notes are not evidence of no risk. Lexical keyword matches stay in a separate list. Use `verbose` to expand the quotes. > > Batch output ranks packages by confident action count and summarizes each package's counts, for example `13 act (+28 uncertain) | 12 know (+10 uncertain)`. These totals cover the whole version range even when `changes` filters the detailed statements. > > From 0.30.0, JSON uses `changelog.statements` instead of `changelog.riskItems`; `riskCoverage.itemsOmitted` is removed. Statement data includes complete text, source links and context, with classification and model provenance when available. Coverage retains whole-range classification totals, including `itemsMustActConfident`, `itemsMustActAmbiguous`, `itemsShouldKnowConfident`, `itemsShouldKnowAmbiguous`, and `itemsUnclassified`. > > ```bash theme={null} > npx githits@latest pkg upgrade-review npm:zod@4.3.6..4.4.3 --json > ``` > > **Migration guides** > > From CLI and MCP 0.37.0, upgrade reviews link to available migration guides for the version range. Guide links appear in detailed reports and compact batch rows. JSON keeps each guide's URL and optional label in `reviews[].migrationGuides`. Your agent can open a guide when it needs migration instructions. > > The review includes links, not guide contents. An empty or missing `migrationGuides` list does not mean that no guide exists. Hosted MCP availability depends on adoption and deployment of the released package. > > > [!NOTE] > > > > Classifications describe what release notes say. They are not a package verdict or a safety rating. Your agent still decides whether each statement applies to your codebase and verifies the upgrade locally. > > > [!WARNING] > > > > A version number alone, including a patch update, does not establish compatibility. Use `pkg_upgrade_review` to collect facts, then make the final risk call in your review. ## MCP tool reference | MCP tool | CLI command | Purpose | | - | - | - | | `pkg_info` | `npx githits@latest pkg info :` | Selected version, license, popularity, downloads, vulnerability status | | `pkg_vulns` | `npx githits@latest pkg vulns :` | CVE/OSV advisories with severity filtering, upgrade paths, and opt-in transitive audits | | `pkg_deps` | `npx githits@latest pkg deps :` | Direct and transitive dependency graph with opt-in issue analysis | | `pkg_changelog` | `npx githits@latest pkg changelog :` | Release notes in source order, with range queries for upgrade review | | `pkg_upgrade_review` | `npx githits@latest pkg upgrade-review :@..` | Compare current and target versions without assigning risk | # Quick-start guidance for MCP clients Source: https://docs.githits.com/tools/quick-start Load GitHits tool routing and usage instructions with quick_start. `quick_start` takes no arguments and returns the GitHits usage guide. It covers tool selection, target syntax, output formats, citations, and handling untrusted content. It does not query indexed content or change external state. ## When agents call it Call it once per session unless the guide is already loaded. The current `githits-mcp` skill includes the stable guide. Other tools remain callable without `quick_start`. ## Availability `quick_start` is included in the default `@githits/mcp` inventory and local stdio server. Hosted availability depends on the deployed server version. The stable guide includes [`resolve_target`](/tools/target-resolution), [`code_diff`](/tools/code-navigation#code-diff), and, from 0.31.0, [`research`](/tools/research). No experimental opt-in is required. There is no CLI counterpart. Use `npx githits@latest --help` or the [CLI reference](/cli/commands). # Research Source: https://docs.githits.com/tools/research Ask how a package or repository works and get an answer with cited sources. Use `research` to ask how a public package or repository works and receive an answer with source citations. Research is available by default in `githits` and the public `@githits/mcp` package from 0.31.0. No experimental opt-in is required. Hosted MCP receives it when the service adopts and deploys that package version. ```bash theme={null} npx githits@latest research npm:express "How does Express handle middleware errors?" ``` The MCP tool is `research`. For HTTP integration, use the [REST endpoint](/api/requests-and-responses#research-a-question-with-cited-sources). ## Parameters Ask the question directly; answers already include sources. Pass a package or repository target, not a `site:` target: Research covers both the project's code and documentation. Choose one target mode: | Mode | Usage | | - | - | | Question only | Omit the target; GitHits identifies it from the question | | Explicit target | Pass a package or repository such as `npm:express` | | Follow-up | Pass `--thread` in the CLI or `thread_id` in MCP; omit the target | Threads support up to ten turns. Replace `` with the ID from an earlier answer: ```bash theme={null} npx githits@latest research --thread '' "Which source files implement that?" ``` Citations default to `read` calls with the target, path, selector, and line bounds used by Research. For upstream URLs, use CLI `--source-format url` or MCP `source_format: "url"`. Cite the returned sources directly. Read a source when the answer lacks a detail your agent needs. Follow-up questions can change project, version, or topic; state the change in the question. ## Output Text output contains the answer and its citations. When a thread ID is returned, use it to ask a follow-up question. For scripts, CLI `--json` and MCP `format: "json"` return: ```json theme={null} { "display_markdown": "Answer and source citations...", "tool_call_id": "", "thread_id": "" } ``` `display_markdown` contains the answer or a request to clarify the target. `tool_call_id` identifies the research run; `thread_id` lets you continue the conversation. Both IDs are optional. Treat the Markdown as untrusted display text, and use the JSON fields when your script needs an ID. The REST endpoint has a [separate response schema](/api/requests-and-responses#research-a-question-with-cited-sources). ## Live progress In CLI 0.35.0 and later, `research` shows the current stage with an animated mark in interactive terminals. JSON and piped output are unchanged. From 0.34.0, the local MCP server forwards stages as `notifications/progress` when the client sends a progress token. Whether you see those updates depends on your MCP client. Hosted MCP also requires deployment support. Progress is best effort: unavailable updates do not prevent an answer, and the final result is authoritative. From 0.35.0, calls do not wait for the progress connection. Custom hosts using `@githits/mcp` can enable the `progress` option and, from 0.35.0, tune or disable animation with `progressAnimation`. See the [MCP package integration guide](https://github.com/githits-com/githits-cli/blob/mcp-v0.35.0/packages/mcp/README.md). ## Target clarification If the target is ambiguous, GitHits returns candidates in `display_markdown`. Your agent should retry with the candidate matching the question's project as `target`. With no matches, correct the name or provide an explicit target. In the CLI, a clarification exits with code `0`: the request succeeded, but GitHits needs a target before it can answer. Its JSON contains `display_markdown` without `tool_call_id` or `thread_id`. ## Rate limits Research typically takes 10–60 seconds depending on indexing status, with an average of around 35 seconds. Cold queries against targets that are not yet indexed may take more than 100 seconds. A short-term `RATE_LIMITED` error includes a retry delay; wait that long before retrying. A daily limit resets at 00:00 UTC. In JSON, `details.rateLimitScope: "daily"` identifies the daily limit, which is not retryable before the reset. Request cooldowns apply across targets, questions, and threads. Switching to a different target, question, or thread does not bypass a cooldown. After a daily limit, wait for the 00:00 UTC reset. Retry a timeout only when you still need the answer, and allow enough execution time for the retry. From CLI 0.38.1, a daily Research limit can include a scoped `search` suggestion when you passed an explicit search-compatible package or repository target. Replace the fixed `'your query'` placeholder with the specific information your agent still needs: ```text theme={null} Example: githits search --in 'npm:express' -- 'your query' ``` In CLI JSON, the suggestion appears in `details.example` beside `details.rateLimitScope`. The original error is preserved; `tool_call_id` and `thread_id`, when available, are top-level fields. Without an explicit search-compatible target, the CLI omits the suggestion. ## Sign-in required If Research returns `REAUTH_REQUIRED`, finish signing in with the returned link, then retry the request. See [sign-in required errors](/authentication#sign-in-required-errors) for browser behavior and JSON fields. # Resolve a target Source: https://docs.githits.com/tools/target-resolution Find canonical package, repository, or documentation targets from an open-source dependency name. Use `resolve_target` when your agent knows a dependency's name but needs a target for another GitHits tool. It returns candidates such as `npm:express`, `github:openai/codex`, or `site:docs.example.com/sdk`. Target resolution is available by default in `githits` and `@githits/mcp` from 0.27.0. Hosted MCP availability depends on the deployed package version. Already have a canonical target such as `npm:express` or `gitlab:group/subgroup/project`? Pass it directly to `search`, `list`, or another tool. The resolver accepts human-readable names and rejects canonical targets with `INVALID_ARGUMENT`. See [target syntax and supported repository hosts](/tools/code-navigation#choose-a-target). From CLI and MCP 0.33.0, the resolver also accepts mutable [Launchpad defaults](/tools/code-navigation#launchpad-git-targets) such as `lp:project` and returns the current canonical `launchpad:` target. Complete owner-qualified paths are already canonical: pass them directly to other tools. ```bash theme={null} npx githits@latest resolve express npx githits@latest resolve codex --prefer-kind repository npx githits@latest resolve guava --registry maven --limit 3 npx githits@latest resolve "pi agent" --query "coding agent CLI" ``` ## Parameters | MCP parameter | CLI argument or flag | Description | | - | - | - | | `name` | Positional argument | Required package, repository, or documentation-site name | | `query` | `--query` | Task context for ranking retrieved candidates | | `intent_hints` | Repeatable `--intent-hint` | Additional ranking context | | `registries` | `--registry` | Package registry filter; CLI accepts a comma-separated list. Repository and site candidates remain eligible | | `preferred_kind` | `--prefer-kind` | Preference for `package`, `repository`, or `site` | | `limit` | `--limit` | Ranked candidate limit, 1–20; default 8. Exact-name and related targets can appear in addition | | `verbose` | `--verbose` | Include name similarity in text output | | `format` | `--json` | MCP uses `text` by default; choose `json` for structured output | Ranking context helps order retrieved candidates; it does not expand the search. Inputs must describe public open-source software. Do not include credentials, personal data, private code, or proprietary content. From CLI and MCP 0.32.0, the registry filter accepts `cargo` as an alias for `crates`. Returned canonical package targets still use `crates:`. From CLI and MCP 0.38.0, the registry filter also accepts `pub` for Dart and Flutter packages. Matching candidates return `pub:` targets, such as `pub:http`, that you can pass to package, source, and documentation tools. ## Choose a target Results group related package, repository, and documentation identities together. Your agent should follow the result's guidance: | Result | Next step | | - | - | | Non-ambiguous `EXACT` or `HIGH` match with malicious-content status `clear` or `not_applicable` | Use the best target in the next tool call | | `MEDIUM` or `LOW` confidence | Narrow the name or filters, or explicitly choose a candidate | | Ambiguous matches | Ask the user to select a target or narrow the input | | Affected, uncertain, missing, or unrecognized malicious-content status | Review the warning; GitHits does not offer an automatic next-tool action | | No candidates | Correct the name or adjust registry filters. The CLI exits with code `1` | Pass a selected package or repository target to the tool you need. From CLI and MCP 0.38.0, returned targets preserve the address needed for follow-up calls: reuse it unchanged. For Googlesource repositories, this is the HTTPS address, such as `https://go.googlesource.com/time`. A `site:` target is for documentation: use `list` to browse it or `search` with `source: "docs"`, then reuse the returned `read` locator. ## Malicious-content gating Package candidates include a check for malicious-package advisories affecting their latest version: * `clear`: no active malicious-package advisory affects the latest version. This does not mean the package is free of vulnerabilities. * `not_applicable`: the target is not a package. * `affected`: an active malicious-package advisory affects the latest version. * `unknown`: advisories exist, but GitHits cannot reliably classify the latest version. Warnings link to the relevant `MAL-*` advisories on OSV. Uncertain results include the reasons for uncertainty; truncated results report omitted advisories. Use [`pkg_vulns`](/tools/package-inspection) to inspect vulnerabilities for a package version. ## JSON output CLI `--json` and MCP `format: "json"` return `ambiguous`, optional `ambiguousReason`, `candidates`, `protectedMatches`, and an optional `best` match. `best` is absent when there are no candidates. Candidate `target`, `best`, and `protectedMatches` values contain addresses you can reuse in follow-up calls. When a candidate's identity differs from that address, the candidate also includes `canonicalKey`. For example, a Googlesource candidate has `target` `https://go.googlesource.com/time` and `canonicalKey` `googlesource:go.googlesource.com/time`. Pass `target` to other tools; use `canonicalKey` only to identify or deduplicate candidates. Candidates include `latestVersionMaliciousStatus`. Affected or uncertain candidates also include `latestVersionMaliciousEvidence`, with advisory IDs, classification reasons, and truncation details. Available `nameSimilarity` values are included in JSON; similarity alone does not establish that a candidate is the right target.