Gitquarry Operator
Use this skill to drive gitquarry as a tool, not just to pick one benchmarked search preset.
Start Here
Load the version-matched copy from the installed CLI before choosing commands:
gitquarry skills get gitquarry
Use gitquarry agent as a shorthand for the same core guide.
Workflow
- Classify the task as
auth,search,inspect,compare,tree,code,recipe,mcp,config, or scripting. - Verify the effective host before assuming credentials or config state.
- Start with the narrowest command that solves the task.
- Prefer native
searchfirst. Turn on discover mode only when the request actually needs broader coverage, reranking, README evidence, or explain output. - Prefer structured flags over stuffing GitHub qualifiers into the free-text query.
- Keep enhanced behavior explicit. Do not imply that
discover,readme, or reranking are the default path. - Prefer
jsonorcompactplus--progress offfor scripts, CI, and agent runs.
Command Selection
- Use
gitquarry auth login|status|logoutfor credential work. - Use
gitquarry searchfor repository discovery and ranking. - Use
gitquarry inspect <owner/repo>when the target repository is already known. - Use
gitquarry compare <owner/repo>...when several known repositories need side-by-side evidence. - Use
gitquarry tree <owner/repo>when the task needs repository paths without cloning. - Use
gitquarry code <owner/repo> <pattern>when the task needs remote code search without cloning. - Use
gitquarry recipe run <file>when a checked-in TOML search recipe should be executed reproducibly. - Use
gitquarry mcponly when an MCP client will launch gitquarry as a stdio server. - Use
gitquarry config path|showwhen the task is about effective config state.
Tree And Code Rules
- Prefer
treeoversource pathwhen path inspection is enough and no local checkout is needed. - Prefer
codeoversource pathfor bounded literal or regex code search inside one known repository. - Add
--pathfilters,--depth,--limit, or--max-file-byteswhen a broad remote scan could be noisy or API-heavy. - Use
--referencewhen a branch, tag, or commit matters. - Use
--mode regexonly when regex semantics are required; literal search is the default.
Search Rules
- Start with
gitquarry search "<query>"unless the user explicitly needs enhanced discovery behavior. - Add structured filters such as
--language,--topic,--org,--user, star ranges, or date windows before escalating to discover mode. - Use
--mode discoveronly for broader candidate collection, local reranking, README-aware reranking, or explain-driven ranking analysis. - If discover mode is used and the task does not specify a rank, remember that gitquarry itself defaults to
blended. - If you are recommending a safer advanced preset to a human, prefer
--mode discover --depth balanced --rank quality --explain. - Add
--readmeonly as an explicit second pass when evidence matters more than latency. - Use
--planbefore network execution when the task is to debug compiled query, effective mode, rank, sort, limit, or estimated request count. - Use
--probe-pathand--probe-codewhen search results need explicit no-clone evidence without changing result order. - Keep probes bounded with
--probe-limit,--probe-match-limit, path filters, and--probe-max-file-byteswhen scanning broad repositories.
Compare And Recipe Rules
- Use
compareonly for explicit known repositories. It does not discover candidates or compute a trust score. - Add
--tree-summaryonly when file-layout counts matter. - Add
--readmeonly when README text is needed in the comparison output. - Prefer
recipe runfor shared, reviewed workflows in repos, docs, CI, or incident runbooks. - Do not put credentials in recipes. Use normal host-scoped auth or token environment variables.
- Treat CLI
--hostas higher precedence than recipehost.
MCP Rules
gitquarry mcpis a stdio JSON-RPC server for MCP clients; do not run it as an interactive terminal command unless you are testing JSON-RPC manually.- Register it with clients as
gitquarry mcp, for examplecodex mcp add gitquarry -- "$(command -v gitquarry)" mcp. - Use
--hostbeforemcpfor GitHub Enterprise, for examplegitquarry --host https://ghe.example.com mcp. - MCP tools return JSON command output as text content. Parse that text as JSON when structured fields matter.
- Available tools are
gitquarry_search,gitquarry_inspect,gitquarry_tree,gitquarry_code,gitquarry_compare, andgitquarry_skill. - Credentials come from the same environment, config, and host-scoped auth paths as normal CLI commands.
Output Rules
- Use
prettyfor human terminal reading. - Use
jsonfor structured automation. - Use
compactfor machine pipelines or logs. - Use
csvfor flat exports. - Prefer
--progress offin non-interactive runs.
Host And Auth Rules
- Treat credentials as host-scoped.
- Use
--hostwhen the target is GitHub Enterprise or a non-default API host. - Prefer host-specific env vars such as
GITQUARRY_TOKEN_GITHUB_COMwhen scripting against multiple hosts. - Use
GITQUARRY_CONFIG_DIRto isolate state in CI, tests, or agent runs. - Do not assume insecure credential fallback is allowed unless
GITQUARRY_ALLOW_INSECURE_STORAGE=1is explicitly set.
Failure Rules
- If a discover-only flag is used without
--mode discover, fix the command instead of guessing around the error. - If a raw query qualifier conflicts with a structured flag, remove one side of the conflict.
- If
inspectinput is notowner/repo, correct the repository shape before auth debugging. - If
compareinput is notowner/repo, correct the repository shape before auth debugging. - If
recipe runfails withE_RECIPE_INVALID, fix unknown keys, malformed TOML, or invalid mapped search flags. - If
treeorcodeis too broad, narrow with--path,--depth, or--limitbefore escalating tosource path. - If auth fails, verify token, host, and resolution order before changing search flags.
References
Read these only when needed:
references/benchmark-operator-playbook.mdfor the full operator playbook, command patterns, host/auth/scripting rules, and benchmark-backed discover heuristics.../docs/commands/search.mdxwhen exact search flag behavior matters.../docs/commands/inspect.mdxwhen the task is repository inspection rather than search.../docs/commands/tree.mdxwhen the task is remote repository tree inspection.../docs/commands/code.mdxwhen the task is no-clone code search.../docs/commands/compare.mdxwhen the task is side-by-side explicit repository comparison.../docs/commands/recipe.mdxwhen the task is checked-in search recipe execution.../docs/commands/mcp.mdxwhen the task is MCP server setup.../docs/guides/output-and-scripting.mdxwhen the task is CI, pipeline, or agent-safe usage.../docs/guides/github-enterprise-hosts.mdxwhen the task involves non-default hosts.
When recommending commands, explain whether the operator is buying native fidelity, broader coverage, or stronger evidence, and what latency or complexity that choice adds.