@@ -16,6 +16,16 @@ For an isolated global installation:
1616pipx 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+
1929The command remains ` polygres ` :
2030
2131``` bash
@@ -40,9 +50,91 @@ polygres migrations apply --file ./001_create_documents.sql
4050polygres graph discover --json > graph.json
4151polygres graph config apply --file graph.json
4252polygres vector configs list
53+ polygres vector configs set-default < config-id>
4354polygres 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+
46138Run ` polygres --help ` for the full command reference. Exit codes distinguish
47139validation (` 2 ` ), authentication (` 3 ` ), permission (` 4 ` ), not found (` 5 ` ),
48140conflict (` 6 ` ), rate limiting (` 7 ` ), remote availability (` 8 ` ), and missing
@@ -57,3 +149,5 @@ control-plane client and does not require the SDK.
57149
58150Users of the former combined ` polygres ` package should install ` polygres-cli `
59151and ` polygres-sdk ` separately.
152+
153+ See [ CHANGELOG.md] ( CHANGELOG.md ) for release notes.
0 commit comments