Skip to content

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

drydock_platforms(project_path: str) -> str

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.toml
  • setup.py
  • requirements.txt
  • Pipfile
  • .python-version

Version detection from: pyproject.toml, setup.py, .python-version

Node.js

  • package.json
  • package-lock.json
  • yarn.lock
  • pnpm-lock.yaml
  • .nvmrc or .node-version

Version detection from: .nvmrc, .node-version, package.json engines field

Rust

  • Cargo.toml
  • Cargo.lock
  • rust-toolchain.toml
  • rust-toolchain

Version detection from: rust-toolchain, Cargo.toml

Go

  • go.mod
  • go.sum

Version detection from: go.mod

.NET

  • .csproj
  • .sln
  • app.config
  • web.config

Version detection from: .csproj TargetFramework

Java

  • pom.xml
  • build.gradle
  • .java-version

Version detection from: pom.xml, build.gradle

Ruby

  • Gemfile
  • .ruby-version

Version detection from: .ruby-version, Gemfile

PHP

  • composer.json
  • composer.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