> ## Documentation Index
> Fetch the complete documentation index at: https://docs.githits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHits CLI command reference: all commands and flags

> Complete reference for every GitHits CLI command, organized by category: setup, authentication, MCP server, indexed source navigation, documentation, package inspection, code examples, and feedback.

export const CommandAccordionToggle = () => {
  const [allOpen, setAllOpen] = useState(false);
  const getTriggers = () => Array.from(document.querySelectorAll('#content summary[data-component-part="accordion-button"][aria-expanded]'));
  const syncState = () => {
    const triggers = getTriggers();
    setAllOpen(triggers.length > 0 && triggers.every(trigger => trigger.getAttribute("aria-expanded") === "true"));
  };
  useEffect(() => {
    syncState();
    const content = document.getElementById("content");
    if (!content) {
      return;
    }
    const observer = new MutationObserver(syncState);
    observer.observe(content, {
      attributes: true,
      attributeFilter: ["aria-expanded"],
      subtree: true
    });
    return () => observer.disconnect();
  }, []);
  const toggleAll = () => {
    const triggers = getTriggers();
    const shouldOpen = !allOpen;
    triggers.forEach(trigger => {
      const isOpen = trigger.getAttribute("aria-expanded") === "true";
      if (isOpen !== shouldOpen) {
        trigger.click();
      }
    });
    window.setTimeout(syncState, 80);
  };
  return <div className="githits-command-toolbar">
      <button type="button" className="githits-command-toggle" aria-expanded={allOpen} onClick={toggleAll}>
        {allOpen ? "Collapse all" : "Expand all"}
      </button>
    </div>;
};

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

<CommandAccordionToggle />

***

## Setup and configuration

<AccordionGroup>
  <Accordion title="npx githits@latest init" description="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, VS Code / Copilot, Cline, Claude Desktop, Codex CLI, Pi, Gemini CLI, Google Antigravity, and OpenCode.

    By default, `init` performs a **guided MCP setup**: alongside the MCP server config, it drops a `githits-mcp` Agent Skill and a managed instruction block (delimited by `<!-- githits -->` markers in files like `AGENTS.md`, `CLAUDE.md`, or `GEMINI.md`) into each supported tool. The skill and instructions help the agent decide when to reach for GitHits without bloating its base context. 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**

    <ParamField query="-y, --yes" type="flag">
      Skip interactive prompts and configure all detected tools automatically. Defaults to guided MCP unless `--no-guidance` is set.
    </ParamField>

    <ParamField query="--skip-login" type="flag">
      Skip the authentication step. Useful if you are already authenticated and only want to reconfigure tool integrations.
    </ParamField>

    <ParamField query="--project" type="flag">
      Configure project-level MCP in the current directory instead of user-level tool configuration.
    </ParamField>

    <ParamField query="--detect-agents" type="flag">
      Scan supported agents and print what GitHits can configure without installing anything.
    </ParamField>

    <ParamField query="--install-agents" type="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.
    </ParamField>

    <ParamField query="--guidance" type="flag">
      Explicitly install the `githits-mcp` skill and managed instruction block alongside MCP configuration. This is the default; use the flag when scripting a guided install to make intent explicit.
    </ParamField>

    <ParamField query="--no-guidance" type="flag">
      Install plain MCP only. Skips the `githits-mcp` skill and the managed instruction block in supported tools.
    </ParamField>

    <ParamField query="--json" type="flag">
      Emit JSON output for `--detect-agents` or `--install-agents`.
    </ParamField>

    <Tip>
      `init` is the default way to get started. It configures supported tools and handles authentication for common local setup.
    </Tip>
  </Accordion>

  <Accordion title="npx githits@latest init uninstall" description="Remove GitHits MCP configuration 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 `<!-- githits -->` markers) is removed from files like `AGENTS.md`, `CLAUDE.md`, and `GEMINI.md`, and any copied `githits-mcp` skill files are deleted from tool-native skill folders. Stored credentials are preserved — only MCP config, guidance blocks, and skill files are removed.

    ```bash theme={null}
    npx githits@latest init uninstall
    ```

    **Flags**

    <ParamField query="-y, --yes" type="flag">
      Skip prompts and uninstall user-level MCP configuration.
    </ParamField>

    <ParamField query="--project" type="flag">
      Remove project-level MCP configuration from the current directory.
    </ParamField>

    <ParamField query="--keep-guidance" type="flag">
      Remove the MCP server configuration but leave the `githits-mcp` skill and managed instruction block in place. Useful when you want to disable the MCP server without losing the supporting agent context.
    </ParamField>

    To also remove stored credentials, run `npx githits@latest logout` separately after uninstalling.
  </Accordion>

  <Accordion title="npx githits@latest doctor" description="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**

    <ParamField query="--json" type="flag">
      Output diagnostics as JSON.
    </ParamField>
  </Accordion>
</AccordionGroup>

***

## Authentication

<AccordionGroup>
  <Accordion title="npx githits@latest login" description="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**

    <ParamField query="--no-browser" type="flag">
      Print the authorization URL instead of opening the browser. Use this in SSH sessions, CI environments, or containers where a browser isn't available.
    </ParamField>

    <ParamField query="--force" type="flag">
      Re-authenticate even if a valid token already exists.
    </ParamField>

    <ParamField query="--port" type="number">
      Use a specific port for the local OAuth callback server. Defaults to a random port in the 8000–9999 range.
    </ParamField>

    <CodeGroup>
      ```bash Standard login theme={null}
      npx githits@latest login
      ```

      ```bash SSH / headless login theme={null}
      npx githits@latest login --no-browser
      ```

      ```bash Force re-authentication theme={null}
      npx githits@latest login --force
      ```

      ```bash Specific callback port theme={null}
      npx githits@latest login --port 8080
      ```
    </CodeGroup>

    <Note>
      If authentication times out (after 5 minutes), the browser link expires. Run the command again to get a fresh link.
    </Note>
  </Accordion>

  <Accordion title="npx githits@latest logout" description="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>

  <Accordion title="npx githits@latest auth status" description="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>
</AccordionGroup>

***

## MCP server

<AccordionGroup>
  <Accordion title="npx githits@latest mcp" description="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>

  <Accordion title="npx githits@latest mcp start" description="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"]
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Search, code, package, and docs tools

<AccordionGroup>
  <Accordion title="npx githits@latest search" description="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 "<query>" --in <target>
    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
    ```

    Results include a `searchRef` you can pass to `npx githits@latest search-status` to poll for additional results from an async index scan.

    **Flags**

    <ParamField query="--in" type="string">
      Scope search to a package or repository target. Repeat for multiple targets. Package format: `npm:react@18.2.0` or `npm:react`. Repository formats include `github:owner/repo#ref` and `https://github.com/owner/repo#ref`.
    </ParamField>

    <ParamField query="--source" type="string">
      Restrict results to `docs`, `code`, or `symbol`. Omit to let GitHits choose the best indexed sources.
    </ParamField>

    <ParamField query="--kind" type="string">
      Restrict symbol results by kind, such as `function`, `method`, `class`, `interface`, `module`, or `doc_section`.
    </ParamField>

    <ParamField query="--category" type="string">
      Restrict symbol results by category: `callable`, `type`, `module`, `data`, or `documentation`.
    </ParamField>

    <ParamField query="--path-prefix" type="string">
      Restrict code or symbol results to paths under a literal prefix.
    </ParamField>

    <ParamField query="--intent" type="string">
      Restrict code or symbol results by file intent: `production`, `test`, `benchmark`, `example`, `generated`, `fixture`, `build`, or `vendor`.
    </ParamField>

    <ParamField query="--public" type="flag">
      Restrict symbol results to public symbols.
    </ParamField>

    <ParamField query="--name" type="string">
      Restrict symbol results to a specific symbol name.
    </ParamField>

    <ParamField query="--lang" type="string">
      Restrict results by programming language.
    </ParamField>

    <ParamField query="--allow-partial" type="flag">
      Return hits from sources that finished indexing while other sources continue.
    </ParamField>

    <ParamField query="--limit" type="number">
      Maximum results to return (1-100, default 10).
    </ParamField>

    <ParamField query="--offset" type="number">
      Offset for pagination.
    </ParamField>

    <ParamField query="--wait" type="number">
      Seconds to wait for indexing before returning a `searchRef` (0-60, default 20).
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest search-status" description="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 <searchRef>
    ```

    **Flags**

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest code files" description="List files in an indexed package or repository.">
    List the files included in an indexed package or repository.

    ```bash theme={null}
    npx githits@latest code files <spec> [path-prefix]
    npx githits@latest code files npm:express
    npx githits@latest code files npm:express src/
    npx githits@latest code files npm:express --ext ts --ext js
    ```

    **Flags**

    <ParamField query="--repo-url" type="string">
      Use a GitHub repository URL instead of a compact package or repo spec.
    </ParamField>

    <ParamField query="--git-ref" type="string">
      Git ref to use with `--repo-url`.
    </ParamField>

    <ParamField query="--path" type="string">
      Return one exact target-relative file path.
    </ParamField>

    <ParamField query="--glob" type="string">
      Include files matching a glob. Repeat for multiple globs.
    </ParamField>

    <ParamField query="--ext" type="string">
      Include files with this extension, without the leading dot. Repeat for multiple extensions.
    </ParamField>

    <ParamField query="--file-type" type="string">
      Include files with this file type. Repeat for multiple types.
    </ParamField>

    <ParamField query="--language" type="string">
      Include files with this language. Repeat for multiple languages.
    </ParamField>

    <ParamField query="--file-intent" type="string">
      Include files with this intent. Repeat for multiple intents.
    </ParamField>

    <ParamField query="--exclude-intent" type="string">
      Exclude files with this intent after inclusive filtering. Repeat for multiple intents.
    </ParamField>

    <ParamField query="--exclude-docs" type="flag">
      Exclude documentation files.
    </ParamField>

    <ParamField query="--exclude-tests" type="flag">
      Exclude test files.
    </ParamField>

    <ParamField query="--hidden" type="flag">
      Include hidden files.
    </ParamField>

    <ParamField query="--limit" type="number">
      Maximum files to return (default 200).
    </ParamField>

    <ParamField query="--wait" type="number">
      Milliseconds to wait for indexing (0-60000, default 20000).
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Include metadata with text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest code read" description="Read a specific indexed source file by path.">
    Read a specific file from an indexed package or repository by path.

    ```bash theme={null}
    npx githits@latest code read <spec> <path>
    npx githits@latest code read npm:express src/application.js
    npx githits@latest code read npm:express src/application.js --lines 120-200
    ```

    **Flags**

    <ParamField query="--repo-url" type="string">
      Use a GitHub repository URL instead of a compact package or repo spec.
    </ParamField>

    <ParamField query="--git-ref" type="string">
      Git ref to use with `--repo-url`.
    </ParamField>

    <ParamField query="--lines" type="string">
      Read an inclusive line range, such as `120-200`. You can also append `:120-200` to the file path.
    </ParamField>

    <ParamField query="--start" type="number">
      Starting line number for the read.
    </ParamField>

    <ParamField query="--end" type="number">
      Ending line number for the read.
    </ParamField>

    <ParamField query="--wait" type="number">
      Milliseconds to wait for indexing (0-60000, default 20000).
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Add a metadata header and line gutter to text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest code grep" description="Search indexed source files with literal text or regex.">
    Search for a text pattern across the indexed files of a package or repository.

    ```bash theme={null}
    npx githits@latest code grep <spec> <pattern>
    npx githits@latest code grep npm:express "Router"
    npx githits@latest code grep npm:express "use\(.*middleware" --regex
    npx githits@latest code grep npm:express "createServer" src/ --ext js
    ```

    **Flags**

    <ParamField query="--repo-url" type="string">
      Use a GitHub repository URL instead of a compact package or repo spec.
    </ParamField>

    <ParamField query="--git-ref" type="string">
      Git ref to use with `--repo-url`.
    </ParamField>

    <ParamField query="--path" type="string">
      Restrict grep to one exact target-relative file path.
    </ParamField>

    <ParamField query="--glob" type="string">
      Restrict grep to files matching a glob. Repeat for multiple globs.
    </ParamField>

    <ParamField query="--ext" type="string">
      Restrict grep to files with this extension, without the leading dot. Repeat for multiple extensions.
    </ParamField>

    <ParamField query="--regex" type="flag">
      Treat the pattern as a regex. Literal matching is the default.
    </ParamField>

    <ParamField query="--case-sensitive" type="flag">
      Use case-sensitive matching.
    </ParamField>

    <ParamField query="-C, --context" type="number">
      Include this many lines before and after each match.
    </ParamField>

    <ParamField query="-B, --before-context" type="number">
      Include this many lines before each match.
    </ParamField>

    <ParamField query="-A, --after-context" type="number">
      Include this many lines after each match.
    </ParamField>

    <ParamField query="--exclude-docs" type="flag">
      Exclude documentation files.
    </ParamField>

    <ParamField query="--exclude-tests" type="flag">
      Exclude test files.
    </ParamField>

    <ParamField query="--limit" type="number">
      Maximum matches to return (default 50).
    </ParamField>

    <ParamField query="--per-file-limit" type="number">
      Maximum matches to return per file.
    </ParamField>

    <ParamField query="--cursor" type="string">
      Pagination cursor from a previous grep response.
    </ParamField>

    <ParamField query="--symbol-field" type="string">
      Include a symbol field in grep output. Repeat for multiple fields.
    </ParamField>

    <ParamField query="--wait" type="number">
      Milliseconds to wait for indexing (0-60000, default 20000).
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Include additional metadata in text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest pkg info" description="Inspect package metadata, popularity, downloads, and vulnerability status.">
    Show a package overview including version, license, repository popularity, download counts, and vulnerability summary.

    ```bash theme={null}
    npx githits@latest pkg info <registry>:<package>
    npx githits@latest pkg info npm:express
    npx githits@latest pkg info pypi:requests --verbose
    ```

    **Flags**

    <ParamField query="-v, --verbose" type="flag">
      Include GitHub language/topics/last-pushed, recent advisories, and recent changes in text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>

    See [Package Inspection](/tools/package-inspection) for the full parameter reference.
  </Accordion>

  <Accordion title="npx githits@latest pkg vulns" description="List known CVE and OSV advisories for a package or version.">
    List CVE and OSV vulnerability advisories for a package or a specific version.

    ```bash theme={null}
    npx githits@latest pkg vulns <registry>:<package>
    npx githits@latest pkg vulns npm:lodash
    npx githits@latest pkg vulns npm:lodash@4.17.20 --severity high
    ```

    **Flags**

    <ParamField query="-s, --severity" type="string">
      Minimum advisory severity: `low`, `medium`, `high`, or `critical`.
    </ParamField>

    <ParamField query="--scope" type="string">
      Advisory rows to return: `affected` (default), `non_affecting`, or `all`.
    </ParamField>

    <ParamField query="--include-withdrawn" type="flag">
      Include retracted advisories.
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Show every selected advisory with full detail rows in text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest pkg deps" description="Show direct dependencies and optional transitive dependency details.">
    Show direct dependencies, dependency groups, and optionally the full transitive dependency graph.

    ```bash theme={null}
    npx githits@latest pkg deps <registry>:<package>
    npx githits@latest pkg deps npm:express
    npx githits@latest pkg deps npm:webpack --depth 3
    ```

    **Flags**

    <ParamField query="-l, --lifecycle" type="string">
      Dependency lifecycle breadth. Use `runtime`, `development`, `build`, `peer`, `optional`, or `all`.
    </ParamField>

    <ParamField query="--depth" type="number">
      Add transitive dependency data and cap traversal at this depth (1-10).
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Include additional dependency metadata in text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest pkg changelog" description="Retrieve release notes or changelog entries for packages and repos.">
    Retrieve release notes and changelog entries for a package or GitHub repository, newest-first.

    ```bash theme={null}
    npx githits@latest pkg changelog <registry>:<package>
    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 --repo-url https://github.com/expressjs/express
    ```

    **Flags**

    <ParamField query="--repo-url" type="string">
      Read changelog evidence from a GitHub repository URL instead of a registry package.
    </ParamField>

    <ParamField query="--from" type="string">
      Start of a version range. Use with `--to` for upgrade review evidence.
    </ParamField>

    <ParamField query="--to" type="string">
      End of a version range. Defaults to latest when `--from` is set.
    </ParamField>

    <ParamField query="--limit" type="number">
      Maximum latest-mode entries to return (1-50, default 10).
    </ParamField>

    <ParamField query="--git-ref" type="string">
      Git branch or tag for changelog-file sources.
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Show full body previews in text output.
    </ParamField>

    <ParamField query="--no-body" type="flag">
      Omit release body content and return only version, date, and URL timeline data.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest pkg upgrade-review" description="Compare package versions with security, changelog, and dependency evidence.">
    Report evidence for a package upgrade by comparing the current version with a target version. The command checks vulnerabilities, changelog range evidence, target deprecation metadata, peer dependency changes, dependency changes, and optional transitive evidence.

    ```bash theme={null}
    npx githits@latest pkg upgrade-review <registry>:<package>@<current> --to <target>
    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
    ```

    **Flags**

    <ParamField query="--to" type="string">
      Target version for single-package mode.
    </ParamField>

    <ParamField query="--package" type="string">
      Batch package spec in `<registry>:<name>@<current>..<target>` format. Repeat the flag for multiple packages.
    </ParamField>

    <ParamField query="--no-transitive-security" type="flag">
      Skip the transitive vulnerability summary diff.
    </ParamField>

    <ParamField query="--dependency-issues" type="flag">
      Include deprecated, outdated, duplicate, and conflict summary diffs.
    </ParamField>

    <ParamField query="--min-severity" type="string">
      Minimum direct-advisory severity: `low`, `medium`, `high`, or `critical`.
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Include dependency change examples in text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>

    See [Package Inspection](/tools/package-inspection) for the full parameter reference.
  </Accordion>

  <Accordion title="npx githits@latest docs list" description="List hosted and repo-backed documentation pages for a package.">
    List documentation pages available for a package.

    ```bash theme={null}
    npx githits@latest docs list <spec>
    npx githits@latest docs list npm:express
    npx githits@latest docs list pypi:requests --limit 20
    ```

    **Flags**

    <ParamField query="--limit" type="number">
      Maximum pages to return.
    </ParamField>

    <ParamField query="--after" type="string">
      Pagination cursor from a previous `docs list` response.
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Include additional page metadata in text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>

  <Accordion title="npx githits@latest docs read" description="Read a documentation page by page ID, optionally by line range.">
    Read a specific documentation page by its page ID.

    ```bash theme={null}
    npx githits@latest docs read <pageId>
    npx githits@latest docs read <pageId> --lines 50-150
    ```

    **Flags**

    <ParamField query="--lines" type="string">
      Read an inclusive line range, such as `50-150`.
    </ParamField>

    <ParamField query="-v, --verbose" type="flag">
      Include page metadata in text output.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>
</AccordionGroup>

***

## Code examples

<AccordionGroup>
  <Accordion title="npx githits@latest example" description="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 "<query>"
    ```

    **Flags**

    <ParamField query="-l, --lang" type="string">
      Force a specific programming language. Omit to let GitHits infer the language from your query. If you're unsure of the exact language name, run `npx githits@latest languages` first.
    </ParamField>

    <ParamField query="--license" type="string" default="strict">
      Control license filtering for Code Examples. Options: `strict` (default), `yolo`, or `custom`.
    </ParamField>

    <ParamField query="--explain" type="flag">
      Include an AI-generated explanation alongside the code example.
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON for piping or scripting. The envelope includes `result` and, when available, `solution_id`.
    </ParamField>

    <CodeGroup>
      ```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
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="npx githits@latest languages" description="List or filter supported programming language names.">
    List all supported programming language names. Optionally filter by a substring.

    ```bash theme={null}
    npx githits@latest languages [filter]
    ```

    ```bash theme={null}
    # List all supported languages
    npx githits@latest languages

    # Filter by substring
    npx githits@latest languages type
    ```

    **Flags**

    <ParamField query="--json" type="flag">
      Output the result as JSON.
    </ParamField>
  </Accordion>
</AccordionGroup>

***

## Feedback

<AccordionGroup>
  <Accordion title="npx githits@latest feedback" description="Rate a specific result or submit generic session feedback.">
    Submit feedback on a specific result or on your overall session. Use `--accept` for positive feedback and `--reject` for negative. A `--message` is recommended, especially for generic session feedback.

    ```bash theme={null}
    npx githits@latest feedback [solution_id] --accept | --reject [options]
    ```

    **Arguments**

    <ParamField path="solution_id" type="string">
      Optional. The solution ID from a prior `get_example` result. When provided, feedback is anchored to that specific result. Omit to submit generic session feedback.
    </ParamField>

    **Flags**

    <ParamField query="--accept" type="flag">
      Mark the result as helpful.
    </ParamField>

    <ParamField query="--reject" type="flag">
      Mark the result as unhelpful.
    </ParamField>

    <ParamField query="--message, -m" type="string">
      An explanation to accompany the feedback rating.
    </ParamField>

    <ParamField query="--tool" type="string">
      The command or MCP tool name being rated (e.g. `code_grep`, `search`).
    </ParamField>

    <ParamField query="--json" type="flag">
      Output the result as JSON for scripting or piping.
    </ParamField>

    <CodeGroup>
      ```bash Accept a specific result theme={null}
      npx githits@latest feedback abc123 --accept
      ```

      ```bash Reject with a message theme={null}
      npx githits@latest feedback abc123 --reject --message "Example was outdated"
      ```

      ```bash Generic session feedback theme={null}
      npx githits@latest feedback --accept --tool search --message "fast results for npm:lodash"
      ```

      ```bash JSON output theme={null}
      npx githits@latest feedback --reject --json
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>
