CodeToNeo4j 1.0.39

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global CodeToNeo4j --version 1.0.39
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local CodeToNeo4j --version 1.0.39
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CodeToNeo4j&version=1.0.39
                    
nuke :add-package CodeToNeo4j --version 1.0.39
                    

CodeToNeo4j

CodeToNeo4j is a .NET tool that analyzes .NET solutions and indexes their structure (projects, files, symbols, and documentation) into a Neo4j graph database.

Features

  • Multi-File Support: Indexes .cs, .razor, .xaml, .js, .html, .xml, .json, .css, and .csproj files (configurable via --include).
  • Structural Ingestion: Indexes Projects, Files, and Symbols (Classes, Methods, Directives, UI Elements).
  • Semantic Metadata: Ingests XML Documentation and code comments for every symbol.
  • Incremental Indexing: Only process changed files using --diff-base. When enabled, also ingests detailed commit history (hashes, authors, messages) and links them to the modified files.
  • Git Metadata: Tracks file metadata including creation/modification dates, commits, and individual author statistics (contribution counts and dates).
  • Administrative Tools: Safely purge data by repository key using --purge-data-by-repository-key.
  • Accessibility Filtering: Control which members are indexed using --min-accessibility.
  • Platform Native Progress: Special progress reporting for GitHub Actions and Azure DevOps.

Installation

Install the tool globally using NuGet:

dotnet tool install --global CodeToNeo4j

Basic Usage

Run the tool by pointing it to your solution file and providing Neo4j credentials:

codetoneo4j \
  -sln ./MySolution.sln \
  --uri bolt://localhost:7687 \
  --password your-password \
  --repository-key my-repo-id

Key Options

Option Description
--sln, -s Required unless using --purge-data-by-repository-key. Path to the .sln file to index.
--repository-key, -r Required. A unique identifier for the repository in Neo4j.
--password, -p Required. Password for the Neo4j database.
--uri, -u, --url Neo4j connection string (Default: bolt://localhost:7687).
--user Neo4j username (Default: neo4j).
--database, -db Neo4j database name (Default: neo4j).
--diff-base Optional git base ref (e.g., origin/main) for incremental indexing.
--log-level, -l Logging verbosity (Information, Debug, etc.).
--debug, -d Turn on debug logging.
--verbose, -v Turn on trace logging.
--quiet, -q Mute all logging output.
--skip-dependencies Skip NuGet dependency ingestion.
--min-accessibility Minimum accessibility level (e.g., Public, Internal, Private).
--include, -i File extensions to include (Default: all supported).
--purge-data-by-repository-key Purge data associated with the repository key.

Note: When using --purge-data-by-repository-key, --sln is not required. The tool asks for confirmation before deletion. If --include is specified, only matching file extensions are purged. --skip-dependencies and --min-accessibility are not allowed with this switch. Only one of --log-level, --debug, --verbose, or --quiet can be used.

Purge examples

  • Full purge:
    codetoneo4j --repository-key my-repo --password your-pass --uri bolt://localhost:7687 --database neo4j --purge-data-by-repository-key
    
  • Purge only certain file types:
    codetoneo4j --repository-key my-repo --password your-pass --uri bolt://localhost:7687 --database neo4j \
      --purge-data-by-repository-key \
      --include .cs --include .razor
    

Prerequisites

  • .NET 8, 9, or 10 SDK must be installed on the machine.
  • Neo4j 5.0+ database.
  • Git (if using --diff-base).

For more detailed documentation, visit the GitHub Repository.

CI/CD Integration

GitHub Actions

You can install and run CodeToNeo4j directly in your GitHub workflows:

- name: Setup .NET
  uses: actions/setup-dotnet@v4
  with:
    global-json-file: global.json

- name: Install CodeToNeo4j
  run: dotnet tool install --global CodeToNeo4j

- name: Run CodeToNeo4j
  run: |
    codetoneo4j \
      -s ./MySolution.sln \
      --repository-key my-repo \
      --uri ${{ secrets.NEO4J_URL }} \
      --password ${{ secrets.NEO4J_PASS }} \
      --diff-base ${{ github.event.before }}

Azure DevOps

Use the .NET Core task to install and run the tool:

steps:
- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    useGlobalJson: true

- script: dotnet tool install --global CodeToNeo4j
  displayName: 'Install CodeToNeo4j'

- script: |
    codetoneo4j \
      -s ./MySolution.sln \
      --repository-key my-repo \
      --uri $(NEO4J_URL) \
      --password $(NEO4J_PASS) \
      --diff-base $(System.PullRequest.SourceCommitId)
  displayName: 'Run CodeToNeo4j'
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.41 33 3/5/2026
1.0.40 40 3/3/2026
1.0.39 33 3/3/2026
1.0.38 34 3/3/2026
1.0.37 50 3/3/2026
Loading failed