CodeToNeo4j 1.0.40
See the version list below for details.
dotnet tool install --global CodeToNeo4j --version 1.0.40
dotnet new tool-manifest
dotnet tool install --local CodeToNeo4j --version 1.0.40
#tool dotnet:?package=CodeToNeo4j&version=1.0.40
nuke :add-package CodeToNeo4j --version 1.0.40
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.csprojfiles (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,--slnis not required. The tool asks for confirmation before deletion. If--includeis specified, only matching file extensions are purged.--skip-dependenciesand--min-accessibilityare not allowed with this switch. Only one of--log-level,--debug,--verbose, or--quietcan 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 | Versions 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. |
This package has no dependencies.