ecosyste-ms/resolve-cli

CLI for resolving package dependencies using real package managers

Go

3

12 commits

updated Jun 28, 2026

See the code

README

resolve-cli

CLI tool for resolving package dependencies using real package managers. Part of ecosyste.ms.

Given a package name and registry (or ecosystem), it fetches the package's runtime dependencies from the ecosyste.ms API, creates a temporary project, runs the actual package manager to resolve the full dependency tree, and outputs the result as JSON.

Usage

resolve --registry rubygems.org --package rails --version 7.0.0
resolve --ecosystem npm --package express --version 4.21.2
resolve --ecosystem gem --package sinatra --tree
resolve --ecosystem cargo --package serde --before 2024-01-01

Flags

FlagDescription
--registryecosyste.ms registry name (e.g. rubygems.org, npmjs.org)
--ecosystemPURL type (e.g. gem, npm, cargo, pypi). Alternative to --registry
--packagePackage name (required)
--versionVersion to resolve (default: latest)
--treeOutput full dependency tree with PURLs instead of flat map
--beforeOnly consider versions published before this date (ISO 8601)
--managerOverride the package manager (e.g. uv instead of pip)
--timeoutTimeout in seconds (default: 120)
--api-keyecosyste.ms API key (also reads ECOSYSTEMS_API_KEY env var)

Either --registry or --ecosystem is required.

Output

Flat (default):

{
  "connection_pool": "3.0.2",
  "redis-client": "0.28.0"
}

Tree (--tree):

[
  {
    "purl": "pkg:gem/[email protected]",
    "name": "redis-client",
    "version": "0.28.0",
    "deps": [
      {
        "purl": "pkg:gem/[email protected]",
        "name": "connection_pool",
        "version": "3.0.2"
      }
    ]
  }
]

How it works

  1. Fetches the package's runtime dependencies from the packages.ecosyste.ms API
  2. Determines the appropriate package manager using the registry's PURL type
  3. Creates a temporary project directory
  4. Runs init and add for each dependency using git-pkgs/managers
  5. Runs the manager's resolve command to produce the dependency graph
  6. Parses the output using git-pkgs/resolve into a normalized format with PURLs

Supported ecosystems

npm, gem, cargo, pypi, golang, maven, packagist, pub, hex, nuget, swift, clojars, hackage, conda, deno, helm, conan

Multiple managers are supported per ecosystem (e.g. npm/yarn/pnpm/bun for npm, pip/uv/poetry for pypi). Use --manager to override the default.

Installation

go install github.com/ecosyste-ms/resolve-cli/cmd/resolve@latest

Or build from source:

git clone https://github.com/ecosyste-ms/resolve-cli.git
cd resolve-cli
go build -o resolve ./cmd/resolve

License

AGPL-3.0-or-later

ecosyste-ms/resolve-cli

CLI for resolving package dependencies using real package managers

Go

3

12 commits

updated Jun 28, 2026

See the code

README

resolve-cli

CLI tool for resolving package dependencies using real package managers. Part of ecosyste.ms.

Given a package name and registry (or ecosystem), it fetches the package's runtime dependencies from the ecosyste.ms API, creates a temporary project, runs the actual package manager to resolve the full dependency tree, and outputs the result as JSON.

Usage

resolve --registry rubygems.org --package rails --version 7.0.0
resolve --ecosystem npm --package express --version 4.21.2
resolve --ecosystem gem --package sinatra --tree
resolve --ecosystem cargo --package serde --before 2024-01-01

Flags

FlagDescription
--registryecosyste.ms registry name (e.g. rubygems.org, npmjs.org)
--ecosystemPURL type (e.g. gem, npm, cargo, pypi). Alternative to --registry
--packagePackage name (required)
--versionVersion to resolve (default: latest)
--treeOutput full dependency tree with PURLs instead of flat map
--beforeOnly consider versions published before this date (ISO 8601)
--managerOverride the package manager (e.g. uv instead of pip)
--timeoutTimeout in seconds (default: 120)
--api-keyecosyste.ms API key (also reads ECOSYSTEMS_API_KEY env var)

Either --registry or --ecosystem is required.

Output

Flat (default):

{
  "connection_pool": "3.0.2",
  "redis-client": "0.28.0"
}

Tree (--tree):

[
  {
    "purl": "pkg:gem/[email protected]",
    "name": "redis-client",
    "version": "0.28.0",
    "deps": [
      {
        "purl": "pkg:gem/[email protected]",
        "name": "connection_pool",
        "version": "3.0.2"
      }
    ]
  }
]

How it works

  1. Fetches the package's runtime dependencies from the packages.ecosyste.ms API
  2. Determines the appropriate package manager using the registry's PURL type
  3. Creates a temporary project directory
  4. Runs init and add for each dependency using git-pkgs/managers
  5. Runs the manager's resolve command to produce the dependency graph
  6. Parses the output using git-pkgs/resolve into a normalized format with PURLs

Supported ecosystems

npm, gem, cargo, pypi, golang, maven, packagist, pub, hex, nuget, swift, clojars, hackage, conda, deno, helm, conan

Multiple managers are supported per ecosystem (e.g. npm/yarn/pnpm/bun for npm, pip/uv/poetry for pypi). Use --manager to override the default.

Installation

go install github.com/ecosyste-ms/resolve-cli/cmd/resolve@latest

Or build from source:

git clone https://github.com/ecosyste-ms/resolve-cli.git
cd resolve-cli
go build -o resolve ./cmd/resolve

License

AGPL-3.0-or-later

Project health

Latest release

v0.2.2 · Jun 28, 2026

Releases this year

5