Skip to content

Commit d578eb7

Browse files
chore(cli): release 0.2.0
1 parent 5bf8dc8 commit d578eb7

48 files changed

Lines changed: 28693 additions & 203 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Changelog
2+
3+
All notable changes to `polygres-cli` are documented in this file.
4+
5+
## 0.2.0 - 2026-07-31
6+
7+
### Added
8+
9+
- Added the complete `polygres context` namespace for pgContext capabilities,
10+
discovery, preflight, collection lifecycle, filters, points, durable
11+
operations, aggregates, dense retrieval, text hybrid, graph composition,
12+
rank fusion, coupled Joint retrieval, grouping, and recall checks.
13+
- Added strict shared-contract validation, file and standard-input request
14+
handling, mutation idempotency, adaptive durable-operation waiting, exact
15+
JSON envelopes, and Context-specific human output.
16+
- Added `polygres api routes` and `polygres api request` with a bundled,
17+
versioned OpenAPI snapshot, strict route and method selection, declared
18+
parameters, JSON-schema body validation, schema inspection, dry runs, and
19+
JSON output.
20+
- Added FastAPI schema generation and drift validation for the bundled CLI
21+
OpenAPI snapshot.
22+
- Added server-controlled CLI notices with a public API endpoint, 10-hour local
23+
cache, ETag revalidation, version and platform targeting, safe plain-text
24+
stderr rendering, `once`/`daily`/`always` display policies, and the static
25+
`polygres notices` command.
26+
- Added `polygres vector configs set-default <config-id>` for selecting the
27+
default vector configuration without using the web console.
28+
- Added direct Runtime API graph access support for graph discovery,
29+
configuration, builds, and status checks when
30+
`CLI_DIRECT_RUNTIME_GRAPH_ENABLED` is enabled and the control plane grants
31+
access.
32+
33+
### Changed
34+
35+
- Graph status output now includes activation failure reasons and a concise
36+
summary of configuration differences.
37+
- Graph configuration export and apply flows now canonicalize table identifiers
38+
as `id_columns`, while continuing to accept legacy `id_column` input.
39+
- Authentication contracts are vendored into the package so standalone CLI
40+
exports do not depend on an external `polygres-lib` installation.
41+
42+
### Fixed
43+
44+
- Graph and vector activation verification failures now return nonzero CLI exit
45+
codes instead of appearing successful to automation.
46+
- Authentication errors no longer expose internal identity-provider details.
47+
48+
## 0.1.2 - 2026-07-14
49+
50+
### Changed
51+
52+
- CSV imports now upload directly to blob staging for improved reliability.
53+
- CSV upload limits now follow the storage allowance of the selected project
54+
tier.
55+
56+
## 0.1.1 - 2026-07-14
57+
58+
### Changed
59+
60+
- Added Python 3.10 to release validation for the standalone CLI package.
61+
62+
## 0.1.0 - 2026-07-09
63+
64+
### Added
65+
66+
- Initial standalone `polygres-cli` package.
67+
- Added browser authentication, project management, connection information,
68+
Runtime API key management, CSV imports, migrations, graph/vector/text
69+
configuration, readiness checks, JSON output, and stable exit codes.

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,46 @@ ruff check .
1818
python -m build
1919
```
2020

21+
## OpenAPI snapshot
22+
23+
The generic `polygres api` surface reads
24+
`src/polygres_cli/openapi/control-plane-v1.json`. Generate it from the
25+
monorepo's FastAPI application after changing routes or schemas:
26+
27+
```bash
28+
python packages/python-cli/tools/generate_openapi_snapshot.py
29+
python packages/python-cli/tools/generate_openapi_snapshot.py --check
30+
```
31+
32+
Run these commands from the monorepo root in an environment containing the
33+
`services/api` dependencies. The API test suite compares the committed
34+
snapshot with `create_app().openapi()`, while the CLI tests validate the
35+
bundled resource and request behavior.
36+
37+
The public `GET /v1/cli/notices` operation is part of that snapshot. Any notice
38+
response-schema or targeting change therefore requires regenerating the
39+
snapshot and running both the API and CLI notice tests. Publishing notice rows
40+
does not require regenerating the snapshot or releasing the CLI. See
41+
`services/api/CLI_NOTICES.md` in the monorepo for the operational workflow.
42+
2143
## Publishing
2244

2345
Publishing uses GitHub Actions Trusted Publishing. Validate first through
2446
TestPyPI, then publish a matching `python-cli-vX.Y.Z` tag from the public CLI
2547
repository. Do not add PyPI API tokens to GitHub secrets.
2648

49+
Before syncing a release to the public CLI repository:
50+
51+
1. Add the release notes and date to `CHANGELOG.md`.
52+
2. Update the version in `pyproject.toml` and
53+
`src/polygres_cli/cli_client.py`.
54+
3. Update version assertions in the test suite and public installation
55+
documentation.
56+
4. Run `pytest`, `ruff check .`, `python -m build`, and
57+
`python -m twine check dist/*`.
58+
5. Validate the release through TestPyPI before creating the matching
59+
production tag.
60+
2761
## Scope
2862

2963
This repository contains the public command-line client. Keep control-plane

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ For an isolated global installation:
1616
pipx install polygres-cli
1717
```
1818

19+
From the repository root, create an isolated development environment and
20+
install the CLI in editable mode:
21+
22+
```bash
23+
python3 -m venv .venv
24+
source .venv/bin/activate
25+
sfw pip install -e packages/python-cli
26+
polygres context capabilities --help
27+
```
28+
1929
The command remains `polygres`:
2030

2131
```bash
@@ -40,9 +50,91 @@ polygres migrations apply --file ./001_create_documents.sql
4050
polygres graph discover --json > graph.json
4151
polygres graph config apply --file graph.json
4252
polygres vector configs list
53+
polygres vector configs set-default <config-id>
4354
polygres text configs list
55+
polygres context capabilities
56+
polygres context collections list
57+
polygres api routes
58+
polygres notices
59+
```
60+
61+
AI Search commands use the existing login and selected-project workflow:
62+
63+
```bash
64+
polygres login
65+
polygres projects use <project-id-or-exact-name>
66+
polygres context sources discover
67+
polygres context collections create support_docs \
68+
--source new-table \
69+
--table support_docs \
70+
--dimensions 768
71+
polygres context search support_docs --embedding-file query-embedding.json
72+
polygres context joint support_docs \
73+
--embedding-file query-embedding.json \
74+
--query "current guidance" \
75+
--semantic-weight 0.6 \
76+
--lexical-weight 0.1 \
77+
--graph-weight 0.3
78+
```
79+
80+
Context is the pgContext-backed collection namespace. It does not reuse
81+
pgvector configurations. Mutations send an idempotency key and wait for their
82+
durable operation by default; use `--no-wait` to return after acceptance.
83+
Global `--json`, `--project`, `--quiet`, and `--verbose` flags must precede
84+
`context`.
85+
86+
## Generic API routes
87+
88+
The `api` namespace exposes control-plane routes from the versioned OpenAPI
89+
snapshot bundled with the CLI. It supplements the stable high-level commands;
90+
those commands and their handlers remain registered in Python.
91+
92+
List routes, inspect one operation, validate a dry run, and execute it:
93+
94+
```bash
95+
polygres api routes
96+
polygres --json api routes --method GET
97+
polygres --json api request /projects/{project_id} --method GET --schema
98+
polygres --json --project <project-id> api request /projects/{project_id} \
99+
--method GET \
100+
--dry-run
101+
polygres --json api request /projects \
102+
--method POST \
103+
--body '{"name":"Support Search"}'
44104
```
45105

106+
Use repeatable `--param NAME=VALUE` options for declared path and query
107+
parameters. Prefix an ambiguous name with `path:`, `query:`, or `header:`.
108+
Use `--body-file <path>` for a UTF-8 JSON document, or `--body-file -` to read
109+
one from standard input.
110+
111+
Only route templates and HTTP methods in the bundled snapshot can execute.
112+
Full URLs, query strings in the route argument, undeclared parameters,
113+
unsupported methods, unsafe path values, and bodies that do not satisfy the
114+
declared JSON schema are rejected before a request is sent.
115+
116+
## CLI notices
117+
118+
After a command succeeds, the CLI checks the configured Polygres API for
119+
applicable service and release notices. Notice text is written only to standard
120+
error, so standard output and `--json` remain safe for automation. The response
121+
is cached for up to 10 hours at `~/.config/polygres/notices.json`. Running
122+
`polygres --version` forces a conditional refresh, and `polygres notices`
123+
refreshes and displays all currently applicable notices regardless of their
124+
normal `once` or `daily` display policy.
125+
126+
The check uses a two-second timeout and never changes a command's exit status.
127+
Network failures, offline operation, malformed responses, and an unavailable
128+
notice service are silent. Requests go only to the fixed `/cli/notices` path at
129+
the configured Polygres API origin. The CLI sends its version, derived release
130+
channel, operating system, and architecture for targeting. It does not send
131+
command arguments or command output.
132+
133+
Remote notices are plain text. The CLI strips control and ANSI characters,
134+
limits title and message lengths, accepts only validated HTTPS links, and uses
135+
a fixed local renderer. Notices cannot define commands, handlers, formatting,
136+
or endpoints.
137+
46138
Run `polygres --help` for the full command reference. Exit codes distinguish
47139
validation (`2`), authentication (`3`), permission (`4`), not found (`5`),
48140
conflict (`6`), rate limiting (`7`), remote availability (`8`), and missing
@@ -57,3 +149,5 @@ control-plane client and does not require the SDK.
57149

58150
Users of the former combined `polygres` package should install `polygres-cli`
59151
and `polygres-sdk` separately.
152+
153+
See [CHANGELOG.md](CHANGELOG.md) for release notes.

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Reporting a vulnerability
44

5-
Report suspected vulnerabilities privately by emailing support@evokoa.com.
5+
Report suspected vulnerabilities privately by emailing support@polygres.com.
66
Include the affected CLI version, a clear description, reproduction steps, and
77
known impact. Do not open a public issue for a security vulnerability.
88

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "polygres-cli"
3-
version = "0.1.2"
3+
version = "0.2.0"
44
description = "Command-line interface for Polygres"
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -9,7 +9,7 @@ authors = [
99
{ name = "Polygres" }
1010
]
1111
maintainers = [
12-
{ name = "Polygres", email = "support@evokoa.com" }
12+
{ name = "Polygres", email = "support@polygres.com" }
1313
]
1414
keywords = ["polygres", "postgres", "postgresql", "cli"]
1515
classifiers = [
@@ -26,7 +26,7 @@ classifiers = [
2626
"Programming Language :: Python :: 3.13",
2727
"Programming Language :: Python :: 3.14"
2828
]
29-
dependencies = ["httpx>=0.28.1"]
29+
dependencies = ["httpx>=0.28.1", "pydantic>=2.7,<3"]
3030

3131
[project.scripts]
3232
polygres = "polygres_cli.cli:main"
@@ -35,6 +35,7 @@ polygres = "polygres_cli.cli:main"
3535
Homepage = "https://polygres.com"
3636
Documentation = "https://docs.evokoa.com/polygres"
3737
Repository = "https://github.com/Evokoa/polygres-cli"
38+
Changelog = "https://github.com/Evokoa/polygres-cli/blob/main/CHANGELOG.md"
3839
Issues = "https://github.com/Evokoa/polygres-cli/issues"
3940
Support = "https://polygres.com"
4041

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Generated private dependencies. Do not edit by hand."""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Generated private subset of polygres-lib. Do not edit by hand."""
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""Generated private auth subset. Do not edit by hand."""
2+
3+
from ..core.types import SecretCredential
4+
from .api_keys import ProjectApiKeyService
5+
from .errors import (
6+
AUTH_ERROR_CATALOG,
7+
AuthError,
8+
AuthErrorCode,
9+
AuthErrorDescriptor,
10+
PolygresError,
11+
)
12+
from .models import (
13+
CliClientInfo,
14+
CliLoginPollApproved,
15+
CliLoginPollRequest,
16+
CliLoginPollResponse,
17+
CliLoginStartRequest,
18+
CliLoginStartResponse,
19+
CliSessionRefreshRequest,
20+
CliSessionRefreshResponse,
21+
CliSessionRevokeRequest,
22+
)
23+
24+
__all__ = [
25+
"AUTH_ERROR_CATALOG",
26+
"AuthError",
27+
"AuthErrorCode",
28+
"AuthErrorDescriptor",
29+
"CliClientInfo",
30+
"CliLoginPollApproved",
31+
"CliLoginPollRequest",
32+
"CliLoginPollResponse",
33+
"CliLoginStartRequest",
34+
"CliLoginStartResponse",
35+
"CliSessionRefreshRequest",
36+
"CliSessionRefreshResponse",
37+
"CliSessionRevokeRequest",
38+
"PolygresError",
39+
"ProjectApiKeyService",
40+
"SecretCredential",
41+
]

0 commit comments

Comments
 (0)