ecosyste-ms-cli 1.5.0__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. ecosyste_ms_cli-2.0.0/CHANGELOG.md +8 -0
  2. {ecosyste_ms_cli-1.5.0/ecosyste_ms_cli.egg-info → ecosyste_ms_cli-2.0.0}/PKG-INFO +10 -11
  3. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0/ecosyste_ms_cli.egg-info}/PKG-INFO +10 -11
  4. ecosyste_ms_cli-2.0.0/ecosyste_ms_cli.egg-info/requires.txt +19 -0
  5. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/__init__.py +1 -1
  6. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/advisories.openapi.yaml +1 -1
  7. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/commits.openapi.yaml +2 -2
  8. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/issues.openapi.yaml +2 -2
  9. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/packages.openapi.yaml +68 -4
  10. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/repos.openapi.yaml +2 -2
  11. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/cli.py +3 -0
  12. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/advisories.py +34 -2
  13. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/decorators.py +4 -0
  14. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/diff.py +2 -2
  15. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/execution.py +38 -9
  16. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/generator.py +29 -2
  17. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/licenses.py +2 -2
  18. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/mcp.py +3 -3
  19. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/parser.py +2 -2
  20. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/resolve.py +16 -6
  21. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/sbom.py +2 -2
  22. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/constants.py +1 -0
  23. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/exceptions.py +10 -1
  24. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/click_params.py +7 -1
  25. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/get_domain.py +11 -6
  26. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/job_polling.py +18 -7
  27. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/print_output.py +74 -12
  28. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/purl_parser.py +32 -7
  29. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/openapi_client.py +34 -6
  30. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/pyproject.toml +10 -11
  31. ecosyste_ms_cli-2.0.0/tests/test_cli.py +160 -0
  32. ecosyste_ms_cli-2.0.0/tests/test_help_output.py +83 -0
  33. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_openapi_client.py +83 -6
  34. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_print_output.py +103 -0
  35. ecosyste_ms_cli-1.5.0/CHANGELOG.md +0 -8
  36. ecosyste_ms_cli-1.5.0/ecosyste_ms_cli.egg-info/requires.txt +0 -22
  37. ecosyste_ms_cli-1.5.0/tests/test_cli.py +0 -75
  38. ecosyste_ms_cli-1.5.0/tests/test_help_output.py +0 -40
  39. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/LICENSE +0 -0
  40. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/MANIFEST.in +0 -0
  41. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/Readme.md +0 -0
  42. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosyste_ms_cli.egg-info/SOURCES.txt +0 -0
  43. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosyste_ms_cli.egg-info/dependency_links.txt +0 -0
  44. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosyste_ms_cli.egg-info/entry_points.txt +0 -0
  45. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosyste_ms_cli.egg-info/top_level.txt +0 -0
  46. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/__main__.py +0 -0
  47. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/__init__.py +0 -0
  48. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/archives.openapi.yaml +0 -0
  49. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/dependabot.openapi.yaml +0 -0
  50. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/diff.openapi.yaml +0 -0
  51. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/docker.openapi.yaml +0 -0
  52. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/licenses.openapi.yaml +0 -0
  53. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/opencollective.openapi.yaml +0 -0
  54. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/parser.openapi.yaml +0 -0
  55. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/registries.yaml +0 -0
  56. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/resolve.openapi.yaml +0 -0
  57. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/sbom.openapi.yaml +0 -0
  58. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/sponsors.openapi.yaml +0 -0
  59. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/summary.openapi.yaml +0 -0
  60. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/apis/timeline.openapi.yaml +0 -0
  61. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/__init__.py +0 -0
  62. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/archives.py +0 -0
  63. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/commits.py +0 -0
  64. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/dependabot.py +0 -0
  65. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/docker.py +0 -0
  66. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/__init__.py +0 -0
  67. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/advisories.py +0 -0
  68. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/archives.py +0 -0
  69. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/base.py +0 -0
  70. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/commits.py +0 -0
  71. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/default.py +0 -0
  72. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/dependabot.py +0 -0
  73. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/diff.py +0 -0
  74. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/docker.py +0 -0
  75. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/factory.py +0 -0
  76. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/issues.py +0 -0
  77. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/licenses.py +0 -0
  78. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/opencollective.py +0 -0
  79. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/packages.py +0 -0
  80. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/parser.py +0 -0
  81. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/repos.py +0 -0
  82. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/resolve.py +0 -0
  83. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/sbom.py +0 -0
  84. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/sponsors.py +0 -0
  85. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/summary.py +0 -0
  86. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/handlers/timeline.py +0 -0
  87. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/issues.py +0 -0
  88. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/opencollective.py +0 -0
  89. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/packages.py +0 -0
  90. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/purl_options.py +0 -0
  91. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/repos.py +0 -0
  92. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/sponsors.py +0 -0
  93. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/summary.py +0 -0
  94. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/commands/timeline.py +0 -0
  95. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/build_kwargs.py +0 -0
  96. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/flatten_dict.py +0 -0
  97. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/format_value.py +0 -0
  98. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/load_api_spec.py +0 -0
  99. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/print_error.py +0 -0
  100. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/helpers/print_operations.py +0 -0
  101. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/ecosystems_cli/mcp_server.py +0 -0
  102. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/setup.cfg +0 -0
  103. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_cli_domain.py +0 -0
  104. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_constants.py +0 -0
  105. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_format_value.py +0 -0
  106. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_handlers.py +0 -0
  107. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_load_api_spec.py +0 -0
  108. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_mcp_server.py +0 -0
  109. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_package_metadata.py +0 -0
  110. {ecosyste_ms_cli-1.5.0 → ecosyste_ms_cli-2.0.0}/tests/test_print_operations.py +0 -0
@@ -0,0 +1,8 @@
1
+ # Changelog for v2.0.0
2
+
3
+ ## Changes since v1.6.0
4
+
5
+ - feat!: refresh vendored API specs, track upstream getHosts rename (a1c53a6)
6
+ - ci: bump pinned GitHub Action SHAs to latest releases (e3e9a9b)
7
+ - fix(deps): bump mcp to 1.30 for security advisories, refresh pins (75916bb)
8
+ - chore: bump pre-commit hook revisions (459b34c)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecosyste_ms_cli
3
- Version: 1.5.0
3
+ Version: 2.0.0
4
4
  Summary: CLI for ecosyste.ms API
5
5
  Author-email: Sebastian Schürmann <sebs@2xs.org>
6
6
  License-Expression: MIT
@@ -21,23 +21,22 @@ Classifier: Topic :: Utilities
21
21
  Requires-Python: >=3.9
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
- Requires-Dist: click~=8.3.1
25
- Requires-Dist: requests~=2.33.1
24
+ Requires-Dist: click~=8.5.0
25
+ Requires-Dist: requests~=2.34.2
26
26
  Requires-Dist: pyyaml~=6.0.3
27
27
  Requires-Dist: rich~=15.0.0
28
- Requires-Dist: mcp~=1.27.0
28
+ Requires-Dist: mcp~=1.30.0
29
29
  Requires-Dist: openapi-core~=0.23.0
30
30
  Requires-Dist: packageurl-python~=0.17.6
31
- Requires-Dist: importlib-resources; python_version < "3.9"
32
31
  Provides-Extra: dev
33
- Requires-Dist: pytest~=9.0.2; extra == "dev"
34
- Requires-Dist: pytest-asyncio~=1.3.0; extra == "dev"
35
- Requires-Dist: black~=26.3.1; extra == "dev"
36
- Requires-Dist: isort~=8.0.1; extra == "dev"
32
+ Requires-Dist: pytest~=9.1.1; extra == "dev"
33
+ Requires-Dist: pytest-asyncio~=1.4.0; extra == "dev"
34
+ Requires-Dist: black~=26.5.1; extra == "dev"
35
+ Requires-Dist: isort~=9.0.1; extra == "dev"
37
36
  Requires-Dist: flake8~=7.3.0; extra == "dev"
38
37
  Requires-Dist: bandit~=1.9.4; extra == "dev"
39
- Requires-Dist: complexipy~=5.3.0; extra == "dev"
40
- Requires-Dist: tomli~=2.3.0; python_version < "3.11" and extra == "dev"
38
+ Requires-Dist: complexipy~=8.0.1; extra == "dev"
39
+ Requires-Dist: tomli~=2.4.1; python_version < "3.11" and extra == "dev"
41
40
  Dynamic: license-file
42
41
 
43
42
  # Ecosystems CLI
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecosyste_ms_cli
3
- Version: 1.5.0
3
+ Version: 2.0.0
4
4
  Summary: CLI for ecosyste.ms API
5
5
  Author-email: Sebastian Schürmann <sebs@2xs.org>
6
6
  License-Expression: MIT
@@ -21,23 +21,22 @@ Classifier: Topic :: Utilities
21
21
  Requires-Python: >=3.9
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
- Requires-Dist: click~=8.3.1
25
- Requires-Dist: requests~=2.33.1
24
+ Requires-Dist: click~=8.5.0
25
+ Requires-Dist: requests~=2.34.2
26
26
  Requires-Dist: pyyaml~=6.0.3
27
27
  Requires-Dist: rich~=15.0.0
28
- Requires-Dist: mcp~=1.27.0
28
+ Requires-Dist: mcp~=1.30.0
29
29
  Requires-Dist: openapi-core~=0.23.0
30
30
  Requires-Dist: packageurl-python~=0.17.6
31
- Requires-Dist: importlib-resources; python_version < "3.9"
32
31
  Provides-Extra: dev
33
- Requires-Dist: pytest~=9.0.2; extra == "dev"
34
- Requires-Dist: pytest-asyncio~=1.3.0; extra == "dev"
35
- Requires-Dist: black~=26.3.1; extra == "dev"
36
- Requires-Dist: isort~=8.0.1; extra == "dev"
32
+ Requires-Dist: pytest~=9.1.1; extra == "dev"
33
+ Requires-Dist: pytest-asyncio~=1.4.0; extra == "dev"
34
+ Requires-Dist: black~=26.5.1; extra == "dev"
35
+ Requires-Dist: isort~=9.0.1; extra == "dev"
37
36
  Requires-Dist: flake8~=7.3.0; extra == "dev"
38
37
  Requires-Dist: bandit~=1.9.4; extra == "dev"
39
- Requires-Dist: complexipy~=5.3.0; extra == "dev"
40
- Requires-Dist: tomli~=2.3.0; python_version < "3.11" and extra == "dev"
38
+ Requires-Dist: complexipy~=8.0.1; extra == "dev"
39
+ Requires-Dist: tomli~=2.4.1; python_version < "3.11" and extra == "dev"
41
40
  Dynamic: license-file
42
41
 
43
42
  # Ecosystems CLI
@@ -0,0 +1,19 @@
1
+ click~=8.5.0
2
+ requests~=2.34.2
3
+ pyyaml~=6.0.3
4
+ rich~=15.0.0
5
+ mcp~=1.30.0
6
+ openapi-core~=0.23.0
7
+ packageurl-python~=0.17.6
8
+
9
+ [dev]
10
+ pytest~=9.1.1
11
+ pytest-asyncio~=1.4.0
12
+ black~=26.5.1
13
+ isort~=9.0.1
14
+ flake8~=7.3.0
15
+ bandit~=1.9.4
16
+ complexipy~=8.0.1
17
+
18
+ [dev:python_version < "3.11"]
19
+ tomli~=2.4.1
@@ -1,3 +1,3 @@
1
1
  """Ecosystems CLI tool for interacting with ecosyste.ms APIs."""
2
2
 
3
- __version__ = "1.5.0"
3
+ __version__ = "2.0.0"
@@ -162,7 +162,7 @@ paths:
162
162
  example: purl or repository_url parameter is required
163
163
  "/advisories/{advisoryUUID}":
164
164
  get:
165
- summary: get a advisories by uuid
165
+ summary: get an advisory by uuid
166
166
  operationId: getAdvisory
167
167
  tags:
168
168
  - advisories
@@ -37,8 +37,8 @@ paths:
37
37
  "$ref": "#/components/schemas/Repository"
38
38
  "/hosts":
39
39
  get:
40
- summary: list registies
41
- operationId: getRegistries
40
+ summary: list hosts
41
+ operationId: getHosts
42
42
  parameters:
43
43
  - name: page
44
44
  in: query
@@ -37,8 +37,8 @@ paths:
37
37
  "$ref": "#/components/schemas/Repository"
38
38
  "/hosts":
39
39
  get:
40
- summary: list registies
41
- operationId: getRegistries
40
+ summary: list hosts
41
+ operationId: getHosts
42
42
  parameters:
43
43
  - name: page
44
44
  in: query
@@ -201,9 +201,64 @@ paths:
201
201
  type: array
202
202
  items:
203
203
  "$ref": "#/components/schemas/PackageWithRegistry"
204
+ "/versions/lookup":
205
+ get:
206
+ summary: lookup versions by integrity hash
207
+ operationId: lookupVersions
208
+ tags:
209
+ - versions
210
+ parameters:
211
+ - name: integrity
212
+ in: query
213
+ description: integrity hash (SRI format)
214
+ required: false
215
+ schema:
216
+ type: string
217
+ - name: sha256
218
+ in: query
219
+ description: sha256 hash (hex)
220
+ required: false
221
+ schema:
222
+ type: string
223
+ - name: sha1
224
+ in: query
225
+ description: sha1 hash (hex)
226
+ required: false
227
+ schema:
228
+ type: string
229
+ - name: sha512
230
+ in: query
231
+ description: sha512 hash (hex)
232
+ required: false
233
+ schema:
234
+ type: string
235
+ - name: page
236
+ in: query
237
+ description: page number
238
+ required: false
239
+ schema:
240
+ type: integer
241
+ - name: per_page
242
+ in: query
243
+ description: Number of records to return
244
+ required: false
245
+ schema:
246
+ type: integer
247
+ responses:
248
+ '200':
249
+ description: successful operation
250
+ content:
251
+ application/json:
252
+ schema:
253
+ type: array
254
+ items:
255
+ "$ref": "#/components/schemas/VersionLookup"
256
+ '400':
257
+ description: missing integrity parameter
204
258
  "/packages/lookup":
205
259
  get:
206
- summary: lookup a package by repository URL, purl or ecosystem+name
260
+ summary: lookup a single package by repository URL, purl or ecosystem+name.
261
+ For multiple packages use POST /packages/bulk_lookup.
207
262
  operationId: lookupPackage
208
263
  tags:
209
264
  - packages
@@ -216,7 +271,7 @@ paths:
216
271
  type: string
217
272
  - name: purl
218
273
  in: query
219
- description: package URL
274
+ description: single package URL. For multiple purls use POST /packages/bulk_lookup.
220
275
  required: false
221
276
  schema:
222
277
  type: string
@@ -468,7 +523,7 @@ paths:
468
523
  "$ref": "#/components/schemas/KeywordWithPackages"
469
524
  "/registries":
470
525
  get:
471
- summary: list registies
526
+ summary: list registries
472
527
  operationId: getRegistries
473
528
  tags:
474
529
  - registries
@@ -553,7 +608,7 @@ paths:
553
608
  type: string
554
609
  - name: purl
555
610
  in: query
556
- description: package URL
611
+ description: single package URL. For multiple purls use POST /packages/bulk_lookup.
557
612
  required: false
558
613
  schema:
559
614
  type: string
@@ -2098,6 +2153,15 @@ components:
2098
2153
  type: array
2099
2154
  items:
2100
2155
  "$ref": "#/components/schemas/Dependency"
2156
+ VersionLookup:
2157
+ allOf:
2158
+ - "$ref": "#/components/schemas/VersionWithDependencies"
2159
+ - type: object
2160
+ required:
2161
+ - package
2162
+ properties:
2163
+ package:
2164
+ "$ref": "#/components/schemas/PackageWithRegistry"
2101
2165
  VersionWithPackage:
2102
2166
  required:
2103
2167
  - id
@@ -335,8 +335,8 @@ paths:
335
335
  "$ref": "#/components/schemas/Repository"
336
336
  "/hosts":
337
337
  get:
338
- summary: list registies
339
- operationId: getRegistries
338
+ summary: list hosts
339
+ operationId: getHosts
340
340
  parameters:
341
341
  - name: page
342
342
  in: query
@@ -29,9 +29,12 @@ from ecosystems_cli.constants import (
29
29
 
30
30
 
31
31
  @click.group(invoke_without_command=True)
32
+ @click.version_option(__version__, "--version", prog_name="ecosystems")
32
33
  @click.option(
33
34
  "--timeout",
34
35
  default=DEFAULT_TIMEOUT,
36
+ # Same bounds as commands/decorators.py common_options.
37
+ type=click.IntRange(min=1, max=86400),
35
38
  help=f"Timeout in seconds for API requests. Default is {DEFAULT_TIMEOUT} seconds.",
36
39
  )
37
40
  @click.option(
@@ -19,8 +19,8 @@ advisories = APICommandGenerator.create_api_group("advisories")
19
19
  @click.option("--package-name", type=str, default=None, help="Package to filter by")
20
20
  @click.option("--severity", type=str, default=None, help="Severity to filter by")
21
21
  @click.option("--repository-url", type=str, default=None, help="Repository URL to filter by")
22
- @click.option("--page", type=int, default=None, help="pagination page number")
23
- @click.option("--per-page", type=int, default=None, help="Number of records to return")
22
+ @click.option("--page", type=click.IntRange(min=1), default=None, help="pagination page number")
23
+ @click.option("--per-page", type=click.IntRange(min=1), default=None, help="Number of records to return")
24
24
  @click.option("--created-after", type=str, default=None, help="filter by created_at after given time")
25
25
  @click.option("--updated-after", type=str, default=None, help="filter by updated_at after given time")
26
26
  @click.option("--sort", type=str, default=None, help="field to order results by")
@@ -90,3 +90,35 @@ def get_advisories(
90
90
  )
91
91
 
92
92
  execute_api_call(ctx, "advisories", operation_id="getAdvisories", call_args=(), call_kwargs=kwargs)
93
+
94
+
95
+ @override_auto_command(
96
+ advisories,
97
+ "lookup_advisories",
98
+ help="lookup advisories by Package URL (PURL) or repository URL (one of the two is required)",
99
+ )
100
+ @click.option("--purl", type=str, default=None, help="Package URL (PURL). Example: pkg:npm/lodash@4.17.20")
101
+ @click.option("--repository-url", type=str, default=None, help="Source repository URL. Example: https://github.com/rails/rails")
102
+ @common_options
103
+ @click.pass_context
104
+ def lookup_advisories(
105
+ ctx,
106
+ timeout: int,
107
+ format: str,
108
+ domain: Optional[str],
109
+ mailto: Optional[str],
110
+ purl: Optional[str],
111
+ repository_url: Optional[str],
112
+ ):
113
+ """Lookup advisories by PURL or repository URL.
114
+
115
+ The API requires one of purl/repository_url; validate locally so the
116
+ mistake is a usage error instead of a doomed network round-trip.
117
+ """
118
+ update_context(ctx, timeout, format, domain, mailto)
119
+
120
+ if not purl and not repository_url:
121
+ raise click.UsageError("One of --purl or --repository-url is required.")
122
+
123
+ kwargs = build_kwargs(purl=purl, repository_url=repository_url)
124
+ execute_api_call(ctx, "advisories", operation_id="lookupAdvisories", call_args=(), call_kwargs=kwargs)
@@ -22,6 +22,10 @@ def common_options(f):
22
22
  f = click.option(
23
23
  "--timeout",
24
24
  default=DEFAULT_TIMEOUT,
25
+ # Bounded so nonsensical values fail as usage errors instead of
26
+ # surfacing internals from the HTTP stack (0/negative) or crashing
27
+ # on timestamp conversion (astronomically large).
28
+ type=click.IntRange(min=1, max=86400),
25
29
  help=f"Timeout in seconds for API requests. Default is {DEFAULT_TIMEOUT} seconds.",
26
30
  )(f)
27
31
  f = click.option(
@@ -18,13 +18,13 @@ diff = APICommandGenerator.create_api_group("diff")
18
18
  @click.argument("url_2", required=True)
19
19
  @click.option(
20
20
  "--polling-interval",
21
- type=float,
21
+ type=click.FloatRange(min=0.1),
22
22
  default=None,
23
23
  help="Polling interval in seconds. If set, the command will poll the job status until completion.",
24
24
  )
25
25
  @click.option(
26
26
  "--max-wait",
27
- type=float,
27
+ type=click.FloatRange(min=0, min_open=True),
28
28
  default=DEFAULT_MAX_POLL_WAIT,
29
29
  help=f"Maximum seconds to poll before giving up. Default is {DEFAULT_MAX_POLL_WAIT}.",
30
30
  )
@@ -1,5 +1,6 @@
1
1
  """API execution helpers for ecosystems CLI commands."""
2
2
 
3
+ import sys
3
4
  from typing import Optional
4
5
 
5
6
  from rich.console import Console
@@ -9,20 +10,43 @@ from ecosystems_cli.constants import DEFAULT_OUTPUT_FORMAT, DEFAULT_TIMEOUT
9
10
  from ecosystems_cli.exceptions import EcosystemsCLIError
10
11
  from ecosystems_cli.helpers.get_domain import build_base_url, get_domain_with_precedence
11
12
  from ecosystems_cli.helpers.print_error import print_error
12
- from ecosystems_cli.helpers.print_output import print_output
13
+ from ecosystems_cli.helpers.print_output import exit_on_broken_pipe, print_output
13
14
  from ecosystems_cli.openapi_client import _factory as api_factory
14
15
 
15
16
  console = Console()
17
+ # Diagnostics go to stderr so stdout stays machine-parseable: piping
18
+ # `--format json` output must never receive an error panel as data.
19
+ err_console = Console(stderr=True)
20
+
21
+
22
+ def _explicitly_set(ctx, param_name: str, value, default) -> bool:
23
+ """Whether an option was actually provided at this command level.
24
+
25
+ Click's parameter-source tracking distinguishes an explicit value from the
26
+ option's default even when they are equal -- comparing against the default
27
+ cannot: a leaf-level ``--format table`` (the default value) would look
28
+ unset and lose to an outer ``--format json``. Falls back to the
29
+ value-differs-from-default heuristic for contexts without source tracking
30
+ (e.g. plain mocks in tests).
31
+ """
32
+ get_source = getattr(ctx, "get_parameter_source", None)
33
+ if get_source is not None:
34
+ source = get_source(param_name)
35
+ if source is not None:
36
+ from click.core import ParameterSource
37
+
38
+ return source != ParameterSource.DEFAULT
39
+ return value != default
16
40
 
17
41
 
18
42
  def update_context(ctx, timeout: int, format: str, domain: Optional[str], mailto: Optional[str] = None):
19
43
  """Merge command-level options into ``ctx.obj``.
20
44
 
21
45
  The single context-precedence mechanism, used by both the API group callback
22
- and every leaf command. An option is written only when it differs from its
23
- default (i.e. was explicitly set at this level); otherwise the value already
24
- in ``ctx.obj`` -- inherited from the parent context -- is left untouched.
25
- The net precedence is therefore: leaf option > group option > root option >
46
+ and every leaf command. An option is written only when it was explicitly set
47
+ at this level (per Click's parameter source); otherwise the value already in
48
+ ``ctx.obj`` -- inherited from the parent context -- is left untouched. The
49
+ net precedence is therefore: leaf option > group option > root option >
26
50
  default.
27
51
 
28
52
  Args:
@@ -33,9 +57,9 @@ def update_context(ctx, timeout: int, format: str, domain: Optional[str], mailto
33
57
  mailto: Email address for polite pool access
34
58
  """
35
59
  ctx.ensure_object(dict)
36
- if timeout != DEFAULT_TIMEOUT:
60
+ if _explicitly_set(ctx, "timeout", timeout, DEFAULT_TIMEOUT):
37
61
  ctx.obj["timeout"] = timeout
38
- if format != DEFAULT_OUTPUT_FORMAT:
62
+ if _explicitly_set(ctx, "format", format, DEFAULT_OUTPUT_FORMAT):
39
63
  ctx.obj["format"] = format
40
64
  if domain is not None:
41
65
  ctx.obj["domain"] = domain
@@ -109,6 +133,11 @@ def execute_api_call(
109
133
 
110
134
  print_output(result, ctx.obj.get("format", DEFAULT_OUTPUT_FORMAT), console=console)
111
135
  except EcosystemsCLIError as e:
112
- print_error(str(e), console=console)
136
+ print_error(str(e), console=err_console)
137
+ sys.exit(1)
138
+ except BrokenPipeError:
139
+ # The consumer closed the pipe (e.g. `... | head`): not an error.
140
+ exit_on_broken_pipe()
113
141
  except Exception as e:
114
- print_error(f"Unexpected error: {str(e)}", console=console)
142
+ print_error(f"Unexpected error: {str(e)}", console=err_console)
143
+ sys.exit(1)
@@ -9,6 +9,25 @@ from ecosystems_cli.commands.decorators import common_options
9
9
  from ecosystems_cli.helpers.click_params import build_body_decorators, build_click_decorators
10
10
  from ecosystems_cli.helpers.load_api_spec import load_api_spec
11
11
 
12
+ # Help-text overrides for auto-generated commands, keyed by
13
+ # (api_name, operation_id). The OpenAPI specs are vendored verbatim from
14
+ # upstream (and checksummed), so spec typos and missing summaries are
15
+ # corrected here instead of editing the spec files.
16
+ HELP_OVERRIDES = {
17
+ ("advisories", "getAdvisory"): "get an advisory by uuid",
18
+ ("dependabot", "getRegistries"): "list registries",
19
+ ("packages", "getRegistries"): "list registries",
20
+ # The opencollective spec has no summary fields at all, so these commands
21
+ # would otherwise fall back to "Execute <operationId>" placeholders.
22
+ ("opencollective", "getCollectives"): "list open collective collectives",
23
+ ("opencollective", "getCollective"): "get a collective by id",
24
+ ("opencollective", "getCollectiveProjects"): "list projects of a collective",
25
+ ("opencollective", "getProjects"): "list open source projects with collectives",
26
+ ("opencollective", "getProject"): "get a project by id",
27
+ ("opencollective", "getProjectPackages"): "list packages of a project",
28
+ ("opencollective", "lookupProject"): "lookup a project by repository or package URL",
29
+ }
30
+
12
31
 
13
32
  class APICommandGenerator:
14
33
  """Generate CLI commands from OpenAPI specifications."""
@@ -61,7 +80,9 @@ class APICommandGenerator:
61
80
  continue
62
81
 
63
82
  command_name = APICommandGenerator.operation_id_to_command_name(operation_id)
64
- description = operation.get("summary", f"Execute {operation_id}")
83
+ description = HELP_OVERRIDES.get((api_name, operation_id)) or operation.get(
84
+ "summary", f"Execute {operation_id}"
85
+ )
65
86
  parameters = operation.get("parameters", [])
66
87
  request_body = operation.get("requestBody")
67
88
 
@@ -109,7 +130,13 @@ class APICommandGenerator:
109
130
  update_context(ctx, timeout, format, domain, mailto)
110
131
  execute_api_call(ctx, api_name, operation_id=op_id, call_args=args, call_kwargs=kwargs, body_keys=body_keys)
111
132
 
112
- for decorator in reversed(click_decorators):
133
+ # command_impl is already a click.Command here, so each decorator
134
+ # APPENDS its parameter to command.params in application order.
135
+ # Iterating forward therefore preserves the OpenAPI spec order —
136
+ # positional arguments must match the URL path order
137
+ # (/hosts/{host}/... => HOSTNAME first). reversed() here produced
138
+ # REPOSITORYNAME HOSTNAME usage, inverted from the API path.
139
+ for decorator in click_decorators:
113
140
  command_impl = decorator(command_impl)
114
141
 
115
142
  return command_impl
@@ -17,13 +17,13 @@ licenses = APICommandGenerator.create_api_group("licenses")
17
17
  @click.argument("url", required=True)
18
18
  @click.option(
19
19
  "--polling-interval",
20
- type=float,
20
+ type=click.FloatRange(min=0.1),
21
21
  default=None,
22
22
  help="Polling interval in seconds. If set, the command will poll the job status until completion.",
23
23
  )
24
24
  @click.option(
25
25
  "--max-wait",
26
- type=float,
26
+ type=click.FloatRange(min=0, min_open=True),
27
27
  default=DEFAULT_MAX_POLL_WAIT,
28
28
  help=f"Maximum seconds to poll before giving up. Default is {DEFAULT_MAX_POLL_WAIT}.",
29
29
  )
@@ -8,13 +8,13 @@ console = Console()
8
8
 
9
9
 
10
10
  @click.command()
11
- @click.option("--host", default="localhost", help="Host to bind the MCP server to.")
12
- @click.option("--port", default=None, type=int, help="Port to bind the MCP server to (for HTTP transport).")
11
+ @click.option("--host", default="localhost", help="Host to bind the MCP server to. Default is localhost.")
12
+ @click.option("--port", default=None, type=int, help="Port to bind the MCP server to (for HTTP transport). Default is unset.")
13
13
  @click.option(
14
14
  "--transport",
15
15
  type=click.Choice(["stdio", "http"]),
16
16
  default="stdio",
17
- help="Transport protocol to use (stdio for standard I/O, http for HTTP server).",
17
+ help="Transport protocol to use (stdio for standard I/O, http for HTTP server). Default is stdio.",
18
18
  )
19
19
  def mcp(host, port, transport):
20
20
  """Start an MCP (Model Context Protocol) server providing Ecosystems CLI functionality.
@@ -17,13 +17,13 @@ parser = APICommandGenerator.create_api_group("parser")
17
17
  @click.argument("url", required=True)
18
18
  @click.option(
19
19
  "--polling-interval",
20
- type=float,
20
+ type=click.FloatRange(min=0.1),
21
21
  default=None,
22
22
  help="Polling interval in seconds. If set, the command will poll the job status until completion.",
23
23
  )
24
24
  @click.option(
25
25
  "--max-wait",
26
- type=float,
26
+ type=click.FloatRange(min=0, min_open=True),
27
27
  default=DEFAULT_MAX_POLL_WAIT,
28
28
  help=f"Maximum seconds to poll before giving up. Default is {DEFAULT_MAX_POLL_WAIT}.",
29
29
  )
@@ -10,6 +10,7 @@ from ecosystems_cli.commands.generator import APICommandGenerator
10
10
  from ecosystems_cli.constants import DEFAULT_MAX_POLL_WAIT
11
11
  from ecosystems_cli.helpers.build_kwargs import build_kwargs
12
12
  from ecosystems_cli.helpers.job_polling import submit_and_poll
13
+ from ecosystems_cli.helpers.purl_parser import purl_type_to_registry
13
14
 
14
15
  resolve = APICommandGenerator.create_api_group("resolve")
15
16
 
@@ -17,18 +18,22 @@ resolve = APICommandGenerator.create_api_group("resolve")
17
18
  @override_auto_command(resolve, "create_job", help="Submit a resolve job")
18
19
  @click.argument("package_name", required=True)
19
20
  @click.argument("registry", required=False)
20
- @click.option("--ecosystem", default=None, help="Ecosystem/purl type (e.g. gem, npm, cargo). Alternative to REGISTRY.")
21
+ @click.option(
22
+ "--ecosystem",
23
+ default=None,
24
+ help="Ecosystem/purl type (e.g. gem, npm, cargo), mapped to its canonical registry. Alternative to REGISTRY.",
25
+ )
21
26
  @click.option("--version", default=None, help="Resolve only with version within this range")
22
27
  @click.option("--tree", is_flag=True, default=False, help="Return the full dependency tree with PURLs instead of a flat map")
23
28
  @click.option(
24
29
  "--polling-interval",
25
- type=float,
30
+ type=click.FloatRange(min=0.1),
26
31
  default=None,
27
32
  help="Polling interval in seconds. If set, the command will poll the job status until completion.",
28
33
  )
29
34
  @click.option(
30
35
  "--max-wait",
31
- type=float,
36
+ type=click.FloatRange(min=0, min_open=True),
32
37
  default=DEFAULT_MAX_POLL_WAIT,
33
38
  help=f"Maximum seconds to poll before giving up. Default is {DEFAULT_MAX_POLL_WAIT}.",
34
39
  )
@@ -66,15 +71,20 @@ def create_job(
66
71
  """
67
72
  update_context(ctx, timeout, format, domain, mailto)
68
73
 
69
- # The API accepts either a registry or an ecosystem/purl type; require one.
74
+ # One of registry / ecosystem is required. The server silently ignores an
75
+ # `ecosystem` query parameter (the job completes instantly with empty
76
+ # results), so an ecosystem is mapped to its canonical registry
77
+ # client-side and always submitted as `registry`. An explicit REGISTRY
78
+ # argument wins over --ecosystem.
70
79
  if not registry and not ecosystem:
71
80
  raise click.UsageError("Either REGISTRY argument or --ecosystem is required.")
81
+ if not registry:
82
+ registry = purl_type_to_registry(ecosystem)
72
83
 
73
84
  payload = {
74
85
  "package_name": package_name,
86
+ "registry": registry,
75
87
  **build_kwargs(
76
- registry=registry,
77
- ecosystem=ecosystem,
78
88
  version=version,
79
89
  tree="true" if tree else None,
80
90
  ),
@@ -17,13 +17,13 @@ sbom = APICommandGenerator.create_api_group("sbom")
17
17
  @click.argument("url", required=True)
18
18
  @click.option(
19
19
  "--polling-interval",
20
- type=float,
20
+ type=click.FloatRange(min=0.1),
21
21
  default=None,
22
22
  help="Polling interval in seconds. If set, the command will poll the job status until completion.",
23
23
  )
24
24
  @click.option(
25
25
  "--max-wait",
26
- type=float,
26
+ type=click.FloatRange(min=0, min_open=True),
27
27
  default=DEFAULT_MAX_POLL_WAIT,
28
28
  help=f"Maximum seconds to poll before giving up. Default is {DEFAULT_MAX_POLL_WAIT}.",
29
29
  )
@@ -23,6 +23,7 @@ JSON_SYNTAX = "json"
23
23
  MAX_SELECTED_FIELDS = 2
24
24
  DEFAULT_TABLE_TITLE = "API Response"
25
25
  TABLE_HEADER_STYLE = "bold cyan"
26
+ EMPTY_RESULTS_MESSAGE = "No results"
26
27
 
27
28
  # Rich Console Styles
28
29
  STYLE_BOLD_CYAN = "bold cyan"
@@ -22,7 +22,16 @@ class APIConnectionError(APIError):
22
22
  class APITimeoutError(APIError):
23
23
  """Raised when an API request times out."""
24
24
 
25
- pass
25
+ def __init__(self, timeout=None):
26
+ self.timeout = timeout
27
+ # str(exception) is shown to the user verbatim; a bare timeout value
28
+ # would render as the meaningless "Error: 20".
29
+ if timeout is not None:
30
+ unit = "second" if timeout == 1 else "seconds"
31
+ message = f"Request timed out after {timeout} {unit}"
32
+ else:
33
+ message = "Request timed out"
34
+ super().__init__(message)
26
35
 
27
36
 
28
37
  class APIHTTPError(APIError):