[{"data":1,"prerenderedAt":614},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fcloud-agents":139,"\u002Fdocs\u002Fcloud-agents-surround":609},[4],{"title":5,"path":6,"stem":7,"children":8,"page":138},"Docs","\u002Fdocs","docs",[9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134],{"title":10,"path":11,"stem":12},"AI harnesses: LLM tools, MCP servers and agents","\u002Fdocs\u002Fai-tools","docs\u002Fai-tools",{"title":14,"path":15,"stem":16},"Architecture","\u002Fdocs\u002Farchitecture","docs\u002Farchitecture",{"title":18,"path":19,"stem":20},"Web \u002F native bridges","\u002Fdocs\u002Fbridges","docs\u002Fbridges",{"title":22,"path":23,"stem":24},"Broadcast channels and tests","\u002Fdocs\u002Fchannels-and-tests","docs\u002Fchannels-and-tests",{"title":26,"path":27,"stem":28},"CLI reference","\u002Fdocs\u002Fcli","docs\u002Fcli",{"title":30,"path":31,"stem":32},"Cloud agent bootstrap","\u002Fdocs\u002Fcloud-agents","docs\u002Fcloud-agents",{"title":34,"path":35,"stem":36},"Completeness: how far an answer reaches","\u002Fdocs\u002Fcompleteness","docs\u002Fcompleteness",{"title":38,"path":39,"stem":40},"Configuration","\u002Fdocs\u002Fconfiguration","docs\u002Fconfiguration",{"title":42,"path":43,"stem":44},"External systems","\u002Fdocs\u002Fexternal","docs\u002Fexternal",{"title":46,"path":47,"stem":48},"Generated, copied and vendored files","\u002Fdocs\u002Fgenerated","docs\u002Fgenerated",{"title":50,"path":51,"stem":52},"Installing and updating cg","\u002Fdocs\u002Finstall","docs\u002Finstall",{"title":54,"path":55,"stem":56},"Java","\u002Fdocs\u002Fjava","docs\u002Fjava",{"title":58,"path":59,"stem":60},"Kotlin","\u002Fdocs\u002Fkotlin","docs\u002Fkotlin",{"title":62,"path":63,"stem":64},"Known limitations","\u002Fdocs\u002Flimitations","docs\u002Flimitations",{"title":66,"path":67,"stem":68,"children":69},"MCP server","\u002Fdocs\u002Fmcp","docs\u002Fmcp",[70],{"title":71,"path":72,"stem":73},"code-graph MCP: sample outputs (real calls via the MCP Python SDK stdio client)","\u002Fdocs\u002Fmcp\u002Fsample_outputs","docs\u002Fmcp\u002Fsample_outputs",{"title":75,"path":76,"stem":77},"Rust, C and C++","\u002Fdocs\u002Fnative","docs\u002Fnative",{"title":79,"path":80,"stem":81},"Port gaps: cg parity","\u002Fdocs\u002Fparity","docs\u002Fparity",{"title":83,"path":84,"stem":85},"PHP","\u002Fdocs\u002Fphp","docs\u002Fphp",{"title":87,"path":88,"stem":89},"Planned changes","\u002Fdocs\u002Fplans","docs\u002Fplans",{"title":91,"path":92,"stem":93},"Platform-specific code","\u002Fdocs\u002Fplatforms","docs\u002Fplatforms",{"title":95,"path":96,"stem":97},"Protocol links","\u002Fdocs\u002Fprotocols","docs\u002Fprotocols",{"title":99,"path":100,"stem":101},"Python","\u002Fdocs\u002Fpython","docs\u002Fpython",{"title":103,"path":104,"stem":105},"Quick start","\u002Fdocs\u002Fquickstart","docs\u002Fquickstart",{"title":107,"path":108,"stem":109},"Graph schema","\u002Fdocs\u002Fschema","docs\u002Fschema",{"title":111,"path":112,"stem":113},"Attack surface","\u002Fdocs\u002Fsurface","docs\u002Fsurface",{"title":115,"path":116,"stem":117},"Swift","\u002Fdocs\u002Fswift","docs\u002Fswift",{"title":119,"path":120,"stem":121},"TypeScript \u002F JavaScript frameworks","\u002Fdocs\u002Fts-frameworks","docs\u002Fts-frameworks",{"title":123,"path":124,"stem":125},"How we validate","\u002Fdocs\u002Fvalidation","docs\u002Fvalidation",{"title":127,"path":128,"stem":129},"Validation log","\u002Fdocs\u002Fvalidation-log","docs\u002Fvalidation-log",{"title":131,"path":132,"stem":133},"Value facts and resolutions","\u002Fdocs\u002Fvalue-facts","docs\u002Fvalue-facts",{"title":135,"path":136,"stem":137},"Visual view","\u002Fdocs\u002Fviz","docs\u002Fviz",false,{"id":140,"title":30,"body":141,"description":603,"extension":604,"meta":605,"navigation":606,"path":31,"seo":607,"stem":32,"__hash__":608},"docs\u002Fdocs\u002Fcloud-agents.md",{"type":142,"value":143,"toc":596},"minimark",[144,157,168,173,179,196,205,208,217,241,257,270,274,283,290,298,309,335,342,405,416,420,425,431,452,456,501,508,521,525,534,570,583,592],[145,146,147,148,152,153,156],"p",{},"A clean cloud or CI machine has no ",[149,150,151],"code",{},"cg"," on PATH and no MCP host config. Install the Python package, fix PATH, check freshness, read ",[149,154,155],{},"cg doctor",", then register MCP without a prompt.",[145,158,159,160,163,164,167],{},"cg is a Python package on PyPI named ",[149,161,162],{},"cg-code-graph",". It is not a Rust crate. ",[149,165,166],{},"cargo install cg-code-graph"," does not apply.",[169,170,172],"h2",{"id":171},"install","Install",[145,174,175,176,178],{},"Prefer an installer that puts ",[149,177,151],{}," on PATH:",[180,181,186],"pre",{"className":182,"code":183,"language":184,"meta":185,"style":185},"language-console shiki shiki-themes cg-light cg-light cg-dark","uv tool install cg-code-graph\n","console","",[149,187,188],{"__ignoreMap":185},[189,190,193],"span",{"class":191,"line":192},"line",1,[189,194,183],{"class":195},"snmWg",[180,197,199],{"className":182,"code":198,"language":184,"meta":185,"style":185},"pipx install cg-code-graph\n",[149,200,201],{"__ignoreMap":185},[189,202,203],{"class":191,"line":192},[189,204,198],{"class":195},[145,206,207],{},"With only pip:",[180,209,211],{"className":182,"code":210,"language":184,"meta":185,"style":185},"python -m pip install --user cg-code-graph\n",[149,212,213],{"__ignoreMap":185},[189,214,215],{"class":191,"line":192},[189,216,210],{"class":195},[145,218,219,220,222,223,226,227,229,230,232,233,236,237,240],{},"pip may install ",[149,221,151],{},", ",[149,224,225],{},"cg-mcp"," and ",[149,228,162],{}," into a user scripts directory that is not on PATH. Do not edit shell startup files from an agent. ",[149,231,155],{}," prints one ",[149,234,235],{},"export PATH=\"...\""," line (on Windows, ",[149,238,239],{},"set PATH=...",") when it can see that script. Until the directory is on PATH, start cg with the interpreter that installed it:",[180,242,244],{"className":182,"code":243,"language":184,"meta":185,"style":185},"python -m cg_code_graph --version\npython -m cg_code_graph doctor\n",[149,245,246,251],{"__ignoreMap":185},[189,247,248],{"class":191,"line":192},[189,249,250],{"class":195},"python -m cg_code_graph --version\n",[189,252,254],{"class":191,"line":253},2,[189,255,256],{"class":195},"python -m cg_code_graph doctor\n",[145,258,259,262,263,266,267,269],{},[149,260,261],{},"python -m cg_code_graph"," raises ",[149,264,265],{},"ModuleNotFoundError"," on a different interpreter than the one that ran pip. Use that interpreter, or the PATH line ",[149,268,155],{}," printed.",[169,271,273],{"id":272},"freshness","Freshness",[180,275,277],{"className":182,"code":276,"language":184,"meta":185,"style":185},"cg index . --db out\u002Fgraph.db\n",[149,278,279],{"__ignoreMap":185},[189,280,281],{"class":191,"line":192},[189,282,276],{"class":195},[145,284,285,286,289],{},"Indexing records the git commit in the database and in ",[149,287,288],{},"out\u002F.cg-head",":",[180,291,296],{"className":292,"code":294,"language":295,"meta":185},[293],"language-text","graph.db \u003Cfull sha>\n","text",[149,297,294],{"__ignoreMap":185},[145,299,300,301,304,305,308],{},"The same sha is written to ",[149,302,303],{},"out\u002Fgraph.db.cg-head",". Compare it with ",[149,306,307],{},"git rev-parse HEAD",". The same value means the graph matches HEAD. A different value means the graph is stale.",[145,310,311,314,315,318,319,322,323,326,327,330,331,334],{},[149,312,313],{},"cg refresh"," builds the replacement database at ",[149,316,317],{},"\u003Cdb>.refresh.tmp"," and renames it onto ",[149,320,321],{},"\u003Cdb>"," (",[149,324,325],{},"os.replace",": an atomic swap on the same filesystem). ",[149,328,329],{},".cg-head"," is written the same way: a sibling file whose name ends in ",[149,332,333],{},".tmp"," is renamed into place. A reader sees the previous file or the new file.",[145,336,337,338,341],{},"The MCP ",[149,339,340],{},"graphs"," tool reports that commit and a freshness word:",[343,344,345,358],"table",{},[346,347,348],"thead",{},[349,350,351,355],"tr",{},[352,353,354],"th",{},"Word",[352,356,357],{},"Meaning",[359,360,361,372,382,395],"tbody",{},[349,362,363,369],{},[364,365,366],"td",{},[149,367,368],{},"fresh",[364,370,371],{},"Recorded commit equals git HEAD",[349,373,374,379],{},[364,375,376],{},[149,377,378],{},"stale",[364,380,381],{},"Recorded commit differs from HEAD",[349,383,384,389],{},[364,385,386],{},[149,387,388],{},"missing",[364,390,391,392,394],{},"No ",[149,393,329],{}," line for this database and no commit stored in it",[349,396,397,402],{},[364,398,399],{},[149,400,401],{},"unknown",[364,403,404],{},"The stamp, the database, or git could not be read",[145,406,407,409,410,412,413,415],{},[149,408,401],{}," is a read failure. An absent stamp is ",[149,411,388],{},", not ",[149,414,401],{},".",[169,417,419],{"id":418},"heuristic-is-not-a-broken-install","Heuristic is not a broken install",[145,421,422,424],{},[149,423,155],{}," prints one row per language present in the project:",[180,426,429],{"className":427,"code":428,"language":295,"meta":185},[293],"  swift       heuristic   no Package.swift or .xcodeproj found (heuristic mode; ...)\n",[149,430,428],{"__ignoreMap":185},[145,432,433,436,437,440,441,444,445,447,448,451],{},[149,434,435],{},"heuristic"," means the tree-sitter layer indexed the files. ",[149,438,439],{},"exact"," means a compiler index ran. A heuristic Swift, Kotlin, Java, Rust or C\u002FC++ row is expected when the toolchain or the build file is absent. The ",[149,442,443],{},"fix:"," line under that row is how to get exact mode. It does not mean the cg package failed to install. ",[149,446,155],{}," also prints ",[149,449,450],{},"Not a Rust crate"," so the install stays on pip, pipx or uv.",[169,453,455],{"id":454},"compact-queries","Compact queries",[180,457,459],{"className":182,"code":458,"language":184,"meta":185,"style":185},"cg search Name --db out\u002Fgraph.db --kind function --limit 20\ncg snippet Name --db out\u002Fgraph.db --context 5 --max-lines 80\ncg impact Name --db out\u002Fgraph.db --max-depth 5 --no-paths\ncg node Name --db out\u002Fgraph.db --no-paths\ncg readers table:ledger --db out\u002Fgraph.db --no-paths\ncg writers Ledger.total --db out\u002Fgraph.db --no-paths\ncg explore \"who writes the ledger\" --db out\u002Fgraph.db --budget 1500 --max-symbols 3\n",[149,460,461,466,471,477,483,489,495],{"__ignoreMap":185},[189,462,463],{"class":191,"line":192},[189,464,465],{"class":195},"cg search Name --db out\u002Fgraph.db --kind function --limit 20\n",[189,467,468],{"class":191,"line":253},[189,469,470],{"class":195},"cg snippet Name --db out\u002Fgraph.db --context 5 --max-lines 80\n",[189,472,474],{"class":191,"line":473},3,[189,475,476],{"class":195},"cg impact Name --db out\u002Fgraph.db --max-depth 5 --no-paths\n",[189,478,480],{"class":191,"line":479},4,[189,481,482],{"class":195},"cg node Name --db out\u002Fgraph.db --no-paths\n",[189,484,486],{"class":191,"line":485},5,[189,487,488],{"class":195},"cg readers table:ledger --db out\u002Fgraph.db --no-paths\n",[189,490,492],{"class":191,"line":491},6,[189,493,494],{"class":195},"cg writers Ledger.total --db out\u002Fgraph.db --no-paths\n",[189,496,498],{"class":191,"line":497},7,[189,499,500],{"class":195},"cg explore \"who writes the ledger\" --db out\u002Fgraph.db --budget 1500 --max-symbols 3\n",[145,502,503,504,507],{},"Open a source file after ",[149,505,506],{},"search"," finds nothing for a computed property, a resource key, or a closure assignment. Those often have no symbol of their own.",[145,509,510,511,514,515,226,518,520],{},"An empty ",[149,512,513],{},"cg detect"," is not proof the tree has no sources. Check ",[149,516,517],{},"cg coverage",[149,519,155],{}," before treating the repository as empty.",[169,522,524],{"id":523},"mcp-when-no-host-is-configured","MCP when no host is configured",[180,526,528],{"className":182,"code":527,"language":184,"meta":185,"style":185},"cg install --yes --project\n",[149,529,530],{"__ignoreMap":185},[189,531,532],{"class":191,"line":192},[189,533,527],{"class":195},[145,535,536,539,540,543,544,547,548,551,552,555,556,222,559,222,562,565,566,569],{},[149,537,538],{},"--yes"," skips the confirmation prompt. When no MCP host config is present, it writes the Cursor project entry at ",[149,541,542],{},".cursor\u002Fmcp.json"," and the agent rules. ",[149,545,546],{},"--no-rules"," skips the rules. ",[149,549,550],{},"--dry-run"," prints the edit and writes nothing. Pass ",[149,553,554],{},"--host"," for another host (",[149,557,558],{},"claude",[149,560,561],{},"codex",[149,563,564],{},"vscode",", and the others ",[149,567,568],{},"cg install --help"," lists).",[145,571,572,573,576,577,226,579,582],{},"The CLI works without ",[149,574,575],{},"cg install",". Query with ",[149,578,151],{},[149,580,581],{},"--db"," when the MCP server is not registered.",[145,584,585,586,589,590,415],{},"More install options: ",[587,588,172],"a",{"href":51},". First queries: ",[587,591,103],{"href":104},[593,594,595],"style",{},"html pre.shiki code .snmWg, html code.shiki .snmWg{--shiki-light:#27272A;--shiki-default:#27272A;--shiki-dark:#E4E4E7}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":185,"searchDepth":479,"depth":253,"links":597},[598,599,600,601,602],{"id":171,"depth":253,"text":172},{"id":272,"depth":253,"text":273},{"id":418,"depth":253,"text":419},{"id":454,"depth":253,"text":455},{"id":523,"depth":253,"text":524},"A clean cloud or CI machine has no cg on PATH and no MCP host config. Install the Python package, fix PATH, check freshness, read cg doctor, then register MCP without a prompt.","md",{},true,{"title":30,"description":603},"_eEgpepvAPaRLzNwrGCMaXEm-5jd26_RL9qTvX3elXw",[610,612],{"title":26,"path":27,"stem":28,"description":611,"children":-1},"cg \u003Ccommand> is python -m cg_code_graph.cli \u003Ccommand>. Query commands need --db. Flags not listed here: cg \u003Ccommand> -h.",{"title":34,"path":35,"stem":36,"description":613,"children":-1},"Every positive answer has evidence (file:line, a confidence label). Completeness is the\nother half: which part of the repo that answer was drawn from, so \"no callers\" is reliable when\nthe index is complete, and an agent knows where to fall back to text search when it is not.",1794502972663]