#
tokens: 46033/50000 3/422 files (page 15/22)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 15 of 22. Use http://codebase.md/shashankss1205/codegraphcontext?lines=true&page={x} to view the full context.

# Directory Structure

```
├── .cgcignore
├── .github
│   ├── FUNDING.yml
│   └── workflows
│       ├── e2e-tests.yml
│       ├── post_discord_invite.yml
│       ├── test.yml
│       └── update-contributors.yml
├── .gitignore
├── CLI_Commands.md
├── CONTRIBUTING.md
├── contributors.md
├── docs
│   ├── docs
│   │   ├── architecture.md
│   │   ├── cli.md
│   │   ├── contributing_languages.md
│   │   ├── contributing.md
│   │   ├── cookbook.md
│   │   ├── core.md
│   │   ├── future_work.md
│   │   ├── images
│   │   │   ├── 1.png
│   │   │   ├── 11.png
│   │   │   ├── 12.png
│   │   │   ├── 13.png
│   │   │   ├── 14.png
│   │   │   ├── 16.png
│   │   │   ├── 19.png
│   │   │   ├── 2.png
│   │   │   ├── 20.png
│   │   │   ├── 21.png
│   │   │   ├── 22.png
│   │   │   ├── 23.png
│   │   │   ├── 24.png
│   │   │   ├── 26.png
│   │   │   ├── 28.png
│   │   │   ├── 29.png
│   │   │   ├── 3.png
│   │   │   ├── 30.png
│   │   │   ├── 31.png
│   │   │   ├── 32.png
│   │   │   ├── 33.png
│   │   │   ├── 34.png
│   │   │   ├── 35.png
│   │   │   ├── 36.png
│   │   │   ├── 38.png
│   │   │   ├── 39.png
│   │   │   ├── 4.png
│   │   │   ├── 40.png
│   │   │   ├── 41.png
│   │   │   ├── 42.png
│   │   │   ├── 43.png
│   │   │   ├── 44.png
│   │   │   ├── 5.png
│   │   │   ├── 6.png
│   │   │   ├── 7.png
│   │   │   ├── 8.png
│   │   │   ├── 9.png
│   │   │   ├── Indexing.gif
│   │   │   ├── tool_images
│   │   │   │   ├── 1.png
│   │   │   │   ├── 2.png
│   │   │   │   └── 3.png
│   │   │   └── Usecase.gif
│   │   ├── index.md
│   │   ├── installation.md
│   │   ├── license.md
│   │   ├── server.md
│   │   ├── tools.md
│   │   ├── troubleshooting.md
│   │   ├── use_cases.md
│   │   └── watching.md
│   ├── mkdocs.yml
│   └── site
│       ├── 404.html
│       ├── architecture
│       │   └── index.html
│       ├── assets
│       │   ├── images
│       │   │   └── favicon.png
│       │   ├── javascripts
│       │   │   ├── bundle.79ae519e.min.js
│       │   │   ├── bundle.79ae519e.min.js.map
│       │   │   ├── lunr
│       │   │   │   ├── min
│       │   │   │   │   ├── lunr.ar.min.js
│       │   │   │   │   ├── lunr.da.min.js
│       │   │   │   │   ├── lunr.de.min.js
│       │   │   │   │   ├── lunr.du.min.js
│       │   │   │   │   ├── lunr.el.min.js
│       │   │   │   │   ├── lunr.es.min.js
│       │   │   │   │   ├── lunr.fi.min.js
│       │   │   │   │   ├── lunr.fr.min.js
│       │   │   │   │   ├── lunr.he.min.js
│       │   │   │   │   ├── lunr.hi.min.js
│       │   │   │   │   ├── lunr.hu.min.js
│       │   │   │   │   ├── lunr.hy.min.js
│       │   │   │   │   ├── lunr.it.min.js
│       │   │   │   │   ├── lunr.ja.min.js
│       │   │   │   │   ├── lunr.jp.min.js
│       │   │   │   │   ├── lunr.kn.min.js
│       │   │   │   │   ├── lunr.ko.min.js
│       │   │   │   │   ├── lunr.multi.min.js
│       │   │   │   │   ├── lunr.nl.min.js
│       │   │   │   │   ├── lunr.no.min.js
│       │   │   │   │   ├── lunr.pt.min.js
│       │   │   │   │   ├── lunr.ro.min.js
│       │   │   │   │   ├── lunr.ru.min.js
│       │   │   │   │   ├── lunr.sa.min.js
│       │   │   │   │   ├── lunr.stemmer.support.min.js
│       │   │   │   │   ├── lunr.sv.min.js
│       │   │   │   │   ├── lunr.ta.min.js
│       │   │   │   │   ├── lunr.te.min.js
│       │   │   │   │   ├── lunr.th.min.js
│       │   │   │   │   ├── lunr.tr.min.js
│       │   │   │   │   ├── lunr.vi.min.js
│       │   │   │   │   └── lunr.zh.min.js
│       │   │   │   ├── tinyseg.js
│       │   │   │   └── wordcut.js
│       │   │   └── workers
│       │   │       ├── search.2c215733.min.js
│       │   │       └── search.2c215733.min.js.map
│       │   └── stylesheets
│       │       ├── main.484c7ddc.min.css
│       │       ├── main.484c7ddc.min.css.map
│       │       ├── palette.ab4e12ef.min.css
│       │       └── palette.ab4e12ef.min.css.map
│       ├── cli
│       │   └── index.html
│       ├── contributing
│       │   └── index.html
│       ├── contributing_languages
│       │   └── index.html
│       ├── cookbook
│       │   └── index.html
│       ├── core
│       │   └── index.html
│       ├── future_work
│       │   └── index.html
│       ├── images
│       │   ├── 1.png
│       │   ├── 11.png
│       │   ├── 12.png
│       │   ├── 13.png
│       │   ├── 14.png
│       │   ├── 16.png
│       │   ├── 19.png
│       │   ├── 2.png
│       │   ├── 20.png
│       │   ├── 21.png
│       │   ├── 22.png
│       │   ├── 23.png
│       │   ├── 24.png
│       │   ├── 26.png
│       │   ├── 28.png
│       │   ├── 29.png
│       │   ├── 3.png
│       │   ├── 30.png
│       │   ├── 31.png
│       │   ├── 32.png
│       │   ├── 33.png
│       │   ├── 34.png
│       │   ├── 35.png
│       │   ├── 36.png
│       │   ├── 38.png
│       │   ├── 39.png
│       │   ├── 4.png
│       │   ├── 40.png
│       │   ├── 41.png
│       │   ├── 42.png
│       │   ├── 43.png
│       │   ├── 44.png
│       │   ├── 5.png
│       │   ├── 6.png
│       │   ├── 7.png
│       │   ├── 8.png
│       │   ├── 9.png
│       │   ├── Indexing.gif
│       │   ├── tool_images
│       │   │   ├── 1.png
│       │   │   ├── 2.png
│       │   │   └── 3.png
│       │   └── Usecase.gif
│       ├── index.html
│       ├── installation
│       │   └── index.html
│       ├── license
│       │   └── index.html
│       ├── search
│       │   └── search_index.json
│       ├── server
│       │   └── index.html
│       ├── sitemap.xml
│       ├── sitemap.xml.gz
│       ├── tools
│       │   └── index.html
│       ├── troubleshooting
│       │   └── index.html
│       ├── use_cases
│       │   └── index.html
│       └── watching
│           └── index.html
├── funding.json
├── images
│   ├── 1.png
│   ├── 11.png
│   ├── 12.png
│   ├── 13.png
│   ├── 14.png
│   ├── 16.png
│   ├── 19.png
│   ├── 2.png
│   ├── 20.png
│   ├── 21.png
│   ├── 22.png
│   ├── 23.png
│   ├── 24.png
│   ├── 26.png
│   ├── 28.png
│   ├── 29.png
│   ├── 3.png
│   ├── 30.png
│   ├── 31.png
│   ├── 32.png
│   ├── 33.png
│   ├── 34.png
│   ├── 35.png
│   ├── 36.png
│   ├── 38.png
│   ├── 39.png
│   ├── 4.png
│   ├── 40.png
│   ├── 41.png
│   ├── 42.png
│   ├── 43.png
│   ├── 44.png
│   ├── 5.png
│   ├── 6.png
│   ├── 7.png
│   ├── 8.png
│   ├── 9.png
│   ├── Indexing.gif
│   ├── tool_images
│   │   ├── 1.png
│   │   ├── 2.png
│   │   └── 3.png
│   └── Usecase.gif
├── LICENSE
├── MANIFEST.in
├── organizer
│   ├── CONTRIBUTING_LANGUAGES.md
│   ├── cookbook.md
│   ├── docs.md
│   ├── language_specific_nodes.md
│   ├── Tools_Exploration.md
│   └── troubleshoot.md
├── pyproject.toml
├── README.md
├── scripts
│   ├── generate_lang_contributors.py
│   ├── post_install_fix.sh
│   ├── test_all_parsers.py
│   └── update_language_parsers.py
├── SECURITY.md
├── src
│   └── codegraphcontext
│       ├── __init__.py
│       ├── __main__.py
│       ├── cli
│       │   ├── __init__.py
│       │   ├── cli_helpers.py
│       │   ├── config_manager.py
│       │   ├── main.py
│       │   ├── setup_macos.py
│       │   └── setup_wizard.py
│       ├── core
│       │   ├── __init__.py
│       │   ├── database_falkordb.py
│       │   ├── database.py
│       │   ├── falkor_worker.py
│       │   ├── jobs.py
│       │   └── watcher.py
│       ├── prompts.py
│       ├── server.py
│       ├── tools
│       │   ├── __init__.py
│       │   ├── advanced_language_query_tool.py
│       │   ├── code_finder.py
│       │   ├── graph_builder.py
│       │   ├── languages
│       │   │   ├── c.py
│       │   │   ├── cpp.py
│       │   │   ├── csharp.py
│       │   │   ├── go.py
│       │   │   ├── java.py
│       │   │   ├── javascript.py
│       │   │   ├── kotlin.py
│       │   │   ├── php.py
│       │   │   ├── python.py
│       │   │   ├── ruby.py
│       │   │   ├── rust.py
│       │   │   ├── scala.py
│       │   │   ├── swift.py
│       │   │   ├── typescript.py
│       │   │   └── typescriptjsx.py
│       │   ├── package_resolver.py
│       │   ├── query_tool_languages
│       │   │   ├── c_toolkit.py
│       │   │   ├── cpp_toolkit.py
│       │   │   ├── csharp_toolkit.py
│       │   │   ├── go_toolkit.py
│       │   │   ├── java_toolkit.py
│       │   │   ├── javascript_toolkit.py
│       │   │   ├── python_toolkit.py
│       │   │   ├── ruby_toolkit.py
│       │   │   ├── rust_toolkit.py
│       │   │   ├── scala_toolkit.py
│       │   │   ├── swift_toolkit.py
│       │   │   └── typescript_toolkit.py
│       │   └── system.py
│       └── utils
│           ├── debug_log.py
│           └── tree_sitter_manager.py
├── tests
│   ├── __init__.py
│   ├── conftest.py
│   ├── sample_project
│   │   ├── advanced_calls.py
│   │   ├── advanced_classes.py
│   │   ├── advanced_classes2.py
│   │   ├── advanced_functions.py
│   │   ├── advanced_imports.py
│   │   ├── async_features.py
│   │   ├── callbacks_decorators.py
│   │   ├── circular1.py
│   │   ├── circular2.py
│   │   ├── class_instantiation.py
│   │   ├── cli_and_dunder.py
│   │   ├── complex_classes.py
│   │   ├── comprehensions_generators.py
│   │   ├── context_managers.py
│   │   ├── control_flow.py
│   │   ├── datatypes.py
│   │   ├── dynamic_dispatch.py
│   │   ├── dynamic_imports.py
│   │   ├── edge_cases
│   │   │   ├── comments_only.py
│   │   │   ├── docstring_only.py
│   │   │   ├── empty.py
│   │   │   ├── hardcoded_secrets.py
│   │   │   ├── long_functions.py
│   │   │   └── syntax_error.py
│   │   ├── function_chains.py
│   │   ├── generators.py
│   │   ├── import_reexports.py
│   │   ├── mapping_calls.py
│   │   ├── module_a.py
│   │   ├── module_b.py
│   │   ├── module_c
│   │   │   ├── __init__.py
│   │   │   ├── submodule1.py
│   │   │   └── submodule2.py
│   │   ├── namespace_pkg
│   │   │   └── ns_module.py
│   │   ├── pattern_matching.py
│   │   └── typing_examples.py
│   ├── sample_project_c
│   │   ├── cgc_sample
│   │   ├── include
│   │   │   ├── config.h
│   │   │   ├── math
│   │   │   │   └── vec.h
│   │   │   ├── module.h
│   │   │   ├── platform.h
│   │   │   └── util.h
│   │   ├── Makefile
│   │   ├── README.md
│   │   └── src
│   │       ├── main.c
│   │       ├── math
│   │       │   └── vec.c
│   │       ├── module.c
│   │       └── util.c
│   ├── sample_project_cpp
│   │   ├── class_features.cpp
│   │   ├── classes.cpp
│   │   ├── control_flow.cpp
│   │   ├── edge_cases.cpp
│   │   ├── enum_struct_union.cpp
│   │   ├── exceptions.cpp
│   │   ├── file_io.cpp
│   │   ├── function_chain.cpp
│   │   ├── function_chain.h
│   │   ├── function_types.cpp
│   │   ├── main.cpp
│   │   ├── main.exe
│   │   ├── namespaces.cpp
│   │   ├── raii_example.cpp
│   │   ├── README.md
│   │   ├── sample_project.exe
│   │   ├── stl_usage.cpp
│   │   ├── templates.cpp
│   │   └── types_variable_assignments.cpp
│   ├── sample_project_csharp
│   │   ├── README.md
│   │   └── src
│   │       └── Example.App
│   │           ├── Attributes
│   │           │   └── CustomAttributes.cs
│   │           ├── Example.App.csproj
│   │           ├── Models
│   │           │   ├── Person.cs
│   │           │   ├── Point.cs
│   │           │   ├── Role.cs
│   │           │   └── User.cs
│   │           ├── OuterClass.cs
│   │           ├── Program.cs
│   │           ├── Services
│   │           │   ├── GreetingService.cs
│   │           │   ├── IGreetingService.cs
│   │           │   └── LegacyService.cs
│   │           └── Utils
│   │               ├── CollectionHelper.cs
│   │               └── FileHelper.cs
│   ├── sample_project_go
│   │   ├── advanced_types.go
│   │   ├── basic_functions.go
│   │   ├── embedded_composition.go
│   │   ├── error_handling.go
│   │   ├── generics.go
│   │   ├── go.mod
│   │   ├── goroutines_channels.go
│   │   ├── interfaces.go
│   │   ├── packages_imports.go
│   │   ├── README.md
│   │   ├── structs_methods.go
│   │   └── util
│   │       └── helpers.go
│   ├── sample_project_java
│   │   ├── out
│   │   │   └── com
│   │   │       └── example
│   │   │           └── app
│   │   │               ├── annotations
│   │   │               │   └── Logged.class
│   │   │               ├── Main.class
│   │   │               ├── misc
│   │   │               │   ├── Outer.class
│   │   │               │   └── Outer$Inner.class
│   │   │               ├── model
│   │   │               │   ├── Role.class
│   │   │               │   └── User.class
│   │   │               ├── service
│   │   │               │   ├── AbstractGreeter.class
│   │   │               │   ├── GreetingService.class
│   │   │               │   └── impl
│   │   │               │       └── GreetingServiceImpl.class
│   │   │               └── util
│   │   │                   ├── CollectionUtils.class
│   │   │                   └── IOHelper.class
│   │   ├── README.md
│   │   ├── sources.txt
│   │   └── src
│   │       └── com
│   │           └── example
│   │               └── app
│   │                   ├── annotations
│   │                   │   └── Logged.java
│   │                   ├── Main.java
│   │                   ├── misc
│   │                   │   └── Outer.java
│   │                   ├── model
│   │                   │   ├── Role.java
│   │                   │   └── User.java
│   │                   ├── service
│   │                   │   ├── AbstractGreeter.java
│   │                   │   ├── GreetingService.java
│   │                   │   └── impl
│   │                   │       └── GreetingServiceImpl.java
│   │                   └── util
│   │                       ├── CollectionUtils.java
│   │                       └── IOHelper.java
│   ├── sample_project_javascript
│   │   ├── arrays.js
│   │   ├── asyncAwait.js
│   │   ├── classes.js
│   │   ├── dom.js
│   │   ├── errorHandling.js
│   │   ├── events.js
│   │   ├── exporter.js
│   │   ├── fetchAPI.js
│   │   ├── fixtures
│   │   │   └── js
│   │   │       └── accessors.js
│   │   ├── functions.js
│   │   ├── importer.js
│   │   ├── objects.js
│   │   ├── promises.js
│   │   ├── README.md
│   │   └── variables.js
│   ├── sample_project_kotlin
│   │   ├── AdvancedClasses.kt
│   │   ├── Annotations.kt
│   │   ├── Coroutines.kt
│   │   ├── EdgeCases.kt
│   │   ├── Functions.kt
│   │   ├── Main.kt
│   │   ├── Properties.kt
│   │   └── User.kt
│   ├── sample_project_misc
│   │   ├── index.html
│   │   ├── README.md
│   │   ├── styles.css
│   │   ├── tables.css
│   │   └── tables.html
│   ├── sample_project_php
│   │   ├── classes_objects.php
│   │   ├── database.php
│   │   ├── edgecases.php
│   │   ├── error_handling.php
│   │   ├── file_handling.php
│   │   ├── functions.php
│   │   ├── generators_iterators.php
│   │   ├── globals_superglobals.php
│   │   ├── Inheritance.php
│   │   ├── interface_traits.php
│   │   └── README.md
│   ├── sample_project_ruby
│   │   ├── class_example.rb
│   │   ├── enumerables.rb
│   │   ├── error_handling.rb
│   │   ├── file_io.rb
│   │   ├── inheritance_example.rb
│   │   ├── main.rb
│   │   ├── metaprogramming.rb
│   │   ├── mixins_example.rb
│   │   ├── module_example.rb
│   │   └── tests
│   │       ├── test_mixins.py
│   │       └── test_sample.rb
│   ├── sample_project_rust
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src
│   │       ├── basic_functions.rs
│   │       ├── concurrency.rs
│   │       ├── error_handling.rs
│   │       ├── generics.rs
│   │       ├── iterators_closures.rs
│   │       ├── lib.rs
│   │       ├── lifetimes_references.rs
│   │       ├── modules.rs
│   │       ├── smart_pointers.rs
│   │       ├── structs_enums.rs
│   │       └── traits.rs
│   ├── sample_project_scala
│   │   ├── Animals.scala
│   │   ├── Complex.scala
│   │   ├── Functional.scala
│   │   ├── Geometry.scala
│   │   ├── Main.scala
│   │   ├── PackageObject.scala
│   │   ├── Script.sc
│   │   ├── Services.scala
│   │   ├── Shapes.scala
│   │   ├── Utils.scala
│   │   └── Variables.scala
│   ├── sample_project_swift
│   │   ├── Generics.swift
│   │   ├── Main.swift
│   │   ├── README.md
│   │   ├── Shapes.swift
│   │   ├── User.swift
│   │   └── Vehicles.swift
│   ├── sample_project_typescript
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── sample_tsx.tsx
│   │   ├── src
│   │   │   ├── advanced-types.ts
│   │   │   ├── async-promises.ts
│   │   │   ├── classes-inheritance.ts
│   │   │   ├── decorators-metadata.ts
│   │   │   ├── error-validation.ts
│   │   │   ├── functions-generics.ts
│   │   │   ├── index.ts
│   │   │   ├── modules-namespaces.ts
│   │   │   ├── types-interfaces.ts
│   │   │   └── utilities-helpers.ts
│   │   └── tsconfig.json
│   ├── test_cpp_parser.py
│   ├── test_database_validation.py
│   ├── test_end_to_end.py
│   ├── test_graph_indexing_js.py
│   ├── test_graph_indexing.py
│   ├── test_kotlin_parser.py
│   ├── test_swift_parser.py
│   ├── test_tree_sitter
│   │   ├── __init__.py
│   │   ├── class_instantiation.py
│   │   ├── complex_classes.py
│   │   └── test_file.py
│   ├── test_tree_sitter_manager.py
│   └── test_typescript_parser.py
├── visualize_graph.py
├── website
│   ├── .example.env
│   ├── .gitignore
│   ├── api
│   │   └── pypi.ts
│   ├── bun.lockb
│   ├── components.json
│   ├── eslint.config.js
│   ├── index.html
│   ├── package-lock.json
│   ├── package.json
│   ├── postcss.config.js
│   ├── public
│   │   ├── favicon.ico
│   │   ├── placeholder.svg
│   │   └── robots.txt
│   ├── README.md
│   ├── src
│   │   ├── App.css
│   │   ├── App.tsx
│   │   ├── assets
│   │   │   ├── function-calls.png
│   │   │   ├── graph-total.png
│   │   │   ├── hero-graph.jpg
│   │   │   └── hierarchy.png
│   │   ├── components
│   │   │   ├── ComparisonTable.tsx
│   │   │   ├── CookbookSection.tsx
│   │   │   ├── DemoSection.tsx
│   │   │   ├── ExamplesSection.tsx
│   │   │   ├── FeaturesSection.tsx
│   │   │   ├── Footer.tsx
│   │   │   ├── HeroSection.tsx
│   │   │   ├── InstallationSection.tsx
│   │   │   ├── MoveToTop.tsx
│   │   │   ├── ShowDownloads.tsx
│   │   │   ├── ShowStarGraph.tsx
│   │   │   ├── SocialMentionsTimeline.tsx
│   │   │   ├── TestimonialSection.tsx
│   │   │   ├── ThemeProvider.tsx
│   │   │   ├── ThemeToggle.tsx
│   │   │   └── ui
│   │   │       ├── accordion.tsx
│   │   │       ├── alert-dialog.tsx
│   │   │       ├── alert.tsx
│   │   │       ├── aspect-ratio.tsx
│   │   │       ├── avatar.tsx
│   │   │       ├── badge.tsx
│   │   │       ├── breadcrumb.tsx
│   │   │       ├── button.tsx
│   │   │       ├── calendar.tsx
│   │   │       ├── card.tsx
│   │   │       ├── carousel.tsx
│   │   │       ├── chart.tsx
│   │   │       ├── checkbox.tsx
│   │   │       ├── collapsible.tsx
│   │   │       ├── command.tsx
│   │   │       ├── context-menu.tsx
│   │   │       ├── dialog.tsx
│   │   │       ├── drawer.tsx
│   │   │       ├── dropdown-menu.tsx
│   │   │       ├── form.tsx
│   │   │       ├── hover-card.tsx
│   │   │       ├── input-otp.tsx
│   │   │       ├── input.tsx
│   │   │       ├── label.tsx
│   │   │       ├── menubar.tsx
│   │   │       ├── navigation-menu.tsx
│   │   │       ├── orbiting-circles.tsx
│   │   │       ├── pagination.tsx
│   │   │       ├── popover.tsx
│   │   │       ├── progress.tsx
│   │   │       ├── radio-group.tsx
│   │   │       ├── resizable.tsx
│   │   │       ├── scroll-area.tsx
│   │   │       ├── select.tsx
│   │   │       ├── separator.tsx
│   │   │       ├── sheet.tsx
│   │   │       ├── sidebar.tsx
│   │   │       ├── skeleton.tsx
│   │   │       ├── slider.tsx
│   │   │       ├── sonner.tsx
│   │   │       ├── switch.tsx
│   │   │       ├── table.tsx
│   │   │       ├── tabs.tsx
│   │   │       ├── textarea.tsx
│   │   │       ├── toast.tsx
│   │   │       ├── toaster.tsx
│   │   │       ├── toggle-group.tsx
│   │   │       ├── toggle.tsx
│   │   │       ├── tooltip.tsx
│   │   │       └── use-toast.ts
│   │   ├── hooks
│   │   │   ├── use-mobile.tsx
│   │   │   └── use-toast.ts
│   │   ├── index.css
│   │   ├── lib
│   │   │   └── utils.ts
│   │   ├── main.tsx
│   │   ├── pages
│   │   │   ├── Index.tsx
│   │   │   └── NotFound.tsx
│   │   └── vite-env.d.ts
│   ├── tailwind.config.ts
│   ├── tsconfig.app.json
│   ├── tsconfig.json
│   ├── tsconfig.node.json
│   ├── vercel.json
│   └── vite.config.ts
└── windows_setup_guide.md
```

# Files

--------------------------------------------------------------------------------
/docs/site/index.html:
--------------------------------------------------------------------------------

```html
  1 | 
  2 | <!doctype html>
  3 | <html lang="en" class="no-js">
  4 |   <head>
  5 |     
  6 |       <meta charset="utf-8">
  7 |       <meta name="viewport" content="width=device-width,initial-scale=1">
  8 |       
  9 |       
 10 |       
 11 |       
 12 |       
 13 |         <link rel="next" href="installation/">
 14 |       
 15 |       
 16 |         
 17 |       
 18 |       
 19 |       <link rel="icon" href="assets/images/favicon.png">
 20 |       <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.1">
 21 |     
 22 |     
 23 |       
 24 |         <title>CodeGraphContext</title>
 25 |       
 26 |     
 27 |     
 28 |       <link rel="stylesheet" href="assets/stylesheets/main.484c7ddc.min.css">
 29 |       
 30 |       
 31 | 
 32 | 
 33 |     
 34 |     
 35 |       
 36 |     
 37 |     
 38 |       
 39 |         
 40 |         
 41 |         <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 42 |         <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
 43 |         <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
 44 |       
 45 |     
 46 |     
 47 |     <script>__md_scope=new URL(".",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
 48 |     
 49 |       
 50 | 
 51 |     
 52 |     
 53 |   </head>
 54 |   
 55 |   
 56 |     <body dir="ltr">
 57 |   
 58 |     
 59 |     <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
 60 |     <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
 61 |     <label class="md-overlay" for="__drawer"></label>
 62 |     <div data-md-component="skip">
 63 |       
 64 |         
 65 |         <a href="#welcome-to-codegraphcontext" class="md-skip">
 66 |           Skip to content
 67 |         </a>
 68 |       
 69 |     </div>
 70 |     <div data-md-component="announce">
 71 |       
 72 |     </div>
 73 |     
 74 |     
 75 |       
 76 | 
 77 |   
 78 | 
 79 | <header class="md-header md-header--shadow" data-md-component="header">
 80 |   <nav class="md-header__inner md-grid" aria-label="Header">
 81 |     <a href="." title="CodeGraphContext" class="md-header__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
 82 |       
 83 |   
 84 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
 85 | 
 86 |     </a>
 87 |     <label class="md-header__button md-icon" for="__drawer">
 88 |       
 89 |       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
 90 |     </label>
 91 |     <div class="md-header__title" data-md-component="header-title">
 92 |       <div class="md-header__ellipsis">
 93 |         <div class="md-header__topic">
 94 |           <span class="md-ellipsis">
 95 |             CodeGraphContext
 96 |           </span>
 97 |         </div>
 98 |         <div class="md-header__topic" data-md-component="header-topic">
 99 |           <span class="md-ellipsis">
100 |             
101 |               Home
102 |             
103 |           </span>
104 |         </div>
105 |       </div>
106 |     </div>
107 |     
108 |     
109 |       <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
110 |     
111 |     
112 |     
113 |       
114 |       
115 |         <label class="md-header__button md-icon" for="__search">
116 |           
117 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
118 |         </label>
119 |         <div class="md-search" data-md-component="search" role="dialog">
120 |   <label class="md-search__overlay" for="__search"></label>
121 |   <div class="md-search__inner" role="search">
122 |     <form class="md-search__form" name="search">
123 |       <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
124 |       <label class="md-search__icon md-icon" for="__search">
125 |         
126 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
127 |         
128 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
129 |       </label>
130 |       <nav class="md-search__options" aria-label="Search">
131 |         
132 |         <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
133 |           
134 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
135 |         </button>
136 |       </nav>
137 |       
138 |     </form>
139 |     <div class="md-search__output">
140 |       <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
141 |         <div class="md-search-result" data-md-component="search-result">
142 |           <div class="md-search-result__meta">
143 |             Initializing search
144 |           </div>
145 |           <ol class="md-search-result__list" role="presentation"></ol>
146 |         </div>
147 |       </div>
148 |     </div>
149 |   </div>
150 | </div>
151 |       
152 |     
153 |     
154 |   </nav>
155 |   
156 | </header>
157 |     
158 |     <div class="md-container" data-md-component="container">
159 |       
160 |       
161 |         
162 |           
163 |         
164 |       
165 |       <main class="md-main" data-md-component="main">
166 |         <div class="md-main__inner md-grid">
167 |           
168 |             
169 |               
170 |               <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
171 |                 <div class="md-sidebar__scrollwrap">
172 |                   <div class="md-sidebar__inner">
173 |                     
174 | 
175 | 
176 | 
177 | <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
178 |   <label class="md-nav__title" for="__drawer">
179 |     <a href="." title="CodeGraphContext" class="md-nav__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
180 |       
181 |   
182 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
183 | 
184 |     </a>
185 |     CodeGraphContext
186 |   </label>
187 |   
188 |   <ul class="md-nav__list" data-md-scrollfix>
189 |     
190 |       
191 |       
192 |   
193 |   
194 |     
195 |   
196 |   
197 |   
198 |     <li class="md-nav__item md-nav__item--active">
199 |       
200 |       <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
201 |       
202 |       
203 |         
204 |       
205 |       
206 |       <a href="." class="md-nav__link md-nav__link--active">
207 |         
208 |   
209 |   
210 |   <span class="md-ellipsis">
211 |     
212 |   
213 |     Home
214 |   
215 | 
216 |     
217 |   </span>
218 |   
219 |   
220 | 
221 |       </a>
222 |       
223 |     </li>
224 |   
225 | 
226 |     
227 |       
228 |       
229 |   
230 |   
231 |   
232 |   
233 |     <li class="md-nav__item">
234 |       <a href="installation/" class="md-nav__link">
235 |         
236 |   
237 |   
238 |   <span class="md-ellipsis">
239 |     
240 |   
241 |     Installation
242 |   
243 | 
244 |     
245 |   </span>
246 |   
247 |   
248 | 
249 |       </a>
250 |     </li>
251 |   
252 | 
253 |     
254 |       
255 |       
256 |   
257 |   
258 |   
259 |   
260 |     <li class="md-nav__item">
261 |       <a href="use_cases/" class="md-nav__link">
262 |         
263 |   
264 |   
265 |   <span class="md-ellipsis">
266 |     
267 |   
268 |     Use Cases
269 |   
270 | 
271 |     
272 |   </span>
273 |   
274 |   
275 | 
276 |       </a>
277 |     </li>
278 |   
279 | 
280 |     
281 |       
282 |       
283 |   
284 |   
285 |   
286 |   
287 |     <li class="md-nav__item">
288 |       <a href="architecture/" class="md-nav__link">
289 |         
290 |   
291 |   
292 |   <span class="md-ellipsis">
293 |     
294 |   
295 |     Architecture
296 |   
297 | 
298 |     
299 |   </span>
300 |   
301 |   
302 | 
303 |       </a>
304 |     </li>
305 |   
306 | 
307 |     
308 |       
309 |       
310 |   
311 |   
312 |   
313 |   
314 |     <li class="md-nav__item">
315 |       <a href="cli/" class="md-nav__link">
316 |         
317 |   
318 |   
319 |   <span class="md-ellipsis">
320 |     
321 |   
322 |     CLI Reference
323 |   
324 | 
325 |     
326 |   </span>
327 |   
328 |   
329 | 
330 |       </a>
331 |     </li>
332 |   
333 | 
334 |     
335 |       
336 |       
337 |   
338 |   
339 |   
340 |   
341 |     <li class="md-nav__item">
342 |       <a href="watching/" class="md-nav__link">
343 |         
344 |   
345 |   
346 |   <span class="md-ellipsis">
347 |     
348 |   
349 |     Live Watching
350 |   
351 | 
352 |     
353 |   </span>
354 |   
355 |   
356 | 
357 |       </a>
358 |     </li>
359 |   
360 | 
361 |     
362 |       
363 |       
364 |   
365 |   
366 |   
367 |   
368 |     <li class="md-nav__item">
369 |       <a href="server/" class="md-nav__link">
370 |         
371 |   
372 |   
373 |   <span class="md-ellipsis">
374 |     
375 |   
376 |     Server
377 |   
378 | 
379 |     
380 |   </span>
381 |   
382 |   
383 | 
384 |       </a>
385 |     </li>
386 |   
387 | 
388 |     
389 |       
390 |       
391 |   
392 |   
393 |   
394 |   
395 |     <li class="md-nav__item">
396 |       <a href="core/" class="md-nav__link">
397 |         
398 |   
399 |   
400 |   <span class="md-ellipsis">
401 |     
402 |   
403 |     Core Concepts
404 |   
405 | 
406 |     
407 |   </span>
408 |   
409 |   
410 | 
411 |       </a>
412 |     </li>
413 |   
414 | 
415 |     
416 |       
417 |       
418 |   
419 |   
420 |   
421 |   
422 |     <li class="md-nav__item">
423 |       <a href="tools/" class="md-nav__link">
424 |         
425 |   
426 |   
427 |   <span class="md-ellipsis">
428 |     
429 |   
430 |     Tools
431 |   
432 | 
433 |     
434 |   </span>
435 |   
436 |   
437 | 
438 |       </a>
439 |     </li>
440 |   
441 | 
442 |     
443 |       
444 |       
445 |   
446 |   
447 |   
448 |   
449 |     <li class="md-nav__item">
450 |       <a href="cookbook/" class="md-nav__link">
451 |         
452 |   
453 |   
454 |   <span class="md-ellipsis">
455 |     
456 |   
457 |     Cookbook
458 |   
459 | 
460 |     
461 |   </span>
462 |   
463 |   
464 | 
465 |       </a>
466 |     </li>
467 |   
468 | 
469 |     
470 |       
471 |       
472 |   
473 |   
474 |   
475 |   
476 |     
477 |     
478 |     
479 |     
480 |     
481 |     <li class="md-nav__item md-nav__item--nested">
482 |       
483 |         
484 |         
485 |         <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" >
486 |         
487 |           
488 |           <label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
489 |             
490 |   
491 |   
492 |   <span class="md-ellipsis">
493 |     
494 |   
495 |     Contributing
496 |   
497 | 
498 |     
499 |   </span>
500 |   
501 |   
502 | 
503 |             <span class="md-nav__icon md-icon"></span>
504 |           </label>
505 |         
506 |         <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="false">
507 |           <label class="md-nav__title" for="__nav_11">
508 |             <span class="md-nav__icon md-icon"></span>
509 |             
510 |   
511 |     Contributing
512 |   
513 | 
514 |           </label>
515 |           <ul class="md-nav__list" data-md-scrollfix>
516 |             
517 |               
518 |                 
519 |   
520 |   
521 |   
522 |   
523 |     <li class="md-nav__item">
524 |       <a href="contributing/" class="md-nav__link">
525 |         
526 |   
527 |   
528 |   <span class="md-ellipsis">
529 |     
530 |   
531 |     Overview
532 |   
533 | 
534 |     
535 |   </span>
536 |   
537 |   
538 | 
539 |       </a>
540 |     </li>
541 |   
542 | 
543 |               
544 |             
545 |               
546 |                 
547 |   
548 |   
549 |   
550 |   
551 |     <li class="md-nav__item">
552 |       <a href="contributing_languages/" class="md-nav__link">
553 |         
554 |   
555 |   
556 |   <span class="md-ellipsis">
557 |     
558 |   
559 |     Adding New Languages
560 |   
561 | 
562 |     
563 |   </span>
564 |   
565 |   
566 | 
567 |       </a>
568 |     </li>
569 |   
570 | 
571 |               
572 |             
573 |           </ul>
574 |         </nav>
575 |       
576 |     </li>
577 |   
578 | 
579 |     
580 |       
581 |       
582 |   
583 |   
584 |   
585 |   
586 |     <li class="md-nav__item">
587 |       <a href="troubleshooting/" class="md-nav__link">
588 |         
589 |   
590 |   
591 |   <span class="md-ellipsis">
592 |     
593 |   
594 |     Troubleshooting
595 |   
596 | 
597 |     
598 |   </span>
599 |   
600 |   
601 | 
602 |       </a>
603 |     </li>
604 |   
605 | 
606 |     
607 |       
608 |       
609 |   
610 |   
611 |   
612 |   
613 |     <li class="md-nav__item">
614 |       <a href="future_work/" class="md-nav__link">
615 |         
616 |   
617 |   
618 |   <span class="md-ellipsis">
619 |     
620 |   
621 |     Future Work
622 |   
623 | 
624 |     
625 |   </span>
626 |   
627 |   
628 | 
629 |       </a>
630 |     </li>
631 |   
632 | 
633 |     
634 |       
635 |       
636 |   
637 |   
638 |   
639 |   
640 |     <li class="md-nav__item">
641 |       <a href="license/" class="md-nav__link">
642 |         
643 |   
644 |   
645 |   <span class="md-ellipsis">
646 |     
647 |   
648 |     License
649 |   
650 | 
651 |     
652 |   </span>
653 |   
654 |   
655 | 
656 |       </a>
657 |     </li>
658 |   
659 | 
660 |     
661 |   </ul>
662 | </nav>
663 |                   </div>
664 |                 </div>
665 |               </div>
666 |             
667 |             
668 |               
669 |               <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
670 |                 <div class="md-sidebar__scrollwrap">
671 |                   <div class="md-sidebar__inner">
672 |                     
673 | 
674 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
675 |   
676 |   
677 |   
678 |     
679 |   
680 |   
681 | </nav>
682 |                   </div>
683 |                 </div>
684 |               </div>
685 |             
686 |           
687 |           
688 |             <div class="md-content" data-md-component="content">
689 |               
690 |               <article class="md-content__inner md-typeset">
691 |                 
692 |                   
693 | 
694 | 
695 | 
696 | <h1 id="welcome-to-codegraphcontext">Welcome to CodeGraphContext</h1>
697 | <p>This is the official documentation for CodeGraphContext.</p>
698 | <hr />
699 | <h1 id="codegraphcontext">CodeGraphContext</h1>
700 | <!-- ====== Project stats ====== -->
701 | <p><a href="https://github.com/Shashankss1205/CodeGraphContext/stargazers"><img alt="Stars" src="https://img.shields.io/github/stars/Shashankss1205/CodeGraphContext?logo=github" /></a>
702 | <a href="https://github.com/Shashankss1205/CodeGraphContext/network/members"><img alt="Forks" src="https://img.shields.io/github/forks/Shashankss1205/CodeGraphContext?logo=github" /></a>
703 | <a href="https://github.com/Shashankss1205/CodeGraphContext/issues"><img alt="Open Issues" src="https://img.shields.io/github/issues-raw/Shashankss1205/CodeGraphContext?logo=github" /></a>
704 | <a href="https://github.com/Shashankss1205/CodeGraphContext/pulls"><img alt="Open PRs" src="https://img.shields.io/github/issues-pr/Shashankss1205/CodeGraphContext?logo=github" /></a>
705 | <a href="https://github.com/Shashankss1205/CodeGraphContext/pulls?q=is%3Apr+is%3Aclosed"><img alt="Closed PRs" src="https://img.shields.io/github/issues-pr-closed/Shashankss1205/CodeGraphContext?logo=github&amp;color=lightgrey" /></a>
706 | <a href="https://github.com/Shashankss1205/CodeGraphContext/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/Shashankss1205/CodeGraphContext?logo=github" /></a>
707 | <a href="https://github.com/Shashankss1205/CodeGraphContext"><img alt="Languages" src="https://img.shields.io/github/languages/count/Shashankss1205/CodeGraphContext?logo=github" /></a>
708 | <a href="https://github.com/Shashankss1205/CodeGraphContext/actions/workflows/test.yml"><img alt="Build Status" src="https://github.com/Shashankss1205/CodeGraphContext/actions/workflows/test.yml/badge.svg" /></a>
709 | <a href="https://github.com/Shashankss1205/CodeGraphContext/actions/workflows/e2e-tests.yml"><img alt="Build Status" src="https://github.com/Shashankss1205/CodeGraphContext/actions/workflows/e2e-tests.yml/badge.svg" /></a>
710 | <a href="https://pypi.org/project/codegraphcontext/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/codegraphcontext?" /></a>
711 | <a href="https://pypi.org/project/codegraphcontext/"><img alt="PyPI downloads" src="https://img.shields.io/pypi/dm/codegraphcontext?" /></a>
712 | <a href="license/"><img alt="License" src="https://img.shields.io/github/license/Shashankss1205/CodeGraphContext?" /></a>
713 | <a href="http://codegraphcontext.vercel.app/"><img alt="Website" src="https://img.shields.io/badge/website-up-brightgreen?" /></a>
714 | <a href="https://youtu.be/KYYSdxhg1xU"><img alt="YouTube" src="https://img.shields.io/badge/YouTube-Watch%20Demo-red?logo=youtube" /></a>
715 | <a href="https://discord.gg/dR4QY32uYQ"><img alt="Discord" src="https://img.shields.io/badge/Discord-Join%20Chat-7289da?logo=discord&amp;logoColor=white" /></a></p>
716 | <p>A powerful <strong>MCP server</strong> and <strong>CLI toolkit</strong> that indexes local code into a graph database to provide context to AI assistants and developers. Use it as a standalone CLI for comprehensive code analysis or connect it to your favorite AI IDE via MCP for AI-powered code understanding.</p>
717 | <h3 id="indexing-a-codebase-cli-or-mcp">Indexing a codebase (CLI or MCP)</h3>
718 | <p><img alt="Indexing using an MCP client" src="images/Indexing.gif" /></p>
719 | <h3 id="using-the-mcp-server">Using the MCP server</h3>
720 | <p><img alt="Using the MCP server" src="images/Usecase.gif" /></p>
721 | <h2 id="project-details">Project Details</h2>
722 | <ul>
723 | <li><strong>Version:</strong> 0.1.15</li>
724 | <li><strong>Authors:</strong> Shashank Shekhar Singh <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#115;&#104;&#97;&#115;&#104;&#97;&#110;&#107;&#115;&#104;&#101;&#107;&#104;&#97;&#114;&#115;&#105;&#110;&#103;&#104;&#49;&#50;&#48;&#53;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;">&#115;&#104;&#97;&#115;&#104;&#97;&#110;&#107;&#115;&#104;&#101;&#107;&#104;&#97;&#114;&#115;&#105;&#110;&#103;&#104;&#49;&#50;&#48;&#53;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;</a></li>
725 | <li><strong>License:</strong> MIT License (See <a href="license/">LICENSE</a> for details)</li>
726 | <li><strong>Website:</strong> <a href="http://codegraphcontext.vercel.app/">CodeGraphContext</a></li>
727 | </ul>
728 | <h2 id="star-history">Star History</h2>
729 | <p><a href="https://www.star-history.com/#Shashankss1205/CodeGraphContext&amp;Date"><img alt="Star History Chart" src="https://api.star-history.com/svg?repos=Shashankss1205/CodeGraphContext&amp;type=Date" /></a></p>
730 | <h2 id="features">Features</h2>
731 | <ul>
732 | <li><strong>Code Indexing:</strong> Analyzes code and builds a knowledge graph of its components.</li>
733 | <li><strong>Relationship Analysis:</strong> Query for callers, callees, class hierarchies, call chains and more.</li>
734 | <li><strong>Live File Watching:</strong> Watch directories for changes and automatically update the graph in real-time (<code>cgc watch</code>).</li>
735 | <li><strong>Interactive Setup:</strong> A user-friendly command-line wizard for easy setup.</li>
736 | <li><strong>Dual Mode:</strong> Works as a standalone <strong>CLI toolkit</strong> for developers and as an <strong>MCP server</strong> for AI agents.</li>
737 | <li><strong>Multi-Language Support:</strong> Full support for 11 programming languages.</li>
738 | <li><strong>Flexible Database Backend:</strong> FalkorDB Lite (default, inbuilt for Unix) or Neo4j (all platforms via Docker/WSL/native).</li>
739 | <li><strong>File Exclusion:</strong> Supports <code>.cgcignore</code> files to exclude specific files and directories from indexing.</li>
740 | </ul>
741 | <h2 id="used-by">Used By</h2>
742 | <p>CodeGraphContext is already being explored by developers and projects for:</p>
743 | <ul>
744 | <li><strong>Static code analysis in AI assistants</strong></li>
745 | <li><strong>Graph-based visualization of projects</strong></li>
746 | <li><strong>Dead code and complexity detection</strong></li>
747 | </ul>
748 | <p>If you’re using CodeGraphContext in your project, feel free to open a PR and add it here! 🚀</p>
749 | <h2 id="dependencies">Dependencies</h2>
750 | <ul>
751 | <li><code>neo4j&gt;=5.15.0</code></li>
752 | <li><code>watchdog&gt;=3.0.0</code></li>
753 | <li><code>requests&gt;=2.31.0</code></li>
754 | <li><code>stdlibs&gt;=2023.11.18</code></li>
755 | <li><code>typer[all]&gt;=0.9.0</code></li>
756 | <li><code>rich&gt;=13.7.0</code></li>
757 | <li><code>inquirerpy&gt;=0.3.4</code></li>
758 | <li><code>python-dotenv&gt;=1.0.0</code></li>
759 | <li><code>tree-sitter==0.20.4</code></li>
760 | <li><code>tree-sitter-languages==1.10.2</code></li>
761 | </ul>
762 | <h2 id="getting-started">Getting Started</h2>
763 | <ol>
764 | <li><strong>Install:</strong> <code>pip install codegraphcontext</code></li>
765 | <li>
766 | <p><strong>Configure Your Environment:</strong>
767 |     Run the interactive setup wizard to connect to your database and configure your IDE:
768 |     <code>bash
769 |     cgc mcp setup</code>
770 |     This ensures your IDE is configured. To configure a Neo4j database, use <code>cgc neo4j setup</code>.
771 |     The wizard helps you with:</p>
772 | <ul>
773 | <li><strong>Database Connection:</strong><ul>
774 | <li><strong>Docker (Recommended):</strong> Automatically sets up a local Neo4j instance.</li>
775 | <li><strong>Linux Binary:</strong> Installs Neo4j directly on Debian-based systems.</li>
776 | <li><strong>Hosted:</strong> Connects to a remote Neo4j database like AuraDB.</li>
777 | </ul>
778 | </li>
779 | <li><strong>IDE Integration:</strong><ul>
780 | <li>Automatically configures tools like VS Code, Cursor, Gemini CLI, and more.</li>
781 | <li>Generates the necessary <code>mcp.json</code> and <code>.env</code> files for you.</li>
782 | </ul>
783 | </li>
784 | </ul>
785 | </li>
786 | <li>
787 | <p><strong>Start:</strong> <code>cgc mcp start</code></p>
788 | </li>
789 | </ol>
790 | <h2 id="mcp-client-configuration">MCP Client Configuration</h2>
791 | <p>The <code>cgc mcp setup</code> command attempts to automatically configure your IDE/CLI. If you choose not to use the automatic setup, or if your tool is not supported, you can configure it manually.</p>
792 | <p>Add the following server configuration to your client's settings file (e.g., VS Code's <code>settings.json</code> or <code>.claude.json</code>):</p>
793 | <pre><code class="language-json">{
794 |   &quot;mcpServers&quot;: {
795 |     &quot;CodeGraphContext&quot;: {
796 |       &quot;command&quot;: &quot;cgc&quot;,
797 |       &quot;args&quot;: [
798 |         &quot;mcp&quot;,
799 |         &quot;start&quot;
800 |       ],
801 |       &quot;env&quot;: {
802 |         &quot;NEO4J_URI&quot;: &quot;YOUR_NEO4J_URI&quot;,
803 |         &quot;NEO4J_USERNAME&quot;: &quot;YOUR_NEO4J_USERNAME&quot;,
804 |         &quot;NEO4J_PASSWORD&quot;: &quot;YOUR_NEO4J_PASSWORD&quot;
805 |       },
806 |       &quot;tools&quot;: {
807 |         &quot;alwaysAllow&quot;: [
808 |           &quot;add_code_to_graph&quot;,
809 |           &quot;add_package_to_graph&quot;,
810 |           &quot;check_job_status&quot;,
811 |           &quot;list_jobs&quot;,
812 |           &quot;find_code&quot;,
813 |           &quot;analyze_code_relationships&quot;,
814 |           &quot;watch_directory&quot;,
815 |           &quot;find_dead_code&quot;,
816 |           &quot;execute_cypher_query&quot;,
817 |           &quot;calculate_cyclomatic_complexity&quot;,
818 |           &quot;find_most_complex_functions&quot;,
819 |           &quot;list_indexed_repositories&quot;,
820 |           &quot;delete_repository&quot;,
821 |           &quot;visualize_graph_query&quot;,
822 |           &quot;list_watched_paths&quot;,
823 |           &quot;unwatch_directory&quot;
824 |         ],
825 |         &quot;disabled&quot;: false
826 |       },
827 |       &quot;disabled&quot;: false,
828 |       &quot;alwaysAllow&quot;: []
829 |     }
830 |   }
831 | }
832 | </code></pre>
833 | <h2 id="natural-language-interaction-examples">Natural Language Interaction Examples</h2>
834 | <p>Once the server is running, you can interact with it through your AI assistant using plain English. Here are some examples of what you can say:</p>
835 | <h3 id="indexing-and-watching-files">Indexing and Watching Files</h3>
836 | <ul>
837 | <li>
838 | <p><strong>To index a new project:</strong></p>
839 | <ul>
840 | <li>"Please index the code in the <code>/path/to/my-project</code> directory."
841 | OR</li>
842 | <li>"Add the project at <code>~/dev/my-other-project</code> to the code graph."</li>
843 | </ul>
844 | </li>
845 | <li>
846 | <p><strong>To start watching a directory for live changes:</strong></p>
847 | <ul>
848 | <li>"Watch the <code>/path/to/my-active-project</code> directory for changes."
849 | OR</li>
850 | <li>"Keep the code graph updated for the project I'm working on at <code>~/dev/main-app</code>."</li>
851 | </ul>
852 | <p>When you ask to watch a directory, the system performs two actions at once:
853 | 1.  It kicks off a full scan to index all the code in that directory. This process runs in the background, and you'll receive a <code>job_id</code> to track its progress.
854 | 2.  It begins watching the directory for any file changes to keep the graph updated in real-time.</p>
855 | <p>This means you can start by simply telling the system to watch a directory, and it will handle both the initial indexing and the continuous updates automatically.</p>
856 | </li>
857 | </ul>
858 | <h3 id="querying-and-understanding-code">Querying and Understanding Code</h3>
859 | <ul>
860 | <li>
861 | <p><strong>Finding where code is defined:</strong></p>
862 | <ul>
863 | <li>"Where is the <code>process_payment</code> function?"</li>
864 | <li>"Find the <code>User</code> class for me."</li>
865 | <li>"Show me any code related to 'database connection'."</li>
866 | </ul>
867 | </li>
868 | <li>
869 | <p><strong>Analyzing relationships and impact:</strong></p>
870 | <ul>
871 | <li>"What other functions call the <code>get_user_by_id</code> function?"</li>
872 | <li>"If I change the <code>calculate_tax</code> function, what other parts of the code will be affected?"</li>
873 | <li>"Show me the inheritance hierarchy for the <code>BaseController</code> class."</li>
874 | <li>"What methods does the <code>Order</code> class have?"</li>
875 | </ul>
876 | </li>
877 | <li>
878 | <p><strong>Exploring dependencies:</strong></p>
879 | <ul>
880 | <li>"Which files import the <code>requests</code> library?"</li>
881 | <li>"Find all implementations of the <code>render</code> method."</li>
882 | </ul>
883 | </li>
884 | <li>
885 | <p><strong>Advanced Call Chain and Dependency Tracking (Spanning Hundreds of Files):</strong>
886 |     The CodeGraphContext excels at tracing complex execution flows and dependencies across vast codebases. Leveraging the power of graph databases, it can identify direct and indirect callers and callees, even when a function is called through multiple layers of abstraction or across numerous files. This is invaluable for:</p>
887 | <ul>
888 | <li><strong>Impact Analysis:</strong> Understand the full ripple effect of a change to a core function.</li>
889 | <li><strong>Debugging:</strong> Trace the path of execution from an entry point to a specific bug.</li>
890 | <li>
891 | <p><strong>Code Comprehension:</strong> Grasp how different parts of a large system interact.</p>
892 | </li>
893 | <li>
894 | <p>"Show me the full call chain from the <code>main</code> function to <code>process_data</code>."</p>
895 | </li>
896 | <li>"Find all functions that directly or indirectly call <code>validate_input</code>."</li>
897 | <li>"What are all the functions that <code>initialize_system</code> eventually calls?"</li>
898 | <li>"Trace the dependencies of the <code>DatabaseManager</code> module."</li>
899 | </ul>
900 | </li>
901 | <li>
902 | <p><strong>Code Quality and Maintenance:</strong></p>
903 | <ul>
904 | <li>"Is there any dead or unused code in this project?"</li>
905 | <li>"Calculate the cyclomatic complexity of the <code>process_data</code> function in <code>src/utils.py</code>."</li>
906 | <li>"Find the 5 most complex functions in the codebase."</li>
907 | </ul>
908 | </li>
909 | <li>
910 | <p><strong>Repository Management:</strong></p>
911 | <ul>
912 | <li>"List all currently indexed repositories."</li>
913 | <li>"Delete the indexed repository at <code>/path/to/old-project</code>."</li>
914 | </ul>
915 | </li>
916 | </ul>
917 | <h2 id="social-coverage">Social Coverage</h2>
918 | <ul>
919 | <li><strong>Youtube:</strong> <a href="https://www.youtube.com/watch?v=KYYSdxhg1xU">https://www.youtube.com/watch?v=KYYSdxhg1xU</a></li>
920 | <li><strong>Blog:</strong> <a href="https://medium.com/@shashankshekharsingh1205/building-codegraphcontext-my-end-term-journey-in-summer-of-bitcoin-2025-422c9a4dc87e">https://medium.com/@shashankshekharsingh1205/building-codegraphcontext-my-end-term-journey-in-summer-of-bitcoin-2025-422c9a4dc87e</a></li>
921 | <li><strong>Twitter:</strong> <a href="https://x.com/braidpool/status/1968683721625637203">https://x.com/braidpool/status/1968683721625637203</a></li>
922 | <li><strong>PulseMCP:</strong> <a href="https://www.pulsemcp.com/servers/codegraphcontext">https://www.pulsemcp.com/servers/codegraphcontext</a></li>
923 | <li><strong>MCPMarket:</strong> <a href="https://mcpmarket.com/server/codegraphcontext">https://mcpmarket.com/server/codegraphcontext</a></li>
924 | <li><strong>Playbooks:</strong> <a href="https://playbooks.com/mcp/codegraphcontext">https://playbooks.com/mcp/codegraphcontext</a></li>
925 | <li><strong>MCPHunt:</strong> <a href="https://mcp-hunt.com/mcp/server/codegraphcontext">https://mcp-hunt.com/mcp/server/codegraphcontext</a></li>
926 | <li><strong>StackerNews:</strong> <a href="https://stacker.news/items/1227191">https://stacker.news/items/1227191</a></li>
927 | <li><strong>Glama.ai:</strong> <a href="https://glama.ai/mcp/servers/@Shashankss1205/CodeGraphContext/blob/a346d340d8f705ce93626b4b322dd0e2823ba46b/src/codegraphcontext/core/jobs.py">https://glama.ai/mcp/servers/@Shashankss1205/CodeGraphContext/blob/a346d340d8f705ce93626b4b322dd0e2823ba46b/src/codegraphcontext/core/jobs.py</a></li>
928 | </ul>
929 | <h2 id="contributing">Contributing</h2>
930 | <p>Contributions are welcome! 🎉<br />
931 | Please see our <a href="contributing/">CONTRIBUTING.md</a> for detailed guidelines.
932 | If you have ideas for new features, integrations, or improvements, open an <a href="https://github.com/Shashankss1205/CodeGraphContext/issues">issue</a> or submit a Pull Request.</p>
933 | <p>Join discussions and help shape the future of CodeGraphContext.</p>
934 | 
935 | 
936 | 
937 | 
938 | 
939 | 
940 | 
941 | 
942 | 
943 | 
944 | 
945 | 
946 |                 
947 |               </article>
948 |             </div>
949 |           
950 |           
951 | <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
952 |         </div>
953 |         
954 |       </main>
955 |       
956 |         <footer class="md-footer">
957 |   
958 |   <div class="md-footer-meta md-typeset">
959 |     <div class="md-footer-meta__inner md-grid">
960 |       <div class="md-copyright">
961 |   
962 |   
963 |     Made with
964 |     <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
965 |       Material for MkDocs
966 |     </a>
967 |   
968 | </div>
969 |       
970 |     </div>
971 |   </div>
972 | </footer>
973 |       
974 |     </div>
975 |     <div class="md-dialog" data-md-component="dialog">
976 |       <div class="md-dialog__inner md-typeset"></div>
977 |     </div>
978 |     
979 |     
980 |     
981 |       
982 |       
983 |       <script id="__config" type="application/json">{"annotate": null, "base": ".", "features": [], "search": "assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
984 |     
985 |     
986 |       <script src="assets/javascripts/bundle.79ae519e.min.js"></script>
987 |       
988 |     
989 |   </body>
990 | </html>
```

--------------------------------------------------------------------------------
/docs/site/watching/index.html:
--------------------------------------------------------------------------------

```html
   1 | 
   2 | <!doctype html>
   3 | <html lang="en" class="no-js">
   4 |   <head>
   5 |     
   6 |       <meta charset="utf-8">
   7 |       <meta name="viewport" content="width=device-width,initial-scale=1">
   8 |       
   9 |       
  10 |       
  11 |       
  12 |         <link rel="prev" href="../cli/">
  13 |       
  14 |       
  15 |         <link rel="next" href="../server/">
  16 |       
  17 |       
  18 |         
  19 |       
  20 |       
  21 |       <link rel="icon" href="../assets/images/favicon.png">
  22 |       <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.1">
  23 |     
  24 |     
  25 |       
  26 |         <title>Live Watching - CodeGraphContext</title>
  27 |       
  28 |     
  29 |     
  30 |       <link rel="stylesheet" href="../assets/stylesheets/main.484c7ddc.min.css">
  31 |       
  32 |       
  33 | 
  34 | 
  35 |     
  36 |     
  37 |       
  38 |     
  39 |     
  40 |       
  41 |         
  42 |         
  43 |         <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  44 |         <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
  45 |         <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
  46 |       
  47 |     
  48 |     
  49 |     <script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
  50 |     
  51 |       
  52 | 
  53 |     
  54 |     
  55 |   </head>
  56 |   
  57 |   
  58 |     <body dir="ltr">
  59 |   
  60 |     
  61 |     <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
  62 |     <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
  63 |     <label class="md-overlay" for="__drawer"></label>
  64 |     <div data-md-component="skip">
  65 |       
  66 |         
  67 |         <a href="#live-file-watching" class="md-skip">
  68 |           Skip to content
  69 |         </a>
  70 |       
  71 |     </div>
  72 |     <div data-md-component="announce">
  73 |       
  74 |     </div>
  75 |     
  76 |     
  77 |       
  78 | 
  79 |   
  80 | 
  81 | <header class="md-header md-header--shadow" data-md-component="header">
  82 |   <nav class="md-header__inner md-grid" aria-label="Header">
  83 |     <a href=".." title="CodeGraphContext" class="md-header__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
  84 |       
  85 |   
  86 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
  87 | 
  88 |     </a>
  89 |     <label class="md-header__button md-icon" for="__drawer">
  90 |       
  91 |       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
  92 |     </label>
  93 |     <div class="md-header__title" data-md-component="header-title">
  94 |       <div class="md-header__ellipsis">
  95 |         <div class="md-header__topic">
  96 |           <span class="md-ellipsis">
  97 |             CodeGraphContext
  98 |           </span>
  99 |         </div>
 100 |         <div class="md-header__topic" data-md-component="header-topic">
 101 |           <span class="md-ellipsis">
 102 |             
 103 |               Live Watching
 104 |             
 105 |           </span>
 106 |         </div>
 107 |       </div>
 108 |     </div>
 109 |     
 110 |     
 111 |       <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
 112 |     
 113 |     
 114 |     
 115 |       
 116 |       
 117 |         <label class="md-header__button md-icon" for="__search">
 118 |           
 119 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
 120 |         </label>
 121 |         <div class="md-search" data-md-component="search" role="dialog">
 122 |   <label class="md-search__overlay" for="__search"></label>
 123 |   <div class="md-search__inner" role="search">
 124 |     <form class="md-search__form" name="search">
 125 |       <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
 126 |       <label class="md-search__icon md-icon" for="__search">
 127 |         
 128 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
 129 |         
 130 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
 131 |       </label>
 132 |       <nav class="md-search__options" aria-label="Search">
 133 |         
 134 |         <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
 135 |           
 136 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
 137 |         </button>
 138 |       </nav>
 139 |       
 140 |     </form>
 141 |     <div class="md-search__output">
 142 |       <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
 143 |         <div class="md-search-result" data-md-component="search-result">
 144 |           <div class="md-search-result__meta">
 145 |             Initializing search
 146 |           </div>
 147 |           <ol class="md-search-result__list" role="presentation"></ol>
 148 |         </div>
 149 |       </div>
 150 |     </div>
 151 |   </div>
 152 | </div>
 153 |       
 154 |     
 155 |     
 156 |   </nav>
 157 |   
 158 | </header>
 159 |     
 160 |     <div class="md-container" data-md-component="container">
 161 |       
 162 |       
 163 |         
 164 |           
 165 |         
 166 |       
 167 |       <main class="md-main" data-md-component="main">
 168 |         <div class="md-main__inner md-grid">
 169 |           
 170 |             
 171 |               
 172 |               <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
 173 |                 <div class="md-sidebar__scrollwrap">
 174 |                   <div class="md-sidebar__inner">
 175 |                     
 176 | 
 177 | 
 178 | 
 179 | <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
 180 |   <label class="md-nav__title" for="__drawer">
 181 |     <a href=".." title="CodeGraphContext" class="md-nav__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
 182 |       
 183 |   
 184 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
 185 | 
 186 |     </a>
 187 |     CodeGraphContext
 188 |   </label>
 189 |   
 190 |   <ul class="md-nav__list" data-md-scrollfix>
 191 |     
 192 |       
 193 |       
 194 |   
 195 |   
 196 |   
 197 |   
 198 |     <li class="md-nav__item">
 199 |       <a href=".." class="md-nav__link">
 200 |         
 201 |   
 202 |   
 203 |   <span class="md-ellipsis">
 204 |     
 205 |   
 206 |     Home
 207 |   
 208 | 
 209 |     
 210 |   </span>
 211 |   
 212 |   
 213 | 
 214 |       </a>
 215 |     </li>
 216 |   
 217 | 
 218 |     
 219 |       
 220 |       
 221 |   
 222 |   
 223 |   
 224 |   
 225 |     <li class="md-nav__item">
 226 |       <a href="../installation/" class="md-nav__link">
 227 |         
 228 |   
 229 |   
 230 |   <span class="md-ellipsis">
 231 |     
 232 |   
 233 |     Installation
 234 |   
 235 | 
 236 |     
 237 |   </span>
 238 |   
 239 |   
 240 | 
 241 |       </a>
 242 |     </li>
 243 |   
 244 | 
 245 |     
 246 |       
 247 |       
 248 |   
 249 |   
 250 |   
 251 |   
 252 |     <li class="md-nav__item">
 253 |       <a href="../use_cases/" class="md-nav__link">
 254 |         
 255 |   
 256 |   
 257 |   <span class="md-ellipsis">
 258 |     
 259 |   
 260 |     Use Cases
 261 |   
 262 | 
 263 |     
 264 |   </span>
 265 |   
 266 |   
 267 | 
 268 |       </a>
 269 |     </li>
 270 |   
 271 | 
 272 |     
 273 |       
 274 |       
 275 |   
 276 |   
 277 |   
 278 |   
 279 |     <li class="md-nav__item">
 280 |       <a href="../architecture/" class="md-nav__link">
 281 |         
 282 |   
 283 |   
 284 |   <span class="md-ellipsis">
 285 |     
 286 |   
 287 |     Architecture
 288 |   
 289 | 
 290 |     
 291 |   </span>
 292 |   
 293 |   
 294 | 
 295 |       </a>
 296 |     </li>
 297 |   
 298 | 
 299 |     
 300 |       
 301 |       
 302 |   
 303 |   
 304 |   
 305 |   
 306 |     <li class="md-nav__item">
 307 |       <a href="../cli/" class="md-nav__link">
 308 |         
 309 |   
 310 |   
 311 |   <span class="md-ellipsis">
 312 |     
 313 |   
 314 |     CLI Reference
 315 |   
 316 | 
 317 |     
 318 |   </span>
 319 |   
 320 |   
 321 | 
 322 |       </a>
 323 |     </li>
 324 |   
 325 | 
 326 |     
 327 |       
 328 |       
 329 |   
 330 |   
 331 |     
 332 |   
 333 |   
 334 |   
 335 |     <li class="md-nav__item md-nav__item--active">
 336 |       
 337 |       <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
 338 |       
 339 |       
 340 |         
 341 |       
 342 |       
 343 |         <label class="md-nav__link md-nav__link--active" for="__toc">
 344 |           
 345 |   
 346 |   
 347 |   <span class="md-ellipsis">
 348 |     
 349 |   
 350 |     Live Watching
 351 |   
 352 | 
 353 |     
 354 |   </span>
 355 |   
 356 |   
 357 | 
 358 |           <span class="md-nav__icon md-icon"></span>
 359 |         </label>
 360 |       
 361 |       <a href="./" class="md-nav__link md-nav__link--active">
 362 |         
 363 |   
 364 |   
 365 |   <span class="md-ellipsis">
 366 |     
 367 |   
 368 |     Live Watching
 369 |   
 370 | 
 371 |     
 372 |   </span>
 373 |   
 374 |   
 375 | 
 376 |       </a>
 377 |       
 378 |         
 379 | 
 380 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
 381 |   
 382 |   
 383 |   
 384 |     
 385 |   
 386 |   
 387 |     <label class="md-nav__title" for="__toc">
 388 |       <span class="md-nav__icon md-icon"></span>
 389 |       Table of contents
 390 |     </label>
 391 |     <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
 392 |       
 393 |         <li class="md-nav__item">
 394 |   <a href="#quick-start" class="md-nav__link">
 395 |     <span class="md-ellipsis">
 396 |       
 397 |         Quick Start
 398 |       
 399 |     </span>
 400 |   </a>
 401 |   
 402 | </li>
 403 |       
 404 |         <li class="md-nav__item">
 405 |   <a href="#how-it-works" class="md-nav__link">
 406 |     <span class="md-ellipsis">
 407 |       
 408 |         How It Works
 409 |       
 410 |     </span>
 411 |   </a>
 412 |   
 413 | </li>
 414 |       
 415 |         <li class="md-nav__item">
 416 |   <a href="#commands" class="md-nav__link">
 417 |     <span class="md-ellipsis">
 418 |       
 419 |         Commands
 420 |       
 421 |     </span>
 422 |   </a>
 423 |   
 424 |     <nav class="md-nav" aria-label="Commands">
 425 |       <ul class="md-nav__list">
 426 |         
 427 |           <li class="md-nav__item">
 428 |   <a href="#cgc-watch-path" class="md-nav__link">
 429 |     <span class="md-ellipsis">
 430 |       
 431 |         cgc watch [path]
 432 |       
 433 |     </span>
 434 |   </a>
 435 |   
 436 | </li>
 437 |         
 438 |           <li class="md-nav__item">
 439 |   <a href="#cgc-watching" class="md-nav__link">
 440 |     <span class="md-ellipsis">
 441 |       
 442 |         cgc watching
 443 |       
 444 |     </span>
 445 |   </a>
 446 |   
 447 | </li>
 448 |         
 449 |           <li class="md-nav__item">
 450 |   <a href="#cgc-unwatch-path" class="md-nav__link">
 451 |     <span class="md-ellipsis">
 452 |       
 453 |         cgc unwatch &lt;path&gt;
 454 |       
 455 |     </span>
 456 |   </a>
 457 |   
 458 | </li>
 459 |         
 460 |       </ul>
 461 |     </nav>
 462 |   
 463 | </li>
 464 |       
 465 |         <li class="md-nav__item">
 466 |   <a href="#best-practices" class="md-nav__link">
 467 |     <span class="md-ellipsis">
 468 |       
 469 |         Best Practices
 470 |       
 471 |     </span>
 472 |   </a>
 473 |   
 474 |     <nav class="md-nav" aria-label="Best Practices">
 475 |       <ul class="md-nav__list">
 476 |         
 477 |           <li class="md-nav__item">
 478 |   <a href="#development-workflow" class="md-nav__link">
 479 |     <span class="md-ellipsis">
 480 |       
 481 |         Development Workflow
 482 |       
 483 |     </span>
 484 |   </a>
 485 |   
 486 | </li>
 487 |         
 488 |           <li class="md-nav__item">
 489 |   <a href="#performance-tips" class="md-nav__link">
 490 |     <span class="md-ellipsis">
 491 |       
 492 |         Performance Tips
 493 |       
 494 |     </span>
 495 |   </a>
 496 |   
 497 | </li>
 498 |         
 499 |           <li class="md-nav__item">
 500 |   <a href="#when-to-use-watch-mode" class="md-nav__link">
 501 |     <span class="md-ellipsis">
 502 |       
 503 |         When to Use Watch Mode
 504 |       
 505 |     </span>
 506 |   </a>
 507 |   
 508 | </li>
 509 |         
 510 |       </ul>
 511 |     </nav>
 512 |   
 513 | </li>
 514 |       
 515 |         <li class="md-nav__item">
 516 |   <a href="#example-workflow" class="md-nav__link">
 517 |     <span class="md-ellipsis">
 518 |       
 519 |         Example Workflow
 520 |       
 521 |     </span>
 522 |   </a>
 523 |   
 524 | </li>
 525 |       
 526 |         <li class="md-nav__item">
 527 |   <a href="#troubleshooting" class="md-nav__link">
 528 |     <span class="md-ellipsis">
 529 |       
 530 |         Troubleshooting
 531 |       
 532 |     </span>
 533 |   </a>
 534 |   
 535 |     <nav class="md-nav" aria-label="Troubleshooting">
 536 |       <ul class="md-nav__list">
 537 |         
 538 |           <li class="md-nav__item">
 539 |   <a href="#watcher-not-detecting-changes" class="md-nav__link">
 540 |     <span class="md-ellipsis">
 541 |       
 542 |         Watcher not detecting changes
 543 |       
 544 |     </span>
 545 |   </a>
 546 |   
 547 | </li>
 548 |         
 549 |           <li class="md-nav__item">
 550 |   <a href="#high-cpu-usage" class="md-nav__link">
 551 |     <span class="md-ellipsis">
 552 |       
 553 |         High CPU usage
 554 |       
 555 |     </span>
 556 |   </a>
 557 |   
 558 | </li>
 559 |         
 560 |           <li class="md-nav__item">
 561 |   <a href="#changes-not-appearing" class="md-nav__link">
 562 |     <span class="md-ellipsis">
 563 |       
 564 |         Changes not appearing
 565 |       
 566 |     </span>
 567 |   </a>
 568 |   
 569 | </li>
 570 |         
 571 |           <li class="md-nav__item">
 572 |   <a href="#already-watching-message" class="md-nav__link">
 573 |     <span class="md-ellipsis">
 574 |       
 575 |         "Already watching" message
 576 |       
 577 |     </span>
 578 |   </a>
 579 |   
 580 | </li>
 581 |         
 582 |       </ul>
 583 |     </nav>
 584 |   
 585 | </li>
 586 |       
 587 |         <li class="md-nav__item">
 588 |   <a href="#mcp-server-vs-cli-watch-mode" class="md-nav__link">
 589 |     <span class="md-ellipsis">
 590 |       
 591 |         MCP Server vs CLI Watch Mode
 592 |       
 593 |     </span>
 594 |   </a>
 595 |   
 596 |     <nav class="md-nav" aria-label="MCP Server vs CLI Watch Mode">
 597 |       <ul class="md-nav__list">
 598 |         
 599 |           <li class="md-nav__item">
 600 |   <a href="#cli-watch-mode-this-guide" class="md-nav__link">
 601 |     <span class="md-ellipsis">
 602 |       
 603 |         CLI Watch Mode (This Guide)
 604 |       
 605 |     </span>
 606 |   </a>
 607 |   
 608 | </li>
 609 |         
 610 |           <li class="md-nav__item">
 611 |   <a href="#mcp-server-watch-mode" class="md-nav__link">
 612 |     <span class="md-ellipsis">
 613 |       
 614 |         MCP Server Watch Mode
 615 |       
 616 |     </span>
 617 |   </a>
 618 |   
 619 | </li>
 620 |         
 621 |       </ul>
 622 |     </nav>
 623 |   
 624 | </li>
 625 |       
 626 |         <li class="md-nav__item">
 627 |   <a href="#technical-details" class="md-nav__link">
 628 |     <span class="md-ellipsis">
 629 |       
 630 |         Technical Details
 631 |       
 632 |     </span>
 633 |   </a>
 634 |   
 635 | </li>
 636 |       
 637 |         <li class="md-nav__item">
 638 |   <a href="#integration-with-ai-assistants" class="md-nav__link">
 639 |     <span class="md-ellipsis">
 640 |       
 641 |         Integration with AI Assistants
 642 |       
 643 |     </span>
 644 |   </a>
 645 |   
 646 | </li>
 647 |       
 648 |         <li class="md-nav__item">
 649 |   <a href="#see-also" class="md-nav__link">
 650 |     <span class="md-ellipsis">
 651 |       
 652 |         See Also
 653 |       
 654 |     </span>
 655 |   </a>
 656 |   
 657 | </li>
 658 |       
 659 |     </ul>
 660 |   
 661 | </nav>
 662 |       
 663 |     </li>
 664 |   
 665 | 
 666 |     
 667 |       
 668 |       
 669 |   
 670 |   
 671 |   
 672 |   
 673 |     <li class="md-nav__item">
 674 |       <a href="../server/" class="md-nav__link">
 675 |         
 676 |   
 677 |   
 678 |   <span class="md-ellipsis">
 679 |     
 680 |   
 681 |     Server
 682 |   
 683 | 
 684 |     
 685 |   </span>
 686 |   
 687 |   
 688 | 
 689 |       </a>
 690 |     </li>
 691 |   
 692 | 
 693 |     
 694 |       
 695 |       
 696 |   
 697 |   
 698 |   
 699 |   
 700 |     <li class="md-nav__item">
 701 |       <a href="../core/" class="md-nav__link">
 702 |         
 703 |   
 704 |   
 705 |   <span class="md-ellipsis">
 706 |     
 707 |   
 708 |     Core Concepts
 709 |   
 710 | 
 711 |     
 712 |   </span>
 713 |   
 714 |   
 715 | 
 716 |       </a>
 717 |     </li>
 718 |   
 719 | 
 720 |     
 721 |       
 722 |       
 723 |   
 724 |   
 725 |   
 726 |   
 727 |     <li class="md-nav__item">
 728 |       <a href="../tools/" class="md-nav__link">
 729 |         
 730 |   
 731 |   
 732 |   <span class="md-ellipsis">
 733 |     
 734 |   
 735 |     Tools
 736 |   
 737 | 
 738 |     
 739 |   </span>
 740 |   
 741 |   
 742 | 
 743 |       </a>
 744 |     </li>
 745 |   
 746 | 
 747 |     
 748 |       
 749 |       
 750 |   
 751 |   
 752 |   
 753 |   
 754 |     <li class="md-nav__item">
 755 |       <a href="../cookbook/" class="md-nav__link">
 756 |         
 757 |   
 758 |   
 759 |   <span class="md-ellipsis">
 760 |     
 761 |   
 762 |     Cookbook
 763 |   
 764 | 
 765 |     
 766 |   </span>
 767 |   
 768 |   
 769 | 
 770 |       </a>
 771 |     </li>
 772 |   
 773 | 
 774 |     
 775 |       
 776 |       
 777 |   
 778 |   
 779 |   
 780 |   
 781 |     
 782 |     
 783 |     
 784 |     
 785 |     
 786 |     <li class="md-nav__item md-nav__item--nested">
 787 |       
 788 |         
 789 |         
 790 |         <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" >
 791 |         
 792 |           
 793 |           <label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
 794 |             
 795 |   
 796 |   
 797 |   <span class="md-ellipsis">
 798 |     
 799 |   
 800 |     Contributing
 801 |   
 802 | 
 803 |     
 804 |   </span>
 805 |   
 806 |   
 807 | 
 808 |             <span class="md-nav__icon md-icon"></span>
 809 |           </label>
 810 |         
 811 |         <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="false">
 812 |           <label class="md-nav__title" for="__nav_11">
 813 |             <span class="md-nav__icon md-icon"></span>
 814 |             
 815 |   
 816 |     Contributing
 817 |   
 818 | 
 819 |           </label>
 820 |           <ul class="md-nav__list" data-md-scrollfix>
 821 |             
 822 |               
 823 |                 
 824 |   
 825 |   
 826 |   
 827 |   
 828 |     <li class="md-nav__item">
 829 |       <a href="../contributing/" class="md-nav__link">
 830 |         
 831 |   
 832 |   
 833 |   <span class="md-ellipsis">
 834 |     
 835 |   
 836 |     Overview
 837 |   
 838 | 
 839 |     
 840 |   </span>
 841 |   
 842 |   
 843 | 
 844 |       </a>
 845 |     </li>
 846 |   
 847 | 
 848 |               
 849 |             
 850 |               
 851 |                 
 852 |   
 853 |   
 854 |   
 855 |   
 856 |     <li class="md-nav__item">
 857 |       <a href="../contributing_languages/" class="md-nav__link">
 858 |         
 859 |   
 860 |   
 861 |   <span class="md-ellipsis">
 862 |     
 863 |   
 864 |     Adding New Languages
 865 |   
 866 | 
 867 |     
 868 |   </span>
 869 |   
 870 |   
 871 | 
 872 |       </a>
 873 |     </li>
 874 |   
 875 | 
 876 |               
 877 |             
 878 |           </ul>
 879 |         </nav>
 880 |       
 881 |     </li>
 882 |   
 883 | 
 884 |     
 885 |       
 886 |       
 887 |   
 888 |   
 889 |   
 890 |   
 891 |     <li class="md-nav__item">
 892 |       <a href="../troubleshooting/" class="md-nav__link">
 893 |         
 894 |   
 895 |   
 896 |   <span class="md-ellipsis">
 897 |     
 898 |   
 899 |     Troubleshooting
 900 |   
 901 | 
 902 |     
 903 |   </span>
 904 |   
 905 |   
 906 | 
 907 |       </a>
 908 |     </li>
 909 |   
 910 | 
 911 |     
 912 |       
 913 |       
 914 |   
 915 |   
 916 |   
 917 |   
 918 |     <li class="md-nav__item">
 919 |       <a href="../future_work/" class="md-nav__link">
 920 |         
 921 |   
 922 |   
 923 |   <span class="md-ellipsis">
 924 |     
 925 |   
 926 |     Future Work
 927 |   
 928 | 
 929 |     
 930 |   </span>
 931 |   
 932 |   
 933 | 
 934 |       </a>
 935 |     </li>
 936 |   
 937 | 
 938 |     
 939 |       
 940 |       
 941 |   
 942 |   
 943 |   
 944 |   
 945 |     <li class="md-nav__item">
 946 |       <a href="../license/" class="md-nav__link">
 947 |         
 948 |   
 949 |   
 950 |   <span class="md-ellipsis">
 951 |     
 952 |   
 953 |     License
 954 |   
 955 | 
 956 |     
 957 |   </span>
 958 |   
 959 |   
 960 | 
 961 |       </a>
 962 |     </li>
 963 |   
 964 | 
 965 |     
 966 |   </ul>
 967 | </nav>
 968 |                   </div>
 969 |                 </div>
 970 |               </div>
 971 |             
 972 |             
 973 |               
 974 |               <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
 975 |                 <div class="md-sidebar__scrollwrap">
 976 |                   <div class="md-sidebar__inner">
 977 |                     
 978 | 
 979 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
 980 |   
 981 |   
 982 |   
 983 |     
 984 |   
 985 |   
 986 |     <label class="md-nav__title" for="__toc">
 987 |       <span class="md-nav__icon md-icon"></span>
 988 |       Table of contents
 989 |     </label>
 990 |     <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
 991 |       
 992 |         <li class="md-nav__item">
 993 |   <a href="#quick-start" class="md-nav__link">
 994 |     <span class="md-ellipsis">
 995 |       
 996 |         Quick Start
 997 |       
 998 |     </span>
 999 |   </a>
1000 |   
1001 | </li>
1002 |       
1003 |         <li class="md-nav__item">
1004 |   <a href="#how-it-works" class="md-nav__link">
1005 |     <span class="md-ellipsis">
1006 |       
1007 |         How It Works
1008 |       
1009 |     </span>
1010 |   </a>
1011 |   
1012 | </li>
1013 |       
1014 |         <li class="md-nav__item">
1015 |   <a href="#commands" class="md-nav__link">
1016 |     <span class="md-ellipsis">
1017 |       
1018 |         Commands
1019 |       
1020 |     </span>
1021 |   </a>
1022 |   
1023 |     <nav class="md-nav" aria-label="Commands">
1024 |       <ul class="md-nav__list">
1025 |         
1026 |           <li class="md-nav__item">
1027 |   <a href="#cgc-watch-path" class="md-nav__link">
1028 |     <span class="md-ellipsis">
1029 |       
1030 |         cgc watch [path]
1031 |       
1032 |     </span>
1033 |   </a>
1034 |   
1035 | </li>
1036 |         
1037 |           <li class="md-nav__item">
1038 |   <a href="#cgc-watching" class="md-nav__link">
1039 |     <span class="md-ellipsis">
1040 |       
1041 |         cgc watching
1042 |       
1043 |     </span>
1044 |   </a>
1045 |   
1046 | </li>
1047 |         
1048 |           <li class="md-nav__item">
1049 |   <a href="#cgc-unwatch-path" class="md-nav__link">
1050 |     <span class="md-ellipsis">
1051 |       
1052 |         cgc unwatch &lt;path&gt;
1053 |       
1054 |     </span>
1055 |   </a>
1056 |   
1057 | </li>
1058 |         
1059 |       </ul>
1060 |     </nav>
1061 |   
1062 | </li>
1063 |       
1064 |         <li class="md-nav__item">
1065 |   <a href="#best-practices" class="md-nav__link">
1066 |     <span class="md-ellipsis">
1067 |       
1068 |         Best Practices
1069 |       
1070 |     </span>
1071 |   </a>
1072 |   
1073 |     <nav class="md-nav" aria-label="Best Practices">
1074 |       <ul class="md-nav__list">
1075 |         
1076 |           <li class="md-nav__item">
1077 |   <a href="#development-workflow" class="md-nav__link">
1078 |     <span class="md-ellipsis">
1079 |       
1080 |         Development Workflow
1081 |       
1082 |     </span>
1083 |   </a>
1084 |   
1085 | </li>
1086 |         
1087 |           <li class="md-nav__item">
1088 |   <a href="#performance-tips" class="md-nav__link">
1089 |     <span class="md-ellipsis">
1090 |       
1091 |         Performance Tips
1092 |       
1093 |     </span>
1094 |   </a>
1095 |   
1096 | </li>
1097 |         
1098 |           <li class="md-nav__item">
1099 |   <a href="#when-to-use-watch-mode" class="md-nav__link">
1100 |     <span class="md-ellipsis">
1101 |       
1102 |         When to Use Watch Mode
1103 |       
1104 |     </span>
1105 |   </a>
1106 |   
1107 | </li>
1108 |         
1109 |       </ul>
1110 |     </nav>
1111 |   
1112 | </li>
1113 |       
1114 |         <li class="md-nav__item">
1115 |   <a href="#example-workflow" class="md-nav__link">
1116 |     <span class="md-ellipsis">
1117 |       
1118 |         Example Workflow
1119 |       
1120 |     </span>
1121 |   </a>
1122 |   
1123 | </li>
1124 |       
1125 |         <li class="md-nav__item">
1126 |   <a href="#troubleshooting" class="md-nav__link">
1127 |     <span class="md-ellipsis">
1128 |       
1129 |         Troubleshooting
1130 |       
1131 |     </span>
1132 |   </a>
1133 |   
1134 |     <nav class="md-nav" aria-label="Troubleshooting">
1135 |       <ul class="md-nav__list">
1136 |         
1137 |           <li class="md-nav__item">
1138 |   <a href="#watcher-not-detecting-changes" class="md-nav__link">
1139 |     <span class="md-ellipsis">
1140 |       
1141 |         Watcher not detecting changes
1142 |       
1143 |     </span>
1144 |   </a>
1145 |   
1146 | </li>
1147 |         
1148 |           <li class="md-nav__item">
1149 |   <a href="#high-cpu-usage" class="md-nav__link">
1150 |     <span class="md-ellipsis">
1151 |       
1152 |         High CPU usage
1153 |       
1154 |     </span>
1155 |   </a>
1156 |   
1157 | </li>
1158 |         
1159 |           <li class="md-nav__item">
1160 |   <a href="#changes-not-appearing" class="md-nav__link">
1161 |     <span class="md-ellipsis">
1162 |       
1163 |         Changes not appearing
1164 |       
1165 |     </span>
1166 |   </a>
1167 |   
1168 | </li>
1169 |         
1170 |           <li class="md-nav__item">
1171 |   <a href="#already-watching-message" class="md-nav__link">
1172 |     <span class="md-ellipsis">
1173 |       
1174 |         "Already watching" message
1175 |       
1176 |     </span>
1177 |   </a>
1178 |   
1179 | </li>
1180 |         
1181 |       </ul>
1182 |     </nav>
1183 |   
1184 | </li>
1185 |       
1186 |         <li class="md-nav__item">
1187 |   <a href="#mcp-server-vs-cli-watch-mode" class="md-nav__link">
1188 |     <span class="md-ellipsis">
1189 |       
1190 |         MCP Server vs CLI Watch Mode
1191 |       
1192 |     </span>
1193 |   </a>
1194 |   
1195 |     <nav class="md-nav" aria-label="MCP Server vs CLI Watch Mode">
1196 |       <ul class="md-nav__list">
1197 |         
1198 |           <li class="md-nav__item">
1199 |   <a href="#cli-watch-mode-this-guide" class="md-nav__link">
1200 |     <span class="md-ellipsis">
1201 |       
1202 |         CLI Watch Mode (This Guide)
1203 |       
1204 |     </span>
1205 |   </a>
1206 |   
1207 | </li>
1208 |         
1209 |           <li class="md-nav__item">
1210 |   <a href="#mcp-server-watch-mode" class="md-nav__link">
1211 |     <span class="md-ellipsis">
1212 |       
1213 |         MCP Server Watch Mode
1214 |       
1215 |     </span>
1216 |   </a>
1217 |   
1218 | </li>
1219 |         
1220 |       </ul>
1221 |     </nav>
1222 |   
1223 | </li>
1224 |       
1225 |         <li class="md-nav__item">
1226 |   <a href="#technical-details" class="md-nav__link">
1227 |     <span class="md-ellipsis">
1228 |       
1229 |         Technical Details
1230 |       
1231 |     </span>
1232 |   </a>
1233 |   
1234 | </li>
1235 |       
1236 |         <li class="md-nav__item">
1237 |   <a href="#integration-with-ai-assistants" class="md-nav__link">
1238 |     <span class="md-ellipsis">
1239 |       
1240 |         Integration with AI Assistants
1241 |       
1242 |     </span>
1243 |   </a>
1244 |   
1245 | </li>
1246 |       
1247 |         <li class="md-nav__item">
1248 |   <a href="#see-also" class="md-nav__link">
1249 |     <span class="md-ellipsis">
1250 |       
1251 |         See Also
1252 |       
1253 |     </span>
1254 |   </a>
1255 |   
1256 | </li>
1257 |       
1258 |     </ul>
1259 |   
1260 | </nav>
1261 |                   </div>
1262 |                 </div>
1263 |               </div>
1264 |             
1265 |           
1266 |           
1267 |             <div class="md-content" data-md-component="content">
1268 |               
1269 |               <article class="md-content__inner md-typeset">
1270 |                 
1271 |                   
1272 | 
1273 | 
1274 | 
1275 | <h1 id="live-file-watching">Live File Watching</h1>
1276 | <p>CodeGraphContext can automatically monitor your codebase for changes and update the code graph in real-time as you develop.</p>
1277 | <h2 id="quick-start">Quick Start</h2>
1278 | <p>Start watching your project directory:</p>
1279 | <pre><code class="language-bash">cgc watch .
1280 | </code></pre>
1281 | <p>You'll see:</p>
1282 | <pre><code>🔍 Watching /path/to/your/project for changes...
1283 | ✓ Already indexed (no initial scan needed)
1284 | 👀 Monitoring for file changes... (Press Ctrl+C to stop)
1285 | 
1286 | 💡 Tip: Open a new terminal window to continue working
1287 | </code></pre>
1288 | <h2 id="how-it-works">How It Works</h2>
1289 | <p>The watcher uses file system events to detect when you:</p>
1290 | <ul>
1291 | <li>Create new files</li>
1292 | <li>Modify existing files</li>
1293 | <li>Delete files</li>
1294 | <li>Move/rename files</li>
1295 | </ul>
1296 | <p>When changes are detected, CodeGraphContext automatically:</p>
1297 | <ol>
1298 | <li>Re-parses the affected files</li>
1299 | <li>Updates the code graph</li>
1300 | <li>Maintains all relationships and dependencies</li>
1301 | </ol>
1302 | <h2 id="commands">Commands</h2>
1303 | <h3 id="cgc-watch-path"><code>cgc watch [path]</code></h3>
1304 | <p>Start watching a directory for changes.</p>
1305 | <p><strong>Examples:</strong></p>
1306 | <pre><code class="language-bash">cgc watch .                    # Watch current directory
1307 | cgc watch /path/to/project     # Watch specific directory
1308 | cgc w .                        # Shortcut alias
1309 | </code></pre>
1310 | <p><strong>Behavior:</strong>
1311 | - Runs in the foreground (blocking mode)
1312 | - Performs initial scan if directory is not yet indexed
1313 | - Monitors for all file system changes
1314 | - Uses 2-second debouncing to batch rapid changes
1315 | - Press <code>Ctrl+C</code> to stop</p>
1316 | <h3 id="cgc-watching"><code>cgc watching</code></h3>
1317 | <p>List all directories currently being watched.</p>
1318 | <pre><code class="language-bash">cgc watching
1319 | </code></pre>
1320 | <p><strong>Note:</strong> This command is primarily for MCP server mode. For CLI watch mode, check the terminal where you ran <code>cgc watch</code>.</p>
1321 | <h3 id="cgc-unwatch-path"><code>cgc unwatch &lt;path&gt;</code></h3>
1322 | <p>Stop watching a directory.</p>
1323 | <pre><code class="language-bash">cgc unwatch /path/to/project
1324 | </code></pre>
1325 | <p><strong>Note:</strong> This command is primarily for MCP server mode. For CLI watch mode, simply press <code>Ctrl+C</code> in the watch terminal.</p>
1326 | <h2 id="best-practices">Best Practices</h2>
1327 | <h3 id="development-workflow">Development Workflow</h3>
1328 | <ol>
1329 | <li>Start watching at the beginning of your coding session</li>
1330 | <li>Open a new terminal tab/window for your actual work</li>
1331 | <li>Code normally - changes are automatically tracked</li>
1332 | <li>Stop watching (Ctrl+C) when you're done</li>
1333 | </ol>
1334 | <h3 id="performance-tips">Performance Tips</h3>
1335 | <ul>
1336 | <li>The watcher uses debouncing (2-second delay) to avoid excessive re-indexing</li>
1337 | <li>Only modified files and their dependencies are re-processed</li>
1338 | <li>Large projects may take a moment to process changes</li>
1339 | </ul>
1340 | <h3 id="when-to-use-watch-mode">When to Use Watch Mode</h3>
1341 | <p>✅ <strong>Good for:</strong></p>
1342 | <ul>
1343 | <li>Active development sessions</li>
1344 | <li>Refactoring work</li>
1345 | <li>Keeping AI assistants up-to-date with latest code</li>
1346 | <li>Live code analysis during development</li>
1347 | </ul>
1348 | <p>❌ <strong>Not needed for:</strong></p>
1349 | <ul>
1350 | <li>One-time indexing</li>
1351 | <li>CI/CD pipelines</li>
1352 | <li>Read-only code analysis</li>
1353 | <li>Batch processing</li>
1354 | </ul>
1355 | <h2 id="example-workflow">Example Workflow</h2>
1356 | <p>Here's a typical development session using watch mode:</p>
1357 | <pre><code class="language-bash"># Terminal 1: Start the watcher
1358 | $ cd ~/my-project
1359 | $ cgc watch .
1360 | 🔍 Watching /home/user/my-project for changes...
1361 | ✓ Already indexed (no initial scan needed)
1362 | 👀 Monitoring for file changes... (Press Ctrl+C to stop)
1363 | 
1364 | 💡 Tip: Open a new terminal window to continue working
1365 | 
1366 | # ... watcher runs and shows updates as you code ...
1367 | [21:15:32] 📝 Modified: src/utils.py (re-indexing...)
1368 | [21:15:32] ✓ Updated graph (3 nodes, 2 relationships)
1369 | [21:16:45] 📝 Created: src/new_feature.py (re-indexing...)
1370 | [21:16:45] ✓ Updated graph (8 nodes, 5 relationships)
1371 | </code></pre>
1372 | <pre><code class="language-bash"># Terminal 2: Do your development work
1373 | $ cd ~/my-project
1374 | $ code .                       # Open your editor
1375 | $ git checkout -b new-feature  # Work normally
1376 | $ # ... make changes, save files ...
1377 | $ # The watcher in Terminal 1 automatically picks up changes!
1378 | </code></pre>
1379 | <h2 id="troubleshooting">Troubleshooting</h2>
1380 | <h3 id="watcher-not-detecting-changes">Watcher not detecting changes</h3>
1381 | <ul>
1382 | <li>Ensure the path is correct and accessible</li>
1383 | <li>Check file permissions</li>
1384 | <li>Some editors use atomic writes which may not trigger events</li>
1385 | <li>Try restarting the watcher</li>
1386 | </ul>
1387 | <h3 id="high-cpu-usage">High CPU usage</h3>
1388 | <ul>
1389 | <li>The watcher may be processing too many files</li>
1390 | <li>Consider watching a smaller directory</li>
1391 | <li>Check for file loops or symlinks</li>
1392 | <li>Verify you're not watching <code>node_modules</code> or similar large directories</li>
1393 | </ul>
1394 | <h3 id="changes-not-appearing">Changes not appearing</h3>
1395 | <ul>
1396 | <li>Wait for the debounce interval (2 seconds)</li>
1397 | <li>Check the watcher output for errors</li>
1398 | <li>Verify the file type is supported (Python, JavaScript, TypeScript, etc.)</li>
1399 | <li>Ensure the file is within the watched directory</li>
1400 | </ul>
1401 | <h3 id="already-watching-message">"Already watching" message</h3>
1402 | <p>If you see this message, it means the directory is already being watched. This can happen if:</p>
1403 | <ul>
1404 | <li>You're running multiple watch commands</li>
1405 | <li>The MCP server is already watching this directory</li>
1406 | <li>A previous watch session didn't terminate cleanly</li>
1407 | </ul>
1408 | <p><strong>Solution:</strong> Stop all watch processes and start fresh.</p>
1409 | <h2 id="mcp-server-vs-cli-watch-mode">MCP Server vs CLI Watch Mode</h2>
1410 | <p>CodeGraphContext supports two watch modes:</p>
1411 | <h3 id="cli-watch-mode-this-guide">CLI Watch Mode (This Guide)</h3>
1412 | <ul>
1413 | <li><strong>Command:</strong> <code>cgc watch .</code></li>
1414 | <li><strong>Runs:</strong> In foreground (blocking)</li>
1415 | <li><strong>Use case:</strong> Active development sessions</li>
1416 | <li><strong>Control:</strong> Press <code>Ctrl+C</code> to stop</li>
1417 | <li><strong>Best for:</strong> Single project, focused development</li>
1418 | </ul>
1419 | <h3 id="mcp-server-watch-mode">MCP Server Watch Mode</h3>
1420 | <ul>
1421 | <li><strong>Command:</strong> Via MCP tools (<code>watch_directory</code>, <code>unwatch_directory</code>, <code>list_watched_paths</code>)</li>
1422 | <li><strong>Runs:</strong> In background (as part of MCP server)</li>
1423 | <li><strong>Use case:</strong> IDE integration, multiple projects</li>
1424 | <li><strong>Control:</strong> MCP tool calls</li>
1425 | <li><strong>Best for:</strong> AI assistant integration, persistent watching</li>
1426 | </ul>
1427 | <h2 id="technical-details">Technical Details</h2>
1428 | <ul>
1429 | <li><strong>Library</strong>: Uses <code>watchdog</code> for cross-platform file monitoring</li>
1430 | <li><strong>Debouncing</strong>: 2-second delay to batch rapid changes</li>
1431 | <li><strong>Scope</strong>: Watches recursively, respects <code>.gitignore</code></li>
1432 | <li><strong>Performance</strong>: Only re-indexes changed files and affected relationships</li>
1433 | <li><strong>Thread-safe</strong>: Uses background threads for file monitoring</li>
1434 | <li><strong>Graceful shutdown</strong>: Properly cleans up on <code>Ctrl+C</code></li>
1435 | </ul>
1436 | <h2 id="integration-with-ai-assistants">Integration with AI Assistants</h2>
1437 | <p>Watch mode is particularly powerful when combined with AI coding assistants:</p>
1438 | <ol>
1439 | <li>
1440 | <p><strong>Start watching your project:</strong>
1441 |    <code>bash
1442 |    cgc watch .</code></p>
1443 | </li>
1444 | <li>
1445 | <p><strong>Configure your AI assistant</strong> to use the CodeGraphContext MCP server</p>
1446 | </li>
1447 | <li>
1448 | <p><strong>Code normally</strong> - your AI assistant always has the latest code context</p>
1449 | </li>
1450 | <li>
1451 | <p><strong>Ask questions</strong> about your code, and the AI will have up-to-date information</p>
1452 | </li>
1453 | </ol>
1454 | <p>This creates a seamless development experience where your AI assistant stays synchronized with your codebase in real-time!</p>
1455 | <h2 id="see-also">See Also</h2>
1456 | <ul>
1457 | <li><a href="../cli/">CLI Reference</a> - Complete list of CLI commands</li>
1458 | <li><a href="mcp-tools.md">MCP Tools</a> - MCP server tools including watch functionality</li>
1459 | <li><a href="../installation/">Installation</a> - Getting started with CodeGraphContext</li>
1460 | </ul>
1461 | 
1462 | 
1463 | 
1464 | 
1465 | 
1466 | 
1467 | 
1468 | 
1469 | 
1470 | 
1471 | 
1472 | 
1473 |                 
1474 |               </article>
1475 |             </div>
1476 |           
1477 |           
1478 | <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
1479 |         </div>
1480 |         
1481 |       </main>
1482 |       
1483 |         <footer class="md-footer">
1484 |   
1485 |   <div class="md-footer-meta md-typeset">
1486 |     <div class="md-footer-meta__inner md-grid">
1487 |       <div class="md-copyright">
1488 |   
1489 |   
1490 |     Made with
1491 |     <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
1492 |       Material for MkDocs
1493 |     </a>
1494 |   
1495 | </div>
1496 |       
1497 |     </div>
1498 |   </div>
1499 | </footer>
1500 |       
1501 |     </div>
1502 |     <div class="md-dialog" data-md-component="dialog">
1503 |       <div class="md-dialog__inner md-typeset"></div>
1504 |     </div>
1505 |     
1506 |     
1507 |     
1508 |       
1509 |       
1510 |       <script id="__config" type="application/json">{"annotate": null, "base": "..", "features": [], "search": "../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
1511 |     
1512 |     
1513 |       <script src="../assets/javascripts/bundle.79ae519e.min.js"></script>
1514 |       
1515 |     
1516 |   </body>
1517 | </html>
```

--------------------------------------------------------------------------------
/docs/site/contributing_languages/index.html:
--------------------------------------------------------------------------------

```html
   1 | 
   2 | <!doctype html>
   3 | <html lang="en" class="no-js">
   4 |   <head>
   5 |     
   6 |       <meta charset="utf-8">
   7 |       <meta name="viewport" content="width=device-width,initial-scale=1">
   8 |       
   9 |       
  10 |       
  11 |       
  12 |         <link rel="prev" href="../contributing/">
  13 |       
  14 |       
  15 |         <link rel="next" href="../troubleshooting/">
  16 |       
  17 |       
  18 |         
  19 |       
  20 |       
  21 |       <link rel="icon" href="../assets/images/favicon.png">
  22 |       <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.1">
  23 |     
  24 |     
  25 |       
  26 |         <title>Adding New Languages - CodeGraphContext</title>
  27 |       
  28 |     
  29 |     
  30 |       <link rel="stylesheet" href="../assets/stylesheets/main.484c7ddc.min.css">
  31 |       
  32 |       
  33 | 
  34 | 
  35 |     
  36 |     
  37 |       
  38 |     
  39 |     
  40 |       
  41 |         
  42 |         
  43 |         <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  44 |         <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
  45 |         <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
  46 |       
  47 |     
  48 |     
  49 |     <script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
  50 |     
  51 |       
  52 | 
  53 |     
  54 |     
  55 |   </head>
  56 |   
  57 |   
  58 |     <body dir="ltr">
  59 |   
  60 |     
  61 |     <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
  62 |     <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
  63 |     <label class="md-overlay" for="__drawer"></label>
  64 |     <div data-md-component="skip">
  65 |       
  66 |         
  67 |         <a href="#contributing-new-language-support-to-codegraphcontext" class="md-skip">
  68 |           Skip to content
  69 |         </a>
  70 |       
  71 |     </div>
  72 |     <div data-md-component="announce">
  73 |       
  74 |     </div>
  75 |     
  76 |     
  77 |       
  78 | 
  79 |   
  80 | 
  81 | <header class="md-header md-header--shadow" data-md-component="header">
  82 |   <nav class="md-header__inner md-grid" aria-label="Header">
  83 |     <a href=".." title="CodeGraphContext" class="md-header__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
  84 |       
  85 |   
  86 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
  87 | 
  88 |     </a>
  89 |     <label class="md-header__button md-icon" for="__drawer">
  90 |       
  91 |       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
  92 |     </label>
  93 |     <div class="md-header__title" data-md-component="header-title">
  94 |       <div class="md-header__ellipsis">
  95 |         <div class="md-header__topic">
  96 |           <span class="md-ellipsis">
  97 |             CodeGraphContext
  98 |           </span>
  99 |         </div>
 100 |         <div class="md-header__topic" data-md-component="header-topic">
 101 |           <span class="md-ellipsis">
 102 |             
 103 |               Adding New Languages
 104 |             
 105 |           </span>
 106 |         </div>
 107 |       </div>
 108 |     </div>
 109 |     
 110 |     
 111 |       <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
 112 |     
 113 |     
 114 |     
 115 |       
 116 |       
 117 |         <label class="md-header__button md-icon" for="__search">
 118 |           
 119 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
 120 |         </label>
 121 |         <div class="md-search" data-md-component="search" role="dialog">
 122 |   <label class="md-search__overlay" for="__search"></label>
 123 |   <div class="md-search__inner" role="search">
 124 |     <form class="md-search__form" name="search">
 125 |       <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
 126 |       <label class="md-search__icon md-icon" for="__search">
 127 |         
 128 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
 129 |         
 130 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
 131 |       </label>
 132 |       <nav class="md-search__options" aria-label="Search">
 133 |         
 134 |         <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
 135 |           
 136 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
 137 |         </button>
 138 |       </nav>
 139 |       
 140 |     </form>
 141 |     <div class="md-search__output">
 142 |       <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
 143 |         <div class="md-search-result" data-md-component="search-result">
 144 |           <div class="md-search-result__meta">
 145 |             Initializing search
 146 |           </div>
 147 |           <ol class="md-search-result__list" role="presentation"></ol>
 148 |         </div>
 149 |       </div>
 150 |     </div>
 151 |   </div>
 152 | </div>
 153 |       
 154 |     
 155 |     
 156 |   </nav>
 157 |   
 158 | </header>
 159 |     
 160 |     <div class="md-container" data-md-component="container">
 161 |       
 162 |       
 163 |         
 164 |           
 165 |         
 166 |       
 167 |       <main class="md-main" data-md-component="main">
 168 |         <div class="md-main__inner md-grid">
 169 |           
 170 |             
 171 |               
 172 |               <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
 173 |                 <div class="md-sidebar__scrollwrap">
 174 |                   <div class="md-sidebar__inner">
 175 |                     
 176 | 
 177 | 
 178 | 
 179 | <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
 180 |   <label class="md-nav__title" for="__drawer">
 181 |     <a href=".." title="CodeGraphContext" class="md-nav__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
 182 |       
 183 |   
 184 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
 185 | 
 186 |     </a>
 187 |     CodeGraphContext
 188 |   </label>
 189 |   
 190 |   <ul class="md-nav__list" data-md-scrollfix>
 191 |     
 192 |       
 193 |       
 194 |   
 195 |   
 196 |   
 197 |   
 198 |     <li class="md-nav__item">
 199 |       <a href=".." class="md-nav__link">
 200 |         
 201 |   
 202 |   
 203 |   <span class="md-ellipsis">
 204 |     
 205 |   
 206 |     Home
 207 |   
 208 | 
 209 |     
 210 |   </span>
 211 |   
 212 |   
 213 | 
 214 |       </a>
 215 |     </li>
 216 |   
 217 | 
 218 |     
 219 |       
 220 |       
 221 |   
 222 |   
 223 |   
 224 |   
 225 |     <li class="md-nav__item">
 226 |       <a href="../installation/" class="md-nav__link">
 227 |         
 228 |   
 229 |   
 230 |   <span class="md-ellipsis">
 231 |     
 232 |   
 233 |     Installation
 234 |   
 235 | 
 236 |     
 237 |   </span>
 238 |   
 239 |   
 240 | 
 241 |       </a>
 242 |     </li>
 243 |   
 244 | 
 245 |     
 246 |       
 247 |       
 248 |   
 249 |   
 250 |   
 251 |   
 252 |     <li class="md-nav__item">
 253 |       <a href="../use_cases/" class="md-nav__link">
 254 |         
 255 |   
 256 |   
 257 |   <span class="md-ellipsis">
 258 |     
 259 |   
 260 |     Use Cases
 261 |   
 262 | 
 263 |     
 264 |   </span>
 265 |   
 266 |   
 267 | 
 268 |       </a>
 269 |     </li>
 270 |   
 271 | 
 272 |     
 273 |       
 274 |       
 275 |   
 276 |   
 277 |   
 278 |   
 279 |     <li class="md-nav__item">
 280 |       <a href="../architecture/" class="md-nav__link">
 281 |         
 282 |   
 283 |   
 284 |   <span class="md-ellipsis">
 285 |     
 286 |   
 287 |     Architecture
 288 |   
 289 | 
 290 |     
 291 |   </span>
 292 |   
 293 |   
 294 | 
 295 |       </a>
 296 |     </li>
 297 |   
 298 | 
 299 |     
 300 |       
 301 |       
 302 |   
 303 |   
 304 |   
 305 |   
 306 |     <li class="md-nav__item">
 307 |       <a href="../cli/" class="md-nav__link">
 308 |         
 309 |   
 310 |   
 311 |   <span class="md-ellipsis">
 312 |     
 313 |   
 314 |     CLI Reference
 315 |   
 316 | 
 317 |     
 318 |   </span>
 319 |   
 320 |   
 321 | 
 322 |       </a>
 323 |     </li>
 324 |   
 325 | 
 326 |     
 327 |       
 328 |       
 329 |   
 330 |   
 331 |   
 332 |   
 333 |     <li class="md-nav__item">
 334 |       <a href="../watching/" class="md-nav__link">
 335 |         
 336 |   
 337 |   
 338 |   <span class="md-ellipsis">
 339 |     
 340 |   
 341 |     Live Watching
 342 |   
 343 | 
 344 |     
 345 |   </span>
 346 |   
 347 |   
 348 | 
 349 |       </a>
 350 |     </li>
 351 |   
 352 | 
 353 |     
 354 |       
 355 |       
 356 |   
 357 |   
 358 |   
 359 |   
 360 |     <li class="md-nav__item">
 361 |       <a href="../server/" class="md-nav__link">
 362 |         
 363 |   
 364 |   
 365 |   <span class="md-ellipsis">
 366 |     
 367 |   
 368 |     Server
 369 |   
 370 | 
 371 |     
 372 |   </span>
 373 |   
 374 |   
 375 | 
 376 |       </a>
 377 |     </li>
 378 |   
 379 | 
 380 |     
 381 |       
 382 |       
 383 |   
 384 |   
 385 |   
 386 |   
 387 |     <li class="md-nav__item">
 388 |       <a href="../core/" class="md-nav__link">
 389 |         
 390 |   
 391 |   
 392 |   <span class="md-ellipsis">
 393 |     
 394 |   
 395 |     Core Concepts
 396 |   
 397 | 
 398 |     
 399 |   </span>
 400 |   
 401 |   
 402 | 
 403 |       </a>
 404 |     </li>
 405 |   
 406 | 
 407 |     
 408 |       
 409 |       
 410 |   
 411 |   
 412 |   
 413 |   
 414 |     <li class="md-nav__item">
 415 |       <a href="../tools/" class="md-nav__link">
 416 |         
 417 |   
 418 |   
 419 |   <span class="md-ellipsis">
 420 |     
 421 |   
 422 |     Tools
 423 |   
 424 | 
 425 |     
 426 |   </span>
 427 |   
 428 |   
 429 | 
 430 |       </a>
 431 |     </li>
 432 |   
 433 | 
 434 |     
 435 |       
 436 |       
 437 |   
 438 |   
 439 |   
 440 |   
 441 |     <li class="md-nav__item">
 442 |       <a href="../cookbook/" class="md-nav__link">
 443 |         
 444 |   
 445 |   
 446 |   <span class="md-ellipsis">
 447 |     
 448 |   
 449 |     Cookbook
 450 |   
 451 | 
 452 |     
 453 |   </span>
 454 |   
 455 |   
 456 | 
 457 |       </a>
 458 |     </li>
 459 |   
 460 | 
 461 |     
 462 |       
 463 |       
 464 |   
 465 |   
 466 |     
 467 |   
 468 |   
 469 |   
 470 |     
 471 |     
 472 |     
 473 |     
 474 |     
 475 |     <li class="md-nav__item md-nav__item--active md-nav__item--nested">
 476 |       
 477 |         
 478 |         
 479 |         <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" checked>
 480 |         
 481 |           
 482 |           <label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
 483 |             
 484 |   
 485 |   
 486 |   <span class="md-ellipsis">
 487 |     
 488 |   
 489 |     Contributing
 490 |   
 491 | 
 492 |     
 493 |   </span>
 494 |   
 495 |   
 496 | 
 497 |             <span class="md-nav__icon md-icon"></span>
 498 |           </label>
 499 |         
 500 |         <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="true">
 501 |           <label class="md-nav__title" for="__nav_11">
 502 |             <span class="md-nav__icon md-icon"></span>
 503 |             
 504 |   
 505 |     Contributing
 506 |   
 507 | 
 508 |           </label>
 509 |           <ul class="md-nav__list" data-md-scrollfix>
 510 |             
 511 |               
 512 |                 
 513 |   
 514 |   
 515 |   
 516 |   
 517 |     <li class="md-nav__item">
 518 |       <a href="../contributing/" class="md-nav__link">
 519 |         
 520 |   
 521 |   
 522 |   <span class="md-ellipsis">
 523 |     
 524 |   
 525 |     Overview
 526 |   
 527 | 
 528 |     
 529 |   </span>
 530 |   
 531 |   
 532 | 
 533 |       </a>
 534 |     </li>
 535 |   
 536 | 
 537 |               
 538 |             
 539 |               
 540 |                 
 541 |   
 542 |   
 543 |     
 544 |   
 545 |   
 546 |   
 547 |     <li class="md-nav__item md-nav__item--active">
 548 |       
 549 |       <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
 550 |       
 551 |       
 552 |         
 553 |       
 554 |       
 555 |         <label class="md-nav__link md-nav__link--active" for="__toc">
 556 |           
 557 |   
 558 |   
 559 |   <span class="md-ellipsis">
 560 |     
 561 |   
 562 |     Adding New Languages
 563 |   
 564 | 
 565 |     
 566 |   </span>
 567 |   
 568 |   
 569 | 
 570 |           <span class="md-nav__icon md-icon"></span>
 571 |         </label>
 572 |       
 573 |       <a href="./" class="md-nav__link md-nav__link--active">
 574 |         
 575 |   
 576 |   
 577 |   <span class="md-ellipsis">
 578 |     
 579 |   
 580 |     Adding New Languages
 581 |   
 582 | 
 583 |     
 584 |   </span>
 585 |   
 586 |   
 587 | 
 588 |       </a>
 589 |       
 590 |         
 591 | 
 592 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
 593 |   
 594 |   
 595 |   
 596 |     
 597 |   
 598 |   
 599 |     <label class="md-nav__title" for="__toc">
 600 |       <span class="md-nav__icon md-icon"></span>
 601 |       Table of contents
 602 |     </label>
 603 |     <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
 604 |       
 605 |         <li class="md-nav__item">
 606 |   <a href="#1-understanding-the-architecture" class="md-nav__link">
 607 |     <span class="md-ellipsis">
 608 |       
 609 |         1. Understanding the Architecture
 610 |       
 611 |     </span>
 612 |   </a>
 613 |   
 614 | </li>
 615 |       
 616 |         <li class="md-nav__item">
 617 |   <a href="#2-steps-to-add-a-new-language-eg-typescript-ts" class="md-nav__link">
 618 |     <span class="md-ellipsis">
 619 |       
 620 |         2. Steps to Add a New Language (e.g., TypeScript - .ts)
 621 |       
 622 |     </span>
 623 |   </a>
 624 |   
 625 |     <nav class="md-nav" aria-label="2. Steps to Add a New Language (e.g., TypeScript - .ts)">
 626 |       <ul class="md-nav__list">
 627 |         
 628 |           <li class="md-nav__item">
 629 |   <a href="#step-21-create-the-language-module-file" class="md-nav__link">
 630 |     <span class="md-ellipsis">
 631 |       
 632 |         Step 2.1: Create the Language Module File
 633 |       
 634 |     </span>
 635 |   </a>
 636 |   
 637 | </li>
 638 |         
 639 |           <li class="md-nav__item">
 640 |   <a href="#step-22-define-tree-sitter-queries-ts_queries" class="md-nav__link">
 641 |     <span class="md-ellipsis">
 642 |       
 643 |         Step 2.2: Define Tree-sitter Queries (TS_QUERIES)
 644 |       
 645 |     </span>
 646 |   </a>
 647 |   
 648 | </li>
 649 |         
 650 |           <li class="md-nav__item">
 651 |   <a href="#step-23-implement-langtreesitterparser-class" class="md-nav__link">
 652 |     <span class="md-ellipsis">
 653 |       
 654 |         Step 2.3: Implement &lt;Lang&gt;TreeSitterParser Class
 655 |       
 656 |     </span>
 657 |   </a>
 658 |   
 659 | </li>
 660 |         
 661 |           <li class="md-nav__item">
 662 |   <a href="#step-24-implement-pre_scan_lang-function" class="md-nav__link">
 663 |     <span class="md-ellipsis">
 664 |       
 665 |         Step 2.4: Implement pre_scan_&lt;lang&gt; Function
 666 |       
 667 |     </span>
 668 |   </a>
 669 |   
 670 | </li>
 671 |         
 672 |           <li class="md-nav__item">
 673 |   <a href="#step-25-integrate-into-graph_builderpy" class="md-nav__link">
 674 |     <span class="md-ellipsis">
 675 |       
 676 |         Step 2.5: Integrate into graph_builder.py
 677 |       
 678 |     </span>
 679 |   </a>
 680 |   
 681 | </li>
 682 |         
 683 |       </ul>
 684 |     </nav>
 685 |   
 686 | </li>
 687 |       
 688 |         <li class="md-nav__item">
 689 |   <a href="#3-verification-and-debugging-using-neo4j" class="md-nav__link">
 690 |     <span class="md-ellipsis">
 691 |       
 692 |         3. Verification and Debugging using Neo4j
 693 |       
 694 |     </span>
 695 |   </a>
 696 |   
 697 |     <nav class="md-nav" aria-label="3. Verification and Debugging using Neo4j">
 698 |       <ul class="md-nav__list">
 699 |         
 700 |           <li class="md-nav__item">
 701 |   <a href="#step-31-prepare-a-sample-project" class="md-nav__link">
 702 |     <span class="md-ellipsis">
 703 |       
 704 |         Step 3.1: Prepare a Sample Project
 705 |       
 706 |     </span>
 707 |   </a>
 708 |   
 709 | </li>
 710 |         
 711 |           <li class="md-nav__item">
 712 |   <a href="#step-32-index-the-sample-project" class="md-nav__link">
 713 |     <span class="md-ellipsis">
 714 |       
 715 |         Step 3.2: Index the Sample Project
 716 |       
 717 |     </span>
 718 |   </a>
 719 |   
 720 | </li>
 721 |         
 722 |           <li class="md-nav__item">
 723 |   <a href="#step-33-query-the-neo4j-graph" class="md-nav__link">
 724 |     <span class="md-ellipsis">
 725 |       
 726 |         Step 3.3: Query the Neo4j Graph
 727 |       
 728 |     </span>
 729 |   </a>
 730 |   
 731 | </li>
 732 |         
 733 |           <li class="md-nav__item">
 734 |   <a href="#step-34-debugging-common-issues" class="md-nav__link">
 735 |     <span class="md-ellipsis">
 736 |       
 737 |         Step 3.4: Debugging Common Issues
 738 |       
 739 |     </span>
 740 |   </a>
 741 |   
 742 | </li>
 743 |         
 744 |       </ul>
 745 |     </nav>
 746 |   
 747 | </li>
 748 |       
 749 |     </ul>
 750 |   
 751 | </nav>
 752 |       
 753 |     </li>
 754 |   
 755 | 
 756 |               
 757 |             
 758 |           </ul>
 759 |         </nav>
 760 |       
 761 |     </li>
 762 |   
 763 | 
 764 |     
 765 |       
 766 |       
 767 |   
 768 |   
 769 |   
 770 |   
 771 |     <li class="md-nav__item">
 772 |       <a href="../troubleshooting/" class="md-nav__link">
 773 |         
 774 |   
 775 |   
 776 |   <span class="md-ellipsis">
 777 |     
 778 |   
 779 |     Troubleshooting
 780 |   
 781 | 
 782 |     
 783 |   </span>
 784 |   
 785 |   
 786 | 
 787 |       </a>
 788 |     </li>
 789 |   
 790 | 
 791 |     
 792 |       
 793 |       
 794 |   
 795 |   
 796 |   
 797 |   
 798 |     <li class="md-nav__item">
 799 |       <a href="../future_work/" class="md-nav__link">
 800 |         
 801 |   
 802 |   
 803 |   <span class="md-ellipsis">
 804 |     
 805 |   
 806 |     Future Work
 807 |   
 808 | 
 809 |     
 810 |   </span>
 811 |   
 812 |   
 813 | 
 814 |       </a>
 815 |     </li>
 816 |   
 817 | 
 818 |     
 819 |       
 820 |       
 821 |   
 822 |   
 823 |   
 824 |   
 825 |     <li class="md-nav__item">
 826 |       <a href="../license/" class="md-nav__link">
 827 |         
 828 |   
 829 |   
 830 |   <span class="md-ellipsis">
 831 |     
 832 |   
 833 |     License
 834 |   
 835 | 
 836 |     
 837 |   </span>
 838 |   
 839 |   
 840 | 
 841 |       </a>
 842 |     </li>
 843 |   
 844 | 
 845 |     
 846 |   </ul>
 847 | </nav>
 848 |                   </div>
 849 |                 </div>
 850 |               </div>
 851 |             
 852 |             
 853 |               
 854 |               <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
 855 |                 <div class="md-sidebar__scrollwrap">
 856 |                   <div class="md-sidebar__inner">
 857 |                     
 858 | 
 859 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
 860 |   
 861 |   
 862 |   
 863 |     
 864 |   
 865 |   
 866 |     <label class="md-nav__title" for="__toc">
 867 |       <span class="md-nav__icon md-icon"></span>
 868 |       Table of contents
 869 |     </label>
 870 |     <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
 871 |       
 872 |         <li class="md-nav__item">
 873 |   <a href="#1-understanding-the-architecture" class="md-nav__link">
 874 |     <span class="md-ellipsis">
 875 |       
 876 |         1. Understanding the Architecture
 877 |       
 878 |     </span>
 879 |   </a>
 880 |   
 881 | </li>
 882 |       
 883 |         <li class="md-nav__item">
 884 |   <a href="#2-steps-to-add-a-new-language-eg-typescript-ts" class="md-nav__link">
 885 |     <span class="md-ellipsis">
 886 |       
 887 |         2. Steps to Add a New Language (e.g., TypeScript - .ts)
 888 |       
 889 |     </span>
 890 |   </a>
 891 |   
 892 |     <nav class="md-nav" aria-label="2. Steps to Add a New Language (e.g., TypeScript - .ts)">
 893 |       <ul class="md-nav__list">
 894 |         
 895 |           <li class="md-nav__item">
 896 |   <a href="#step-21-create-the-language-module-file" class="md-nav__link">
 897 |     <span class="md-ellipsis">
 898 |       
 899 |         Step 2.1: Create the Language Module File
 900 |       
 901 |     </span>
 902 |   </a>
 903 |   
 904 | </li>
 905 |         
 906 |           <li class="md-nav__item">
 907 |   <a href="#step-22-define-tree-sitter-queries-ts_queries" class="md-nav__link">
 908 |     <span class="md-ellipsis">
 909 |       
 910 |         Step 2.2: Define Tree-sitter Queries (TS_QUERIES)
 911 |       
 912 |     </span>
 913 |   </a>
 914 |   
 915 | </li>
 916 |         
 917 |           <li class="md-nav__item">
 918 |   <a href="#step-23-implement-langtreesitterparser-class" class="md-nav__link">
 919 |     <span class="md-ellipsis">
 920 |       
 921 |         Step 2.3: Implement &lt;Lang&gt;TreeSitterParser Class
 922 |       
 923 |     </span>
 924 |   </a>
 925 |   
 926 | </li>
 927 |         
 928 |           <li class="md-nav__item">
 929 |   <a href="#step-24-implement-pre_scan_lang-function" class="md-nav__link">
 930 |     <span class="md-ellipsis">
 931 |       
 932 |         Step 2.4: Implement pre_scan_&lt;lang&gt; Function
 933 |       
 934 |     </span>
 935 |   </a>
 936 |   
 937 | </li>
 938 |         
 939 |           <li class="md-nav__item">
 940 |   <a href="#step-25-integrate-into-graph_builderpy" class="md-nav__link">
 941 |     <span class="md-ellipsis">
 942 |       
 943 |         Step 2.5: Integrate into graph_builder.py
 944 |       
 945 |     </span>
 946 |   </a>
 947 |   
 948 | </li>
 949 |         
 950 |       </ul>
 951 |     </nav>
 952 |   
 953 | </li>
 954 |       
 955 |         <li class="md-nav__item">
 956 |   <a href="#3-verification-and-debugging-using-neo4j" class="md-nav__link">
 957 |     <span class="md-ellipsis">
 958 |       
 959 |         3. Verification and Debugging using Neo4j
 960 |       
 961 |     </span>
 962 |   </a>
 963 |   
 964 |     <nav class="md-nav" aria-label="3. Verification and Debugging using Neo4j">
 965 |       <ul class="md-nav__list">
 966 |         
 967 |           <li class="md-nav__item">
 968 |   <a href="#step-31-prepare-a-sample-project" class="md-nav__link">
 969 |     <span class="md-ellipsis">
 970 |       
 971 |         Step 3.1: Prepare a Sample Project
 972 |       
 973 |     </span>
 974 |   </a>
 975 |   
 976 | </li>
 977 |         
 978 |           <li class="md-nav__item">
 979 |   <a href="#step-32-index-the-sample-project" class="md-nav__link">
 980 |     <span class="md-ellipsis">
 981 |       
 982 |         Step 3.2: Index the Sample Project
 983 |       
 984 |     </span>
 985 |   </a>
 986 |   
 987 | </li>
 988 |         
 989 |           <li class="md-nav__item">
 990 |   <a href="#step-33-query-the-neo4j-graph" class="md-nav__link">
 991 |     <span class="md-ellipsis">
 992 |       
 993 |         Step 3.3: Query the Neo4j Graph
 994 |       
 995 |     </span>
 996 |   </a>
 997 |   
 998 | </li>
 999 |         
1000 |           <li class="md-nav__item">
1001 |   <a href="#step-34-debugging-common-issues" class="md-nav__link">
1002 |     <span class="md-ellipsis">
1003 |       
1004 |         Step 3.4: Debugging Common Issues
1005 |       
1006 |     </span>
1007 |   </a>
1008 |   
1009 | </li>
1010 |         
1011 |       </ul>
1012 |     </nav>
1013 |   
1014 | </li>
1015 |       
1016 |     </ul>
1017 |   
1018 | </nav>
1019 |                   </div>
1020 |                 </div>
1021 |               </div>
1022 |             
1023 |           
1024 |           
1025 |             <div class="md-content" data-md-component="content">
1026 |               
1027 |               <article class="md-content__inner md-typeset">
1028 |                 
1029 |                   
1030 | 
1031 | 
1032 | 
1033 | <h1 id="contributing-new-language-support-to-codegraphcontext">Contributing New Language Support to CodeGraphContext</h1>
1034 | <p>This document outlines the steps and best practices for adding support for a new programming language to CodeGraphContext. By following this guide, contributors can efficiently integrate new languages and leverage the Neo4j graph for verification.</p>
1035 | <h2 id="1-understanding-the-architecture">1. Understanding the Architecture</h2>
1036 | <p>CodeGraphContext uses a modular architecture for multi-language support:</p>
1037 | <ul>
1038 | <li><strong>Generic <code>TreeSitterParser</code> (in <code>graph_builder.py</code>):</strong> This acts as a wrapper, dispatching parsing tasks to language-specific implementations.</li>
1039 | <li><strong>Language-Specific Parser Modules (in <code>src/codegraphcontext/tools/languages/</code>):</strong> Each language (e.g., Python, JavaScript) has its own module (e.g., <code>python.py</code>, <code>javascript.py</code>) containing:<ul>
1040 | <li>Tree-sitter queries (<code>&lt;LANG&gt;_QUERIES</code>).</li>
1041 | <li>A <code>&lt;Lang&gt;TreeSitterParser</code> class that encapsulates language-specific parsing logic.</li>
1042 | <li>A <code>pre_scan_&lt;lang&gt;</code> function for initial symbol mapping.</li>
1043 | </ul>
1044 | </li>
1045 | <li><strong><code>GraphBuilder</code> (in <code>graph_builder.py</code>):</strong> Manages the overall graph building process, including file discovery, pre-scanning, and dispatching to the correct language parser.</li>
1046 | </ul>
1047 | <h2 id="2-steps-to-add-a-new-language-eg-typescript-ts">2. Steps to Add a New Language (e.g., TypeScript - <code>.ts</code>)</h2>
1048 | <h3 id="step-21-create-the-language-module-file">Step 2.1: Create the Language Module File</h3>
1049 | <ol>
1050 | <li>Create a new file: <code>src/codegraphcontext/tools/languages/typescript.py</code>.</li>
1051 | <li>Add the necessary imports: <code>from pathlib import Path</code>, <code>from typing import Any, Dict, Optional, Tuple</code>, <code>import logging</code>, <code>import ast</code> (if needed for AST manipulation).</li>
1052 | <li>Define <code>TS_QUERIES</code> (Tree-sitter queries for TypeScript).</li>
1053 | <li>Create a <code>TypescriptTreeSitterParser</code> class.</li>
1054 | <li>Create a <code>pre_scan_typescript</code> function.</li>
1055 | </ol>
1056 | <h3 id="step-22-define-tree-sitter-queries-ts_queries">Step 2.2: Define Tree-sitter Queries (<code>TS_QUERIES</code>)</h3>
1057 | <p>This is the most critical and often iterative step. You'll need to define queries for:</p>
1058 | <ul>
1059 | <li><strong><code>functions</code></strong>: Function declarations, arrow functions, methods.</li>
1060 | <li><strong><code>classes</code></strong>: Class declarations, class expressions.</li>
1061 | <li><strong><code>imports</code></strong>: ES6 imports (<code>import ... from ...</code>), CommonJS <code>require()</code>.</li>
1062 | <li><strong><code>calls</code></strong>: Function calls, method calls.</li>
1063 | <li><strong><code>variables</code></strong>: Variable declarations (<code>let</code>, <code>const</code>, <code>var</code>).</li>
1064 | <li><strong><code>docstrings</code></strong>: (Optional) How documentation comments are identified.</li>
1065 | <li><strong><code>lambda_assignments</code></strong>: (Optional, Python-specific) If the language has similar constructs.</li>
1066 | </ul>
1067 | <p><strong>Tips for Query Writing:</strong>
1068 | *   <strong>Consult Tree-sitter Grammars:</strong> Find the <code>node-types.json</code> or grammar definition for your language (e.g., <code>tree-sitter-typescript</code>).
1069 | *   <strong>Use <code>tree-sitter parse</code>:</strong> Use the <code>tree-sitter parse</code> command-line tool to inspect the AST of sample code snippets. This is invaluable for identifying correct node types and field names.
1070 | *   <strong>Start Simple:</strong> Begin with basic queries and gradually add complexity.
1071 | *   <strong>Test Iteratively:</strong> After each query, test it with sample code.</p>
1072 | <h3 id="step-23-implement-langtreesitterparser-class">Step 2.3: Implement <code>&lt;Lang&gt;TreeSitterParser</code> Class</h3>
1073 | <p>This class (e.g., <code>TypescriptTreeSitterParser</code>) will encapsulate the language-specific logic.</p>
1074 | <ol>
1075 | <li><strong><code>__init__(self, generic_parser_wrapper)</code></strong>:<ul>
1076 | <li>Store <code>generic_parser_wrapper</code>, <code>language_name</code>, <code>language</code>, <code>parser</code> from the generic wrapper.</li>
1077 | <li>Load <code>TS_QUERIES</code> using <code>self.language.query(query_str)</code>.</li>
1078 | </ul>
1079 | </li>
1080 | <li><strong>Helper Methods</strong>:<ul>
1081 | <li><code>_get_node_text(self, node)</code>: Extracts text from a tree-sitter node.</li>
1082 | <li><code>_get_parent_context(self, node, types=...)</code>: (Language-specific node types for context).</li>
1083 | <li><code>_calculate_complexity(self, node)</code>: (Language-specific complexity nodes).</li>
1084 | <li><code>_get_docstring(self, body_node)</code>: (Language-specific docstring extraction).</li>
1085 | </ul>
1086 | </li>
1087 | <li><strong><code>parse(self, file_path: Path, is_dependency: bool = False) -&gt; Dict</code></strong>:<ul>
1088 | <li>Reads the file, parses it with <code>self.parser</code>.</li>
1089 | <li>Calls its own <code>_find_*</code> methods (<code>_find_functions</code>, <code>_find_classes</code>, etc.).</li>
1090 | <li>Returns a standardized dictionary format (as seen in <code>python.py</code> and <code>javascript.py</code>).</li>
1091 | </ul>
1092 | </li>
1093 | <li><strong><code>_find_*</code> Methods</strong>:
1094 |     Implement these for each query type, extracting data from the AST and populating the standardized dictionary.</li>
1095 | </ol>
1096 | <h3 id="step-24-implement-pre_scan_lang-function">Step 2.4: Implement <code>pre_scan_&lt;lang&gt;</code> Function</h3>
1097 | <p>This function (e.g., <code>pre_scan_typescript</code>) will quickly scan files to build an initial <code>imports_map</code>.</p>
1098 | <ol>
1099 | <li>It takes <code>files: list[Path]</code> and <code>parser_wrapper</code> (an instance of <code>TreeSitterParser</code>).</li>
1100 | <li>Uses a simplified query (e.g., for <code>class_declaration</code> and <code>function_declaration</code>) to quickly find definitions.</li>
1101 | <li>Returns a dictionary mapping symbol names to file paths.</li>
1102 | </ol>
1103 | <h3 id="step-25-integrate-into-graph_builderpy">Step 2.5: Integrate into <code>graph_builder.py</code></h3>
1104 | <ol>
1105 | <li><strong><code>GraphBuilder.__init__</code></strong>:<ul>
1106 | <li>Add <code>'.ts': TreeSitterParser('typescript')</code> to <code>self.parsers</code>.</li>
1107 | </ul>
1108 | </li>
1109 | <li><strong><code>TreeSitterParser.__init__</code></strong>:<ul>
1110 | <li>Add an <code>elif self.language_name == 'typescript':</code> block to initialize <code>self.language_specific_parser</code> with <code>TypescriptTreeSitterParser(self)</code>.</li>
1111 | </ul>
1112 | </li>
1113 | <li><strong><code>GraphBuilder._pre_scan_for_imports</code></strong>:<ul>
1114 | <li>Add an <code>elif '.ts' in files_by_lang:</code> block to import <code>pre_scan_typescript</code> and call it.</li>
1115 | </ul>
1116 | </li>
1117 | </ol>
1118 | <h2 id="3-verification-and-debugging-using-neo4j">3. Verification and Debugging using Neo4j</h2>
1119 | <p>After implementing support for a new language, it's crucial to verify that the graph is being built correctly.</p>
1120 | <h3 id="step-31-prepare-a-sample-project">Step 3.1: Prepare a Sample Project</h3>
1121 | <p>Create a small sample project for your new language (e.g., <code>tests/sample_project_typescript/</code>) with:
1122 | *   Function declarations.
1123 | *   Class declarations (including inheritance).
1124 | *   Various import types (if applicable).
1125 | *   Function calls.
1126 | *   Variable declarations.</p>
1127 | <h3 id="step-32-index-the-sample-project">Step 3.2: Index the Sample Project</h3>
1128 | <ol>
1129 | <li><strong>Delete existing data (if any):</strong>
1130 |     ```bash
1131 |     # Replace with your sample project path
1132 |     <tool_code>print(default_api.delete_repository(repo_path='/path/to/your/sample_project'))</tool_code></li>
1133 | <li><strong>Index the project:</strong>
1134 |     ```bash
1135 |     # Replace with your sample project path
1136 |     <tool_code>print(default_api.add_code_to_graph(path='/path/to/your/sample_project'))</tool_code></li>
1137 | <li><strong>Monitor job status:</strong>
1138 |     ```bash
1139 |     # Use the job_id returned by add_code_to_graph
1140 |     <tool_code>print(default_api.check_job_status(job_id='<your_job_id>'))</tool_code></li>
1141 | </ol>
1142 | <h3 id="step-33-query-the-neo4j-graph">Step 3.3: Query the Neo4j Graph</h3>
1143 | <p>Use Cypher queries to inspect the generated graph.</p>
1144 | <ul>
1145 | <li>
1146 | <p><strong>Check for Files and Language Tags:</strong>
1147 |     <code>cypher
1148 |     MATCH (f:File)
1149 |     WHERE f.path STARTS WITH '/path/to/your/sample_project'
1150 |     RETURN f.name, f.path, f.lang</code>
1151 |     <em>Expected:</em> All files from your sample project should be listed with the correct <code>lang</code> tag.</p>
1152 | </li>
1153 | <li>
1154 | <p><strong>Check for Functions:</strong>
1155 |     <code>cypher
1156 |     MATCH (f:File)-[:CONTAINS]-&gt;(fn:Function)
1157 |     WHERE f.path STARTS WITH '/path/to/your/sample_project'
1158 |       AND fn.lang = '&lt;your_language_name&gt;'
1159 |     RETURN f.name AS FileName, fn.name AS FunctionName, fn.line_number AS Line</code>
1160 |     <em>Expected:</em> All functions from your sample project should be listed.</p>
1161 | </li>
1162 | <li>
1163 | <p><strong>Check for Classes:</strong>
1164 |     <code>cypher
1165 |     MATCH (f:File)-[:CONTAINS]-&gt;(c:Class)
1166 |     WHERE f.path STARTS WITH '/path/to/your/sample_project'
1167 |       AND c.lang = '&lt;your_language_name&gt;'
1168 |     RETURN f.name AS FileName, c.name AS ClassName, c.line_number AS Line</code>
1169 |     <em>Expected:</em> All classes from your sample project should be listed.</p>
1170 | </li>
1171 | <li>
1172 | <p><strong>Check for Imports (Module-level):</strong>
1173 |     <code>cypher
1174 |     MATCH (f:File)-[:IMPORTS]-&gt;(m:Module)
1175 |     WHERE f.path STARTS WITH '/path/to/your/sample_project'
1176 |       AND f.lang = '&lt;your_language_name&gt;'
1177 |     RETURN f.name AS FileName, m.name AS ImportedModule, m.full_import_name AS FullImportName</code>
1178 |     <em>Expected:</em> All module-level imports should be listed.</p>
1179 | </li>
1180 | <li>
1181 | <p><strong>Check for Function Calls:</strong>
1182 |     <code>cypher
1183 |     MATCH (caller:Function)-[:CALLS]-&gt;(callee:Function)
1184 |     WHERE caller.file_path STARTS WITH '/path/to/your/sample_project'
1185 |       AND caller.lang = '&lt;your_language_name&gt;'
1186 |     RETURN caller.name AS Caller, callee.name AS Callee, caller.file_path AS CallerFile, callee.file_path AS CalleeFile</code>
1187 |     <em>Expected:</em> All function calls should be correctly linked.</p>
1188 | </li>
1189 | <li>
1190 | <p><strong>Check for Class Inheritance:</strong>
1191 |     <code>cypher
1192 |     MATCH (child:Class)-[:INHERITS]-&gt;(parent:Class)
1193 |     WHERE child.file_path STARTS WITH '/path/to/your/sample_project'
1194 |       AND child.lang = '&lt;your_language_name&gt;'
1195 |     RETURN child.name AS ChildClass, parent.name AS ParentClass, child.file_path AS ChildFile, parent.file_path AS ParentFile</code>
1196 |     <em>Expected:</em> All inheritance relationships should be correctly linked.</p>
1197 | </li>
1198 | </ul>
1199 | <h3 id="step-34-debugging-common-issues">Step 3.4: Debugging Common Issues</h3>
1200 | <ul>
1201 | <li><strong><code>NameError: Invalid node type ...</code></strong>: Your tree-sitter query is using a node type that doesn't exist in the language's grammar. Use <code>tree-sitter parse</code> to inspect the AST.</li>
1202 | <li><strong>Missing Relationships (e.g., <code>CALLS</code>, <code>IMPORTS</code>)</strong>:<ul>
1203 | <li><strong>Check <code>_find_*</code> methods</strong>: Ensure your <code>_find_*</code> methods are correctly extracting the necessary data.</li>
1204 | <li><strong>Check <code>imports_map</code></strong>: Verify that the <code>pre_scan_&lt;lang&gt;</code> function is correctly populating the <code>imports_map</code>.</li>
1205 | <li><strong>Check <code>local_imports</code> map</strong>: Ensure the <code>local_imports</code> map (built in <code>_create_function_calls</code> and <code>_create_inheritance_links</code>) is correctly resolving symbols.</li>
1206 | </ul>
1207 | </li>
1208 | <li><strong>Incorrect <code>lang</code> tags</strong>: Ensure <code>self.language_name</code> is correctly passed and stored.</li>
1209 | </ul>
1210 | <p>By following these steps, contributors can effectively add and verify new language support.</p>
1211 | 
1212 | 
1213 | 
1214 | 
1215 | 
1216 | 
1217 | 
1218 | 
1219 | 
1220 | 
1221 | 
1222 | 
1223 |                 
1224 |               </article>
1225 |             </div>
1226 |           
1227 |           
1228 | <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
1229 |         </div>
1230 |         
1231 |       </main>
1232 |       
1233 |         <footer class="md-footer">
1234 |   
1235 |   <div class="md-footer-meta md-typeset">
1236 |     <div class="md-footer-meta__inner md-grid">
1237 |       <div class="md-copyright">
1238 |   
1239 |   
1240 |     Made with
1241 |     <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
1242 |       Material for MkDocs
1243 |     </a>
1244 |   
1245 | </div>
1246 |       
1247 |     </div>
1248 |   </div>
1249 | </footer>
1250 |       
1251 |     </div>
1252 |     <div class="md-dialog" data-md-component="dialog">
1253 |       <div class="md-dialog__inner md-typeset"></div>
1254 |     </div>
1255 |     
1256 |     
1257 |     
1258 |       
1259 |       
1260 |       <script id="__config" type="application/json">{"annotate": null, "base": "..", "features": [], "search": "../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
1261 |     
1262 |     
1263 |       <script src="../assets/javascripts/bundle.79ae519e.min.js"></script>
1264 |       
1265 |     
1266 |   </body>
1267 | </html>
```
Page 15/22FirstPrevNextLast