Platform Detector¶
Detect platforms and runtimes (Oryx-style detection). Answers: "What tech stack is this?"
Detects Node.js, Python, Rust, Go, .NET, Java, Ruby, PHP with version information and confidence levels. Based on Microsoft Oryx's marker-file detection patterns.
Usage¶
CLI¶
python platform_detector.py <project_path>
python platform_detector.py <project_path> --json
python platform_detector.py <project_path> --output platforms.json
MCP¶
Returns platform detection results as JSON.
Example Output¶
{
"project_path": "/path/to/my-project",
"project_name": "my-project",
"platforms": [
{
"platform": "Python",
"version": "3.11",
"confidence": "high",
"marker_files": [
"pyproject.toml",
"requirements.txt",
"setup.py"
],
"version_source": "pyproject.toml"
},
{
"platform": "Node.js",
"version": "18.0.0",
"confidence": "high",
"marker_files": [
"package.json",
"package-lock.json"
],
"version_source": "package.json"
}
],
"is_multi_platform": true
}
Detection Patterns¶
Drydock detects platforms by looking for marker files:
Python¶
pyproject.tomlsetup.pyrequirements.txtPipfile.python-version
Version detection from: pyproject.toml, setup.py, .python-version
Node.js¶
package.jsonpackage-lock.jsonyarn.lockpnpm-lock.yaml.nvmrcor.node-version
Version detection from: .nvmrc, .node-version, package.json engines field
Rust¶
Cargo.tomlCargo.lockrust-toolchain.tomlrust-toolchain
Version detection from: rust-toolchain, Cargo.toml
Go¶
go.modgo.sum
Version detection from: go.mod
.NET¶
.csproj.slnapp.configweb.config
Version detection from: .csproj TargetFramework
Java¶
pom.xmlbuild.gradle.java-version
Version detection from: pom.xml, build.gradle
Ruby¶
Gemfile.ruby-version
Version detection from: .ruby-version, Gemfile
PHP¶
composer.jsoncomposer.lock
Version detection from: composer.json
Confidence Levels¶
- high: Multiple marker files found, version confirmed
- medium: Marker files found, version uncertain or missing
- low: Single marker file, could be false positive
Options¶
| Flag | Type | Default | Description |
|---|---|---|---|
project_path |
positional | required | Path to project root |
--json |
flag | false | Output as JSON |
--output, -o |
string | stdout | Output file path |