openapi-cli4ai 0.2.0__tar.gz → 0.4.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.
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.github/workflows/ci.yml +2 -2
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.github/workflows/codeql.yml +2 -2
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.github/workflows/publish.yml +2 -2
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/CHANGELOG.md +10 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/PKG-INFO +37 -7
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/README.md +36 -6
- openapi_cli4ai-0.4.0/demo.gif +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/pyproject.toml +1 -1
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/src/openapi_cli4ai/cli.py +764 -20
- openapi_cli4ai-0.4.0/tests/test_auth_flows.py +1271 -0
- openapi_cli4ai-0.4.0/tests/test_commands.py +1414 -0
- openapi_cli4ai-0.4.0/tests/test_coverage_gaps.py +1125 -0
- openapi_cli4ai-0.4.0/tests/test_device_flow.py +635 -0
- openapi_cli4ai-0.4.0/tests/test_oidc.py +130 -0
- openapi_cli4ai-0.2.0/demo.gif +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.github/CODEOWNERS +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.github/dependabot.yml +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.github/release.yml +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/.gitignore +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/CONTRIBUTING.md +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/LICENSE +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/SECURITY.md +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/examples/profiles.toml.example +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/openapi-cli4ai +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/src/openapi_cli4ai/__init__.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/src/openapi_cli4ai/__main__.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/__init__.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/conftest.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/fixtures/petstore_spec.json +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/test_auth.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/test_caching.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/test_integration.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/test_profile_management.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/test_run_command.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/test_spec_parsing.py +0 -0
- {openapi_cli4ai-0.2.0 → openapi_cli4ai-0.4.0}/tests/test_sse_streaming.py +0 -0
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
python-version: ["3.11", "3.12", "3.13"]
|
|
18
18
|
steps:
|
|
19
19
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
20
|
-
- uses: astral-sh/setup-uv@
|
|
20
|
+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
21
21
|
with:
|
|
22
22
|
enable-cache: true
|
|
23
23
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -29,7 +29,7 @@ jobs:
|
|
|
29
29
|
runs-on: ubuntu-latest
|
|
30
30
|
steps:
|
|
31
31
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
32
|
-
- uses: astral-sh/setup-uv@
|
|
32
|
+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
33
33
|
- name: Ruff check
|
|
34
34
|
run: uvx ruff check .
|
|
35
35
|
- name: Ruff format check
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
runs-on: ubuntu-latest
|
|
18
18
|
steps:
|
|
19
19
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
20
|
-
- uses: github/codeql-action/init@
|
|
20
|
+
- uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
|
|
21
21
|
with:
|
|
22
22
|
languages: python
|
|
23
|
-
- uses: github/codeql-action/analyze@
|
|
23
|
+
- uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
|
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
contents: read
|
|
15
15
|
steps:
|
|
16
16
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
17
|
-
- uses: astral-sh/setup-uv@
|
|
17
|
+
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
18
18
|
- name: Build sdist and wheel
|
|
19
19
|
run: uv build
|
|
20
20
|
- name: Upload artifacts
|
|
@@ -42,7 +42,7 @@ jobs:
|
|
|
42
42
|
name: dist
|
|
43
43
|
path: dist/
|
|
44
44
|
- name: Generate attestations
|
|
45
|
-
uses: actions/attest-build-provenance@
|
|
45
|
+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
|
46
46
|
with:
|
|
47
47
|
subject-path: dist/*
|
|
48
48
|
- name: Publish to PyPI
|
|
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
6
|
|
|
7
|
+
## [0.3.0] - 2026-03-28
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- OIDC Authorization Code + PKCE auth type (`auth.type = "oidc"`)
|
|
12
|
+
- Browser-based login with localhost callback
|
|
13
|
+
- `--no-browser` flag for headless/SSH environments
|
|
14
|
+
- CSRF protection via state parameter validation
|
|
15
|
+
- Tested with Auth0 and Keycloak
|
|
16
|
+
|
|
7
17
|
## [0.2.0] - 2026-03-26
|
|
8
18
|
|
|
9
19
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openapi-cli4ai
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Turn any REST API with an OpenAPI spec into an AI-ready CLI
|
|
5
5
|
Project-URL: Homepage, https://github.com/dbgorilla/openapi-cli4ai
|
|
6
6
|
Project-URL: Repository, https://github.com/dbgorilla/openapi-cli4ai
|
|
@@ -41,19 +41,24 @@ Let your AI coding agent (Claude Code, Cursor, Codex, Copilot) talk to any REST
|
|
|
41
41
|
|
|
42
42
|
## Install
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
# Requires uv (https://docs.astral.sh/uv/)
|
|
46
|
-
uv pip install openapi-cli4ai
|
|
44
|
+
**Requires:** [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
```bash
|
|
47
|
+
# Recommended — run directly, no install needed
|
|
49
48
|
uvx openapi-cli4ai --help
|
|
49
|
+
|
|
50
|
+
# Or install globally
|
|
51
|
+
uv tool install openapi-cli4ai
|
|
52
|
+
|
|
53
|
+
# Or install into a virtual environment
|
|
54
|
+
uv pip install openapi-cli4ai
|
|
50
55
|
```
|
|
51
56
|
|
|
52
57
|
## Quick Start
|
|
53
58
|
|
|
54
59
|
```bash
|
|
55
|
-
# Point it at any API with an OpenAPI spec
|
|
56
|
-
openapi-cli4ai init petstore --url https://petstore3.swagger.io/api/v3
|
|
60
|
+
# Point it at any API with an OpenAPI spec (prefix with uvx if not installed)
|
|
61
|
+
uvx openapi-cli4ai init petstore --url https://petstore3.swagger.io/api/v3
|
|
57
62
|
|
|
58
63
|
# Discover endpoints
|
|
59
64
|
openapi-cli4ai endpoints
|
|
@@ -217,6 +222,12 @@ openapi-cli4ai login --username admin --password-file /path/to/secret
|
|
|
217
222
|
# Login with password from stdin
|
|
218
223
|
echo "my-password" | openapi-cli4ai login --username admin --password-stdin
|
|
219
224
|
|
|
225
|
+
# OIDC login (opens browser for Auth0, Keycloak, etc.)
|
|
226
|
+
openapi-cli4ai login
|
|
227
|
+
|
|
228
|
+
# OIDC login without browser (headless/SSH — prints URL, you paste redirect back)
|
|
229
|
+
openapi-cli4ai login --no-browser
|
|
230
|
+
|
|
220
231
|
# Logout (clear cached tokens)
|
|
221
232
|
openapi-cli4ai logout
|
|
222
233
|
```
|
|
@@ -264,6 +275,22 @@ account_type = "USERNAME"
|
|
|
264
275
|
|
|
265
276
|
Payload placeholders: `{username}` and `{password}` come from the login prompt. `{env:VAR_NAME}` pulls from environment variables or a `.env` file (loaded automatically).
|
|
266
277
|
|
|
278
|
+
OIDC example (Auth0, Keycloak, or any OIDC provider):
|
|
279
|
+
|
|
280
|
+
```toml
|
|
281
|
+
[profiles.my-oidc-app]
|
|
282
|
+
base_url = "https://api.example.com"
|
|
283
|
+
openapi_path = "/openapi.json"
|
|
284
|
+
|
|
285
|
+
[profiles.my-oidc-app.auth]
|
|
286
|
+
type = "oidc"
|
|
287
|
+
authorize_url = "https://your-idp.com/authorize"
|
|
288
|
+
token_url = "https://your-idp.com/oauth/token"
|
|
289
|
+
client_id = "your-client-id"
|
|
290
|
+
scopes = "openid profile email"
|
|
291
|
+
callback_port = 9876
|
|
292
|
+
```
|
|
293
|
+
|
|
267
294
|
### Auth Types
|
|
268
295
|
|
|
269
296
|
| Type | Use Case | Config Fields |
|
|
@@ -271,6 +298,7 @@ Payload placeholders: `{username}` and `{password}` come from the login prompt.
|
|
|
271
298
|
| `none` | Public APIs | — |
|
|
272
299
|
| `bearer` | Token from env var | `token_env_var` |
|
|
273
300
|
| `bearer` | OAuth token endpoint | `token_endpoint`, `refresh_endpoint`, `payload` |
|
|
301
|
+
| `oidc` | OIDC Authorization Code + PKCE | `authorize_url`, `token_url`, `client_id`, `scopes` |
|
|
274
302
|
| `api-key` | API key in header | `env_var`, `header`, `prefix` |
|
|
275
303
|
| `basic` | HTTP Basic auth | `username_env_var`, `password_env_var` |
|
|
276
304
|
|
|
@@ -287,6 +315,8 @@ Payload placeholders: `{username}` and `{password}` come from the login prompt.
|
|
|
287
315
|
| [Jira Cloud](https://developer.atlassian.com/cloud/jira/platform/rest/v3/) | 581 | Basic | `init jira --url https://your-domain.atlassian.net --spec-url ... --auth basic` |
|
|
288
316
|
| [OpenRouter](https://openrouter.ai) | 36 | Bearer | `init openrouter --url https://openrouter.ai/api/v1 --spec-url ... --auth bearer` |
|
|
289
317
|
| [DBGorilla](https://dbgorilla.com) | 500+ | Token endpoint | See `examples/profiles.toml.example` |
|
|
318
|
+
| [Auth0](https://auth0.com) | — | OIDC + PKCE | `init myapp --url https://api.example.com --auth oidc` |
|
|
319
|
+
| [Keycloak](https://www.keycloak.org) | — | OIDC + PKCE | `init myapp --url https://api.example.com --auth oidc` |
|
|
290
320
|
|
|
291
321
|
Works with any AI agent that has shell access — Claude Code, Cursor, GitHub Copilot, or anything that can run `endpoints` and `call`.
|
|
292
322
|
|
|
@@ -13,19 +13,24 @@ Let your AI coding agent (Claude Code, Cursor, Codex, Copilot) talk to any REST
|
|
|
13
13
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
# Requires uv (https://docs.astral.sh/uv/)
|
|
18
|
-
uv pip install openapi-cli4ai
|
|
16
|
+
**Requires:** [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
```bash
|
|
19
|
+
# Recommended — run directly, no install needed
|
|
21
20
|
uvx openapi-cli4ai --help
|
|
21
|
+
|
|
22
|
+
# Or install globally
|
|
23
|
+
uv tool install openapi-cli4ai
|
|
24
|
+
|
|
25
|
+
# Or install into a virtual environment
|
|
26
|
+
uv pip install openapi-cli4ai
|
|
22
27
|
```
|
|
23
28
|
|
|
24
29
|
## Quick Start
|
|
25
30
|
|
|
26
31
|
```bash
|
|
27
|
-
# Point it at any API with an OpenAPI spec
|
|
28
|
-
openapi-cli4ai init petstore --url https://petstore3.swagger.io/api/v3
|
|
32
|
+
# Point it at any API with an OpenAPI spec (prefix with uvx if not installed)
|
|
33
|
+
uvx openapi-cli4ai init petstore --url https://petstore3.swagger.io/api/v3
|
|
29
34
|
|
|
30
35
|
# Discover endpoints
|
|
31
36
|
openapi-cli4ai endpoints
|
|
@@ -189,6 +194,12 @@ openapi-cli4ai login --username admin --password-file /path/to/secret
|
|
|
189
194
|
# Login with password from stdin
|
|
190
195
|
echo "my-password" | openapi-cli4ai login --username admin --password-stdin
|
|
191
196
|
|
|
197
|
+
# OIDC login (opens browser for Auth0, Keycloak, etc.)
|
|
198
|
+
openapi-cli4ai login
|
|
199
|
+
|
|
200
|
+
# OIDC login without browser (headless/SSH — prints URL, you paste redirect back)
|
|
201
|
+
openapi-cli4ai login --no-browser
|
|
202
|
+
|
|
192
203
|
# Logout (clear cached tokens)
|
|
193
204
|
openapi-cli4ai logout
|
|
194
205
|
```
|
|
@@ -236,6 +247,22 @@ account_type = "USERNAME"
|
|
|
236
247
|
|
|
237
248
|
Payload placeholders: `{username}` and `{password}` come from the login prompt. `{env:VAR_NAME}` pulls from environment variables or a `.env` file (loaded automatically).
|
|
238
249
|
|
|
250
|
+
OIDC example (Auth0, Keycloak, or any OIDC provider):
|
|
251
|
+
|
|
252
|
+
```toml
|
|
253
|
+
[profiles.my-oidc-app]
|
|
254
|
+
base_url = "https://api.example.com"
|
|
255
|
+
openapi_path = "/openapi.json"
|
|
256
|
+
|
|
257
|
+
[profiles.my-oidc-app.auth]
|
|
258
|
+
type = "oidc"
|
|
259
|
+
authorize_url = "https://your-idp.com/authorize"
|
|
260
|
+
token_url = "https://your-idp.com/oauth/token"
|
|
261
|
+
client_id = "your-client-id"
|
|
262
|
+
scopes = "openid profile email"
|
|
263
|
+
callback_port = 9876
|
|
264
|
+
```
|
|
265
|
+
|
|
239
266
|
### Auth Types
|
|
240
267
|
|
|
241
268
|
| Type | Use Case | Config Fields |
|
|
@@ -243,6 +270,7 @@ Payload placeholders: `{username}` and `{password}` come from the login prompt.
|
|
|
243
270
|
| `none` | Public APIs | — |
|
|
244
271
|
| `bearer` | Token from env var | `token_env_var` |
|
|
245
272
|
| `bearer` | OAuth token endpoint | `token_endpoint`, `refresh_endpoint`, `payload` |
|
|
273
|
+
| `oidc` | OIDC Authorization Code + PKCE | `authorize_url`, `token_url`, `client_id`, `scopes` |
|
|
246
274
|
| `api-key` | API key in header | `env_var`, `header`, `prefix` |
|
|
247
275
|
| `basic` | HTTP Basic auth | `username_env_var`, `password_env_var` |
|
|
248
276
|
|
|
@@ -259,6 +287,8 @@ Payload placeholders: `{username}` and `{password}` come from the login prompt.
|
|
|
259
287
|
| [Jira Cloud](https://developer.atlassian.com/cloud/jira/platform/rest/v3/) | 581 | Basic | `init jira --url https://your-domain.atlassian.net --spec-url ... --auth basic` |
|
|
260
288
|
| [OpenRouter](https://openrouter.ai) | 36 | Bearer | `init openrouter --url https://openrouter.ai/api/v1 --spec-url ... --auth bearer` |
|
|
261
289
|
| [DBGorilla](https://dbgorilla.com) | 500+ | Token endpoint | See `examples/profiles.toml.example` |
|
|
290
|
+
| [Auth0](https://auth0.com) | — | OIDC + PKCE | `init myapp --url https://api.example.com --auth oidc` |
|
|
291
|
+
| [Keycloak](https://www.keycloak.org) | — | OIDC + PKCE | `init myapp --url https://api.example.com --auth oidc` |
|
|
262
292
|
|
|
263
293
|
Works with any AI agent that has shell access — Claude Code, Cursor, GitHub Copilot, or anything that can run `endpoints` and `call`.
|
|
264
294
|
|
|
Binary file
|