Point it at a directory and it tells you what kind of project lives there. No config files, no setup — just file detection.
use ;
if let Some = detect
Features
- 29 ecosystems detected out of the box
- Priority-ordered — language-specific files win over generic build systems
- Ecosystem metadata — Node.js package manager, Flutter vs Dart, Stack vs Cabal, etc.
- Directory walking —
detect_walksearches up the directory tree for monorepo support - Artifact directories — know what to clean for every ecosystem
- Zero dependencies beyond
serde_json(for package.json parsing)
Supported Ecosystems
| Priority | File | Ecosystem | Label |
|---|---|---|---|
| 1 | Cargo.toml |
Rust | "Rust" |
| 2 | go.mod |
Go | "Go" |
| 3 | mix.exs |
Elixir | "Elixir" |
| 4 | pyproject.toml / setup.py |
Python | "Python" |
| 5 | package.json |
Node.js | "Node.js" |
| 6 | build.gradle |
Gradle (Java/Kotlin) | "Gradle" |
| 7 | pom.xml |
Maven (Java) | "Maven" |
| 8 | build.sbt |
Scala | "Scala" |
| 9 | Gemfile |
Ruby | "Ruby" |
| 10 | Package.swift |
Swift | "Swift" |
| 11 | build.zig |
Zig | "Zig" |
| 12 | *.csproj / *.sln |
.NET | ".NET" |
| 13 | composer.json |
PHP | "PHP" |
| 14 | pubspec.yaml |
Dart / Flutter | "Dart" / "Flutter" |
| 15 | stack.yaml / *.cabal |
Haskell | "Haskell" |
| 16 | project.clj / deps.edn |
Clojure | "Clojure" |
| 17 | rebar.config |
Erlang | "Erlang" |
| 18 | dune-project |
OCaml | "OCaml" |
| 19 | cpanfile / Makefile.PL |
Perl | "Perl" |
| 20 | Project.toml |
Julia | "Julia" |
| 21 | *.nimble |
Nim | "Nim" |
| 22 | shard.yml |
Crystal | "Crystal" |
| 23 | v.mod |
V | "V" |
| 24 | gleam.toml |
Gleam | "Gleam" |
| 25 | *.rockspec |
Lua | "Lua" |
| 26 | MODULE.bazel / WORKSPACE |
Bazel | "Bazel" |
| 27 | meson.build |
Meson | "Meson" |
| 28 | CMakeLists.txt |
CMake | "CMake" |
| 29 | Makefile |
Make | "Make" |
Usage
Basic detection
use ;
let kind = detect.unwrap;
println!; // "Rust"
println!; // "Cargo.toml"
Walk up the directory tree
use detect_walk;
// Running from src/lib/ inside a Cargo workspace?
// detect_walk finds the Cargo.toml in the parent.
if let Some = detect_walk
Ecosystem metadata
use ;
match detect
Clean artifacts
use detect;
if let Some = detect
Node.js helpers
use ;
use Path;
let dir = new;
if node_has_script
if node_has_bin
if let Some = detect_node_workspace
License
MIT