### Start Server with Custom OTLP Settings Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/observability/README.md Starts the server and exports traces using custom OTLP settings. This example configures HTTP protocol to localhost:4318. ```bash OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 \ OTEL_EXPORTER_OTLP_PROTOCOL=http \ cargo run --bin http-server-deployed -- \ --secret-path /path/to/secret \ --data-dir /tmp/gkg-data ``` -------------------------------- ### Check Git Installation and Status Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/troubleshooting.md Ensure Git is installed and your workspace is initialized. This is a prerequisite for indexing to start. ```bash git -v git status ``` -------------------------------- ### Setup Git Hooks with Lefthook Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/dev-environment.md After installing lefthook, run this command to set up the project's Git hooks. ```bash lefthook install ``` -------------------------------- ### Install Development Tools with Mise Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/docs/cloud_service/development.md Use the 'mise' tool manager to install all required development tools, including Tilt and Helm. ```bash mise install ``` -------------------------------- ### Start GKG Server Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/index.mdx Starts the GitLab Knowledge Graph web server. Access the web interface by opening your browser after the server is running. ```bash gkg server start ``` -------------------------------- ### Ruby Import Examples Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/ruby.md Examples of Ruby import statements that are captured. ```ruby require 'json' ``` ```ruby require_relative './user_service' ``` ```ruby load 'config.rb' ``` ```ruby gem 'rails', '~> 7.0' ``` -------------------------------- ### Install Toolchains with Mise Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/dev-environment.md Trust the project's toolchain configuration and install the necessary Rust and Node.js versions using Mise. ```bash mise trust && mise install mise ls ``` -------------------------------- ### Start Server with Default OTLP Settings Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/observability/README.md Starts the server and exports traces using default OTLP gRPC settings to localhost:4317. Requires a secret path and data directory. ```bash cargo run --bin http-server-deployed -- \ --secret-path /path/to/secret \ --data-dir /tmp/gkg-data ``` -------------------------------- ### Start Observability Stack Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/observability/README.md Use this command to start the local observability stack, including Prometheus, Grafana, and Mimir. ```bash mise run observability:up ``` -------------------------------- ### Start gkg Server Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/usage.md Run this command to start the GitLab Knowledge Graph in server mode. The server defaults to http://localhost:27495. ```bash gkg server start ``` -------------------------------- ### Build Documentation Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/build.md Install Node.js dependencies and build the project documentation. ```bash npm ci npm run build --workspace=docs ``` -------------------------------- ### Start gkg server Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/cli/server.md Starts the GitLab Knowledge Graph HTTP server. This command provides a web interface, HTTP API, and real-time events. ```bash gkg server start [OPTIONS] ``` -------------------------------- ### Workspace Manifest Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/kuzu-db-mcp.md An example of the gkg_manifest.json file, which stores configuration for indexed workspaces and their data directory names. ```json { "workspace_folders": { "user/work/gitlab": { "data_directory_name": "3f86676f935f1266", "last_indexed_at": "2025-09-17T23:47:37.040320Z", "status": "indexed", "projects": { "user/work/gitlab": { "project_hash": "3f86676f935f1266", "last_indexed_at": "2025-09-17T23:47:37.040320Z", "status": "indexed", "error_message": null } } } }, "framework_version": "0.13.0" } ``` -------------------------------- ### Java Method/Callable Reference Examples Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Shows examples of method references in Java, including instance and static methods. ```java ::myFunction ``` ```java MyClass::myProperty ``` -------------------------------- ### Start Colima with Kubernetes Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/docs/cloud_service/development.md Use this command to start the Colima container runtime with Kubernetes enabled. The `--vz-rosetta` flag is recommended for Apple Silicon to ensure compatibility with x64 images. ```bash colima start --kubernetes --vm-type=vz --vz-rosetta ``` -------------------------------- ### Install GitLab Knowledge Graph Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/index.mdx Installs the GitLab Knowledge Graph using a curl script. Ensure that `$HOME/.local/bin` is added to your system's PATH. ```bash curl -fsSL https://gitlab.com/gitlab-org/rust/knowledge-graph/-/raw/main/install.sh | bash ``` -------------------------------- ### gkg Server Start Confirmation Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/usage.md This log message indicates that the HTTP server for GitLab Knowledge Graph has successfully started and is listening on the default port. ```bash INFO http_server: HTTP server listening on 127.0.0.1:27495 ``` -------------------------------- ### Install GitLab Knowledge Graph to Custom Directory on Windows Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/install.md Install GitLab Knowledge Graph to a custom directory on Windows by downloading the script and specifying the InstallDir parameter. ```powershell irm https://gitlab.com/gitlab-org/rust/knowledge-graph/-/raw/main/install.ps1 -OutFile install.ps1; .\install.ps1 -InstallDir "C:\Tools\gkg" ``` -------------------------------- ### Install Lefthook Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/dev-environment.md Install the lefthook Git hook manager using one of the provided methods. ```bash # Using homebrew (macOS) brew install lefthook ``` ```bash # Using npm npm install -g lefthook ``` ```bash # Using go go install github.com/evilmartians/lefthook@latest ``` -------------------------------- ### Ruby Reference Resolution Examples Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/ruby.md Examples demonstrating different types of reference resolution in Ruby code. ```ruby User.find_by_email("test@test.com") ``` ```ruby user.profile.update(name: "new") ``` ```ruby user = User.new; user.save ``` ```ruby User::ADMIN_ROLE ``` ```ruby NotificationService.notify ``` ```ruby users.each { |u| u.activate! } ``` -------------------------------- ### Verify gkg Installation Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/ide-integration.md Run this command to verify that the gkg executable is installed and accessible in your system's PATH. This is a prerequisite for IDE integration. ```bash gkg -V ``` -------------------------------- ### Java Method Definition Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Provides a basic example of a public void method signature in Java. ```java public void myMethod() ``` -------------------------------- ### SSE System Event Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md An example of a system event sent over Server-Sent Events, such as the start of a workspace indexing operation. This event includes details about the indexing process. ```http event: gkg-event data: {"WorkspaceIndexing":{"Started":{"workspace_folder_info":{...},"projects_to_process":[...],"started_at":"2024-01-01T00:00:00Z"}}} ``` -------------------------------- ### Ruby Definition Examples Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/ruby.md Examples of Ruby code constructs that are captured as definitions in the Knowledge Graph. ```ruby class User ``` ```ruby module Authentication ``` ```ruby def save ``` ```ruby def self.find_by_email(email) ``` ```ruby lambda { |x| x * 2 } ``` ```ruby proc { puts "Hello" } ``` -------------------------------- ### Start Indexer Server on TCP Socket Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/server-side/deployed-server.md Starts the `http-server-deployed` in indexing mode, listening on a TCP socket. This is useful for network accessibility. Configure the bind address and port appropriately. ```bash cargo run --bin http-server-deployed -- -m indexer --bind 0.0.0.0:3333 --secret-path /path/to/jwt-secret --data-dir /data/gkg ``` -------------------------------- ### Start gkg server in detached mode Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/cli/server.md Starts the server in detached (background) mode. This is useful when the server should not be bound to a terminal session. ```bash gkg server start --detached ``` -------------------------------- ### Java Enum Constant Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Provides an example of an enum constant with a constructor argument. ```java ACTIVE("active") ``` -------------------------------- ### Install Latest GitLab Knowledge Graph on Linux/macOS Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/install.md Use this command to install the latest version of GitLab Knowledge Graph on Linux or macOS. ```bash curl -fsSL https://gitlab.com/gitlab-org/rust/knowledge-graph/-/raw/main/install.sh | bash ``` -------------------------------- ### Install Specific GitLab Knowledge Graph Version on Linux/macOS Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/install.md Install a specific version of GitLab Knowledge Graph by providing the version tag. ```bash curl -fsSL https://gitlab.com/gitlab-org/rust/knowledge-graph/-/raw/main/install.sh | bash -s -- --version v0.9.0 ``` -------------------------------- ### Java Object Instantiation Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Demonstrates the creation of a new object instance using the 'new' keyword in Java. ```java new MyClass() ``` -------------------------------- ### Install Specific GitLab Knowledge Graph Version on Windows Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/install.md Install a specific version of GitLab Knowledge Graph on Windows by downloading the script and providing the version tag. ```powershell irm https://gitlab.com/gitlab-org/rust/knowledge-graph/-/raw/main/install.ps1 -OutFile install.ps1; .\install.ps1 -Version v0.6.0 ``` -------------------------------- ### Example Kubernetes Deployment Configuration Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/server-side/deployed-server.md Demonstrates a typical command-line invocation for deploying the server in a Kubernetes environment, specifying the mode, bind address, data directory, and JWT secret path. ```bash ./http-server-deployed -m indexer --bind 0.0.0.0:3333 --data-dir /data/gkg --secret-path /secrets/jwt ``` -------------------------------- ### Install Latest GitLab Knowledge Graph on Windows Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/install.md Use this command to install the latest version of GitLab Knowledge Graph on Windows via PowerShell. ```powershell irm https://gitlab.com/gitlab-org/rust/knowledge-graph/-/raw/main/install.ps1 | iex ``` -------------------------------- ### Java Record Constructor Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Shows the syntax for a public constructor of a record in Java. ```java public Person() ``` -------------------------------- ### Java Object Array Creation Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Illustrates the creation of an array of objects in Java. ```java new MyClass[1] ``` -------------------------------- ### Run the Local Kubernetes Stack with Tilt Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/docs/cloud_service/development.md Start the complete local Kubernetes stack, including all necessary services, by running the 'tilt up' command. ```bash tilt up ``` -------------------------------- ### Java Annotation Usage Examples Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Demonstrates the application of annotations in Java, with and without arguments. ```java @Annotation ``` ```java @Annotation(...) ``` -------------------------------- ### Dynamic Import Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of using dynamic `import()` to load a module asynchronously. ```javascript const fs = await import('fs') ``` -------------------------------- ### Constructor Call Reference Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a constructor call that is resolved by basic name matching. ```javascript new EmailNotificationHandler() ``` -------------------------------- ### Example gkg Index Output Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/usage.md This output shows a successful completion of the workspace indexing process, detailing statistics like projects indexed, files processed, and entities extracted. ```bash $ gkg index my-project ✅ Workspace indexing completed in 12.34 seconds Workspace Statistics: - Projects indexed: 3 - Files processed: 1,247 - Code entities extracted: 5,832 - Relationships found: 12,156 ``` -------------------------------- ### Start Webserver on Unix Socket Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/server-side/deployed-server.md Initiates the `http-server-deployed` in webserver mode, utilizing a Unix domain socket for communication. This mode is for querying services. ```bash cargo run --bin http-server-deployed -- -m webserver --socket /tmp/gkg-webserver-http.sock --secret-path /path/to/jwt-secret --data-dir /data/gkg ``` -------------------------------- ### Java Wildcard Import Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Illustrates the use of a wildcard import to import all classes from a package. ```java import java.util.*; ``` -------------------------------- ### Java Constructor Definition Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Illustrates the syntax for a public constructor of a class in Java. ```java public MyClass() ``` -------------------------------- ### Java 'super' Reference Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Shows the use of the 'super' keyword to call a method from the superclass in Java. ```java super.method() ``` -------------------------------- ### CommonJS Require Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of importing a module using the CommonJS `require` syntax. ```javascript const fs = require('fs') ``` -------------------------------- ### Java Import Statement Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Demonstrates a standard import statement for a Java class. ```java import java.util.List; ``` -------------------------------- ### Start Webserver on TCP Socket Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/server-side/deployed-server.md Runs the `http-server-deployed` in webserver mode, bound to a TCP socket. This allows for network-based querying. Ensure the bind address and port are correctly set. ```bash cargo run --bin http-server-deployed -- -m webserver --bind 0.0.0.0:3334 --secret-path /path/to/jwt-secret --data-dir /data/gkg ``` -------------------------------- ### TypeScript Class Definition Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a class definition in TypeScript. ```typescript class NotificationProcessor ``` -------------------------------- ### Build Frontend Packages Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/build.md Install Node.js dependencies and build the frontend packages. This is required for the Rust server to embed the web UI assets. ```bash npm ci npm run build --workspace=@gitlab-org/gkg-frontend ``` -------------------------------- ### TypeScript Default Import Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a default import statement in TypeScript. ```typescript import React from 'react' ``` -------------------------------- ### Start Indexer Server on Unix Socket Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/server-side/deployed-server.md Launches the `http-server-deployed` in indexing mode using a Unix domain socket. Ensure the specified paths for the socket, JWT secret, and data directory are valid. ```bash cargo run --bin http-server-deployed -- -m indexer --socket /tmp/gkg-indexer-http.sock --secret-path /path/to/jwt-secret --data-dir /data/gkg ``` -------------------------------- ### Java Record Definition Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Illustrates the concise syntax for defining a public record in Java. ```java public record Person(String name) ``` -------------------------------- ### Java Static Import Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Shows how to use a static import to directly access a static member of a class. ```java import static java.lang.Math.PI; ``` -------------------------------- ### Ruby Method Lookup Order Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/ruby.md Illustrates Ruby's method lookup order when modules are included. The last included module is searched first. ```ruby class User include Authenticatable # Included first include Trackable # Included second - searched first # Method lookup order: User → Trackable → Authenticatable → ApplicationRecord end ``` -------------------------------- ### Server Information Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Get basic server information including version and port. ```APIDOC ## GET /api/info ### Description Get basic server information including version and port. ### Method GET ### Endpoint /api/info ### Response #### Success Response (200) - **port** (integer) - The port the server is running on. - **version** (string) - The current version of the server. ### Response Example ```json { "port": 27495, "version": "0.10.0" } ``` ``` -------------------------------- ### Java Pattern Variable Call Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Demonstrates pattern matching for instanceof and calling a method on the matched variable in Java. ```java obj instanceof MyClass myClass ``` ```java myClass.method() ``` -------------------------------- ### Build Binary without Frontend Assets Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/build.md Build the main binary without requiring Node.js installation or frontend builds. This is useful if the web UI is not needed. ```bash cargo build --release --bin gkg --features no-frontend ``` -------------------------------- ### Graph Queries - Initial Data Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Get initial graph data for visualization. ```APIDOC ## GET /api/graph/initial ### Description Get initial graph data for visualization. ### Method GET ### Endpoint /api/graph/initial ``` -------------------------------- ### Java Static Function Call Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Shows how to call a static method on a class in Java. ```java MyClass.staticMethod() ``` -------------------------------- ### Java Class Definition Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Illustrates the basic syntax for defining a public class in Java. ```java public class MyClass ``` -------------------------------- ### Start gkg server with MCP registration Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/cli/server.md Registers the server with MCP (Model Context Protocol) configuration. This enables AI tools to discover and use the knowledge graph API. ```bash gkg server start --register-mcp ~/.gitlab/duo/mcp.json ``` -------------------------------- ### Java Constructor Overload Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Shows constructor overloading in Java with different parameter types. ```java MyClass(int a) ``` ```java MyClass(String a) ``` -------------------------------- ### TypeScript Type-Only Import Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of importing only type definitions from a module in TypeScript. ```typescript import type { FC } from 'react' ``` -------------------------------- ### Java Method Overload Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Illustrates method overloading in Java with different parameter types. ```java void method(int a) ``` ```java void method(String a) ``` -------------------------------- ### JavaScript Getter and Setter Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Examples of getter and setter definitions within an object in JavaScript. ```javascript get name() {} ``` ```javascript set name(value) {} ``` -------------------------------- ### Java Chain of Calls/Properties Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Represents a sequence of method calls and property accesses in Java. ```java foo.bar().baz.property ``` -------------------------------- ### Clone Repository and Navigate Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/dev-environment.md Clone the project repository and change into the project directory. ```bash git clone https://gitlab.com/gitlab-org/rust/knowledge-graph.git cd knowledge-graph ``` -------------------------------- ### Method Call Reference Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a method call on an object that is resolved by basic name matching. ```javascript processor.queueNotification() ``` -------------------------------- ### TypeScript Namespace Import Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of importing all named exports as a namespace object in TypeScript. ```typescript import * as React from 'react' ``` -------------------------------- ### Run GKG HTTP Server (Custom Port) Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/observability/README.md Run the GKG HTTP server on a custom port by specifying the --bind flag. This example binds to 127.0.0.1:9090. ```bash cargo run --bin http-server-deployed -- --bind 127.0.0.1:9090 --secret-path /path/to/secret ``` -------------------------------- ### Java Enum Definition Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Demonstrates the declaration of a public enum in Java. ```java public enum Status ``` -------------------------------- ### Async/Await Call Reference Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of an asynchronous method call using 'await' that is resolved by basic name matching. ```javascript await this.emailService.sendEmail() ``` -------------------------------- ### Java Interface Definition Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Shows the syntax for defining a generic public interface in Java. ```java public interface Repository ``` -------------------------------- ### Java 'this' Reference Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Illustrates the use of the 'this' keyword to refer to the current object's method in Java. ```java this.method() ``` -------------------------------- ### Example API Request with JWT Authentication Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/server-side/deployed-server.md Shows how to make an authenticated API request to the Knowledge Graph server using `curl`. The `Authorization` header must contain a valid JWT token. ```bash curl -H "Authorization: Bearer " http://localhost:3334/webserver/v1/tool ``` -------------------------------- ### Get Server Information Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Retrieve basic server details like version and the port it's running on. This is useful for initial server checks. ```json { "port": 27495, "version": "0.10.0" } ``` -------------------------------- ### This Call Reference Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a method call using 'this' that is resolved by basic name matching. ```javascript this.emailService.sendEmail() ``` -------------------------------- ### Java Function Call Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Represents a simple function or method call in Java. ```java myFunction() ``` -------------------------------- ### Index a Workspace using curl Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Use this command to start indexing a workspace. Ensure the workspace folder path is correctly specified. ```bash # Start indexing a workspace curl -X POST http://localhost:27495/api/workspace/index \ -H "Content-Type: application/json" \ -d '{"workspace_folder_path": "/path/to/my/workspace"}' ``` -------------------------------- ### Add .local/bin to PATH Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/index.mdx Appends the local binary directory to the PATH environment variable. This is necessary for the GKG installation to be accessible. ```bash export PATH="$HOME/.local/bin:$PATH" ``` -------------------------------- ### Property Access Call Reference Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of accessing a property on an object that is resolved by basic name matching. ```javascript notification.payload.to() ``` -------------------------------- ### Simple Function Call Reference Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a simple function call that is resolved by basic name matching. ```javascript generateUniqueId('prefix') ``` -------------------------------- ### Java Annotation Declaration Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Shows the syntax for declaring a public annotation type in Java. ```java public @interface MyAnnotation ``` -------------------------------- ### Start gkg server with reindexing enabled Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/cli/server.md Enables automatic file watching and re-indexing. The server monitors registered workspaces for file changes and automatically queues re-indexing jobs. ```bash gkg server start --enable-reindexing ``` -------------------------------- ### Java Record Accessor Method Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Demonstrates how to access a field in a Java record using its generated accessor method. ```java personRecord.name() ``` -------------------------------- ### Index a Workspace Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Starts the indexing process for a specified workspace folder. This operation requires a JSON payload containing the path to the workspace folder. ```APIDOC ## POST /api/workspace/index ### Description Starts the indexing process for a specified workspace folder. ### Method POST ### Endpoint /api/workspace/index ### Request Body - **workspace_folder_path** (string) - Required - The absolute path to the workspace folder to be indexed. ### Request Example { "workspace_folder_path": "/path/to/my/workspace" } ``` -------------------------------- ### Get Server Information using curl Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Retrieve general information about the server status and configuration. ```bash # Get server info curl http://localhost:27495/api/info ``` -------------------------------- ### Super Call Reference Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a call to a parent class method using 'super' that is resolved by basic name matching. ```javascript super.postProcess(notification) ``` -------------------------------- ### Run KuzuDB Explorer Docker Container Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/kuzu-db-mcp.md Command to run the KuzuDB Explorer Docker container, allowing exploration of LadybugDB database files. Ensure Docker is installed. ```bash docker run -p 8000:8000 -v ~/.gkg/gkg_workspace_folders//:/database -e KUZU_FILE=database.kz -i --rm kuzudb/explorer:latest ``` -------------------------------- ### Java Annotation Element Declaration Example Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/java.md Demonstrates how to declare an element within an annotation, including a default value. ```java String value() default ""; ``` -------------------------------- ### TypeScript Mixed Imports Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example combining default, named, and aliased imports from a single module in TypeScript. ```typescript import D, { A, B as C } from 'mod' ``` -------------------------------- ### Ruby Limitations: Dynamic Method Creation Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/ruby.md Examples of Ruby code constructs that are not currently captured as definitions. ```ruby define_method(:dynamic_name) { ... } ``` ```ruby def method_missing(name, *args) ``` ```ruby eval("def #{name}; end") ``` -------------------------------- ### list_projects Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/mcp/tools.md Get a list of all projects in the knowledge graph. Useful when you don't know the absolute filesystem path to the current project root directory or want to see all indexed projects. ```APIDOC ## list_projects ### Description Get a list of all projects in the knowledge graph. Useful when you don't know the absolute filesystem path to the current project root directory or want to see all indexed projects. ### Input This tool takes no input parameters. ### Output An object containing: - `projects` (array): A list of project objects, each containing: - `project_path` (string): The absolute path to the project root directory. ``` -------------------------------- ### Build Main Binary (gkg) Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/build.md Compile the main Rust binary. Use the `--release` flag for optimized builds. ```bash cargo build --release --bin gkg ``` -------------------------------- ### TypeScript Import Require Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of using the `import ... = require(...)` syntax for module loading in TypeScript, often for CommonJS interop. ```typescript import express = require('express') ``` -------------------------------- ### Index a Repository with GKG Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/index.mdx Creates the knowledge graph for the current project directory. This command should be run from within your project's root. ```bash gkg index ``` -------------------------------- ### Set Up LadybugDB Dynamic Linking Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/contribute/build.md Configure environment variables to use dynamically linked LadybugDB binaries for faster builds. Ensure the library version matches Cargo.toml. ```bash export KUZU_SHARED=1 export KUZU_INCLUDE_DIR=/path/to/lbug/include export KUZU_LIBRARY_DIR=/path/to/lbug/lib ``` -------------------------------- ### index_project Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/mcp/tools.md Creates new or rebuilds the Knowledge Graph index for a project to reflect recent changes. The project must be indexed in the Knowledge Graph. You can use the `list_projects` tool to get the list of indexed projects. ```APIDOC ## index_project ### Description Creates new or rebuilds the Knowledge Graph index for a project to reflect recent changes. The project must be indexed in the Knowledge Graph. You can use the `list_projects` tool to get the list of indexed projects. ### Input - `project_absolute_path` (string): The absolute path to the project root directory to index. ### Output An object containing: - `stats` (object): Detailed statistics about the indexing process, including file counts, definition counts, relationships, and language-specific information. - `system_message` (string, optional): A message indicating if there were any issues during indexing, for example if no definitions were found. ``` -------------------------------- ### TypeScript Enum Definition Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of an enum definition in TypeScript. ```typescript enum Direction { Up, Down } ``` -------------------------------- ### Graph Queries - Statistics Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Get statistics about the knowledge graph. ```APIDOC ## GET /api/graph/stats ### Description Get statistics about the knowledge graph. ### Method GET ### Endpoint /api/graph/stats ``` -------------------------------- ### Basic gkg index usage Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/cli/index-cmd.md Index the current directory to create a knowledge graph. Use `--stats` to display indexing statistics. ```bash gkg index # Index a specific workspace and show stats gkg index /path/to/my/project --stats ``` -------------------------------- ### TypeScript Decorator Usage Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of applying a decorator to a class in TypeScript. ```typescript @decorator class MyClass ``` -------------------------------- ### TypeScript Function Definition Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a standard function definition in TypeScript. ```typescript function generateUniqueId() ``` -------------------------------- ### TypeScript Method Definition Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of an asynchronous method definition in TypeScript. ```typescript async processNotification() ``` -------------------------------- ### Graph Queries - Neighbors Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Get neighboring nodes for graph exploration. ```APIDOC ## GET /api/graph/neighbors ### Description Get neighboring nodes for graph exploration. ### Method GET ### Endpoint /api/graph/neighbors ``` -------------------------------- ### TypeScript Aliased Import Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of importing a named export and aliasing it in TypeScript. ```typescript import { Component as ReactComponent } ``` -------------------------------- ### TypeScript Named Generator Function Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a named generator function in TypeScript. ```typescript const gen = function* () {} ``` -------------------------------- ### TypeScript Named Function Expression Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a named function expression in TypeScript. ```typescript const validate = function() {} ``` -------------------------------- ### TypeScript Named Arrow Function Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a named arrow function in TypeScript. ```typescript const validate = (input) => {} ``` -------------------------------- ### TypeScript Named Class Expression Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a named class expression in TypeScript. ```typescript const UserClass = class {} ``` -------------------------------- ### Enum Access in TypeScript Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of accessing an enum member. This is a basic feature that should be resolvable. ```typescript Direction.Up ``` -------------------------------- ### Import Assertions Limitation Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of an import assertion, which is a feature not yet supported for indexing. ```typescript import config from './config.json' assert { type: 'json' } ``` -------------------------------- ### TypeScript Side-Effect Import Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of importing a module solely for its side effects in TypeScript. ```typescript import 'reflect-metadata' ``` -------------------------------- ### Run GKG HTTP Server (Default Port) Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/observability/README.md Run the GKG HTTP server with default settings, binding to 127.0.0.1:8080. Ensure the secret path is provided. ```bash cargo run --bin http-server-deployed -- --secret-path /path/to/secret ``` -------------------------------- ### TypeScript Named Import Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of importing specific named exports from a module in TypeScript. ```typescript import { useState } from 'react' ``` -------------------------------- ### TypeScript Complex Class Expression Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a complex class expression assignment in TypeScript. ```typescript const classes = { A: class A {} } ``` -------------------------------- ### TypeScript Interface Method Declaration Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a method declaration within an interface in TypeScript. ```typescript interface Name { methodName(): void } ``` -------------------------------- ### Index Workspace Request Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Initiate indexing for a new or existing workspace. Provide the path to the workspace folder. The server will return the status as 'indexing'. ```json { "workspace_folder_path": "/path/to/workspace" } ``` ```json { "workspace_folder_path": "/path/to/workspace", "data_directory_name": "workspace_hash", "status": "indexing", "last_indexed_at": null, "project_count": 2 } ``` -------------------------------- ### TypeScript Dynamic Method Name Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a method with a dynamically computed name in TypeScript. ```typescript `[`dynamic${Date.now()}`]() {}` ``` -------------------------------- ### TypeScript Class Factory Function Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a function that returns a class definition in TypeScript. ```typescript const ClassFactory = (base) => class {} ``` -------------------------------- ### List Workspaces and Projects using curl Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/api/server.md Retrieve a list of all configured workspaces and their associated projects. ```bash # Get all workspaces and their projects curl http://localhost:27495/api/workspace/list ``` -------------------------------- ### JavaScript Object Method Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a method defined directly within an object literal in JavaScript. ```javascript const obj = { method() {} } ``` -------------------------------- ### Grant Database Permissions Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/docs/cloud_service/development.md Connect to the PostgreSQL database using the GDK command-line tool and create a new role named 'nonroot' with login privileges and superuser status. An empty password is used. ```bash gdk psql ``` ```sql CREATE ROLE nonroot WITH LOGIN PASSWORD ''; ALTER ROLE nonroot WITH SUPERUSER; ``` -------------------------------- ### Export OpenTelemetry Traces to GitLab (OTLP HTTP) Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/observability/README.md Configure environment variables to export traces over OTLP HTTP to GitLab. Ensure you replace `` with a valid project access token. ```bash OTEL_EXPORTER_OTLP_PROTOCOL=http \ OTEL_EXPORTER_OTLP_ENDPOINT=https://gitlab.com/api/v4/projects/69095239/observability/v1/traces \ OTEL_EXPORTER_OTLP_HEADERS="PRIVATE-TOKEN=" \ cargo run --bin http-server-deployed -- --secret-path /path/to/secret ``` -------------------------------- ### TypeScript Named IIFE Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a named Immediately Invoked Function Expression (IIFE) in TypeScript. ```typescript (function namedIIFE() {})() ``` -------------------------------- ### Configure Kuzu MCP Server for Claude Desktop Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/getting-started/kuzu-db-mcp.md JSON configuration to add a Kuzu MCP server to Claude Desktop. Replace placeholders with actual paths and database file names. ```json { "mcpServers": { "kuzu": { "command": "docker", "args": [ "run", "-v", "{Path to the directory containing LadybugDB database file}:/database", "-e", "KUZU_DB_FILE={LadybugDB database file name}", "--rm", "-i", "kuzudb/mcp-server" ] } } } ``` -------------------------------- ### TypeScript Static Field with Class Source: https://gitlab.com/gitlab-org/rust/knowledge-graph/-/blob/main/packages/docs/src/content/docs/languages/typescript.md Example of a static field in TypeScript that holds a class definition. ```typescript static InnerStatic = class {} ```