Dependency analyzer for Godot/GDScript projects
Project description
gdcruiser
A dependency analyzer for Godot/GDScript projects. Scans your project to build a dependency graph, detect circular dependencies, and export visualizations.
Features
- Analyzes
.gd(GDScript) and.tscn(scene) files - Detects circular dependencies
- Resolves
class_namedeclarations to map symbolic inheritance - Multiple output formats: human-readable text, JSON, and GraphViz DOT
- Returns non-zero exit code when cycles are detected (CI-friendly)
Installation
Requires Python 3.13+.
pip install gdcruiser
Or with uv:
uv tool install gdcruiser
Usage
gdcruiser [-h] [-f {text,json,dot}] [-o FILE] [--no-cycles] [-v] [path]
| Option | Description |
|---|---|
path |
Godot project path (default: current directory) |
-f, --format |
Output format: text (default), json, or dot |
-o, --output |
Write output to file instead of stdout |
--no-cycles |
Skip cycle detection |
-v, --verbose |
Verbose output |
Examples
Analyze the current directory:
gdcruiser .
Analyze a specific project and output JSON:
gdcruiser /path/to/godot/project -f json
Generate a GraphViz DOT file:
gdcruiser . -f dot -o deps.dot
dot -Tpng deps.dot -o deps.png
Output Formats
Text (default)
============================================================
GDScript Dependency Analysis
============================================================
Modules: 9
Dependencies: 8
----------------------------------------
CIRCULAR DEPENDENCIES (1 found)
----------------------------------------
Cycle 1:
-> res://cycle_b.gd
-> res://cycle_a.gd
-> res://cycle_b.gd (back to start)
----------------------------------------
MODULE DEPENDENCIES
----------------------------------------
res://player.gd
class_name: Player
extends_class: res://base_entity.gd:2
preload: res://inventory.gd:5
JSON
{
"graph": {
"modules": {
"res://player.gd": {
"path": "res://player.gd",
"class_name": "Player",
"dependencies": [
{
"target": "res://base_entity.gd",
"type": "extends_class",
"line": 2,
"resolved": true
}
]
}
},
"stats": {
"module_count": 9,
"dependency_count": 8
}
},
"cycles": [],
"symbols": {
"Player": "res://player.gd"
},
"errors": []
}
GraphViz DOT
digraph dependencies {
rankdir=LR;
node [shape=box, fontname="monospace"];
"res://player.gd" [label="Player\nplayer.gd"];
"res://base_entity.gd" [label="BaseEntity\nbase_entity.gd"];
"res://player.gd" -> "res://base_entity.gd" [label="extends"];
}
Nodes involved in cycles are highlighted in red.
Supported Dependency Patterns
gdcruiser detects the following GDScript patterns:
| Pattern | Example |
|---|---|
extends (path) |
extends "res://path/to/script.gd" |
extends (class) |
extends ClassName |
class_name |
class_name MyClass |
preload() |
preload("res://path/to/file.gd") |
load() |
load("res://path/to/file.gd") |
For .tscn files, it detects scripts attached to nodes via [ext_resource].
Development
Install dependencies:
uv sync
Set up pre-commit hooks:
uv run pre-commit install
This installs hooks for pre-commit, commit-msg, and post-checkout stages. On every commit the hooks will:
- Fix trailing whitespace and line endings
- Lint and format with Ruff
- Run the test suite with pytest
- Enforce Conventional Commits for commit messages
Run the CLI:
uv run gdcruiser
Run tests:
uv run pytest
Run linter:
uv run ruff check .
Format code:
uv run ruff format .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gdcruiser-1.2.0.tar.gz.
File metadata
- Download URL: gdcruiser-1.2.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e4d0e21227ab281d5e8379a91ee16b32ba833fc43f1d58e6f6ba99dcc12faf7
|
|
| MD5 |
16107a1374a1e0b1e851394f7f141cc1
|
|
| BLAKE2b-256 |
7771bedab6daf0e96e1bfa559601ae7cb62622ab071eecc6b0108cc218a5d61a
|
Provenance
The following attestation bundles were made for gdcruiser-1.2.0.tar.gz:
Publisher:
cd.yaml on Thurbeen/gdcruiser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gdcruiser-1.2.0.tar.gz -
Subject digest:
4e4d0e21227ab281d5e8379a91ee16b32ba833fc43f1d58e6f6ba99dcc12faf7 - Sigstore transparency entry: 930056184
- Sigstore integration time:
-
Permalink:
Thurbeen/gdcruiser@ea5ede3944b314e9035a6416577762d5ec106f83 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Thurbeen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@ea5ede3944b314e9035a6416577762d5ec106f83 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gdcruiser-1.2.0-py3-none-any.whl.
File metadata
- Download URL: gdcruiser-1.2.0-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd64192a77fc292dd0c0d356fce1c4bd12804f2df537191c8c48238aafb7d42e
|
|
| MD5 |
66f7363c6958bd2cbfe64aefb5a5d606
|
|
| BLAKE2b-256 |
b49521d842089be15ac7a00442b5bae1ebb556459d2c8305308319ca24d46731
|
Provenance
The following attestation bundles were made for gdcruiser-1.2.0-py3-none-any.whl:
Publisher:
cd.yaml on Thurbeen/gdcruiser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gdcruiser-1.2.0-py3-none-any.whl -
Subject digest:
bd64192a77fc292dd0c0d356fce1c4bd12804f2df537191c8c48238aafb7d42e - Sigstore transparency entry: 930056187
- Sigstore integration time:
-
Permalink:
Thurbeen/gdcruiser@ea5ede3944b314e9035a6416577762d5ec106f83 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Thurbeen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yaml@ea5ede3944b314e9035a6416577762d5ec106f83 -
Trigger Event:
push
-
Statement type: