postgresai 0.11.0-alpha.1 → 0.11.0-alpha.3

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.
package/README.md CHANGED
@@ -1,31 +1,76 @@
1
- ## CLI developer quickstart
1
+ # PostgresAI CLI
2
+
3
+ Command-line interface for PostgresAI monitoring and database management.
4
+
5
+ ## Installation
2
6
 
3
- ### run without install
4
7
  ```bash
5
- npm --prefix cli install --no-audit --no-fund
6
- node ./cli/bin/postgres-ai.js --help
8
+ npm install -g postgresai@alpha
7
9
  ```
8
10
 
9
- ### use aliases locally (no ./)
11
+ ## Usage
12
+
13
+ The CLI provides two command aliases:
10
14
  ```bash
11
- # install from repo into global prefix
12
- npm install -g ./cli
15
+ postgres-ai --help
16
+ pgai --help # short alias
17
+ ```
13
18
 
14
- # ensure global npm bin is in PATH (zsh)
15
- echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrc
16
- exec zsh -l
19
+ ## Quick start
17
20
 
18
- # aliases
19
- postgres-ai --help
20
- pgai --help
21
+ Start monitoring with demo database:
22
+ ```bash
23
+ postgres-ai quickstart --demo
24
+ ```
25
+
26
+ This will:
27
+ - Generate secure Grafana password
28
+ - Start all monitoring services
29
+ - Open Grafana at http://localhost:3000
30
+
31
+ ## Commands
32
+
33
+ ### Monitoring services
34
+ ```bash
35
+ postgres-ai start # Start all services
36
+ postgres-ai stop # Stop all services
37
+ postgres-ai restart # Restart all services
38
+ postgres-ai status # Show service status
39
+ postgres-ai logs [service] # Show logs
40
+ ```
41
+
42
+ ### Instance management
43
+ ```bash
44
+ postgres-ai list-instances # List configured instances
45
+ postgres-ai add-instance <conn-string> <name> # Add new instance
46
+ postgres-ai remove-instance <name> # Remove instance
47
+ postgres-ai update-config # Regenerate config files
21
48
  ```
22
49
 
23
- ### one‑off run (no install)
50
+ ### Configuration
24
51
  ```bash
25
- npx -y -p file:cli postgres-ai --help
52
+ postgres-ai config # Show current configuration
53
+ postgres-ai check # Verify prerequisites
26
54
  ```
27
55
 
28
- ### env vars for integration tests
29
- - `PGAI_API_KEY`
30
- - `PGAI_BASE_URL` (default `https://v2.postgres.ai/api/general/`)
56
+ ### API key management
57
+ ```bash
58
+ postgres-ai add-key <key> # Store API key
59
+ postgres-ai show-key # Show stored key (masked)
60
+ postgres-ai remove-key # Remove stored key
61
+ ```
62
+
63
+ ## Environment variables
64
+
65
+ - `PGAI_API_KEY` - API key for PostgresAI services
66
+ - `PGAI_BASE_URL` - API endpoint (default: `https://postgres.ai/api/general/`)
67
+
68
+ ## Requirements
69
+
70
+ - Node.js 18 or higher
71
+ - Docker and Docker Compose
72
+
73
+ ## Learn more
31
74
 
75
+ - Documentation: https://postgres.ai/docs
76
+ - Issues: https://gitlab.com/postgres-ai/postgres_ai/-/issues
@@ -7,7 +7,7 @@ const pkg = require("../package.json");
7
7
  function getConfig(opts) {
8
8
  const apiKey = opts.apiKey || process.env.PGAI_API_KEY || "";
9
9
  const baseUrl =
10
- opts.baseUrl || process.env.PGAI_BASE_URL || "https://v2.postgres.ai/api/general/";
10
+ opts.baseUrl || process.env.PGAI_BASE_URL || "https://postgres.ai/api/general/";
11
11
  return { apiKey, baseUrl };
12
12
  }
13
13
 
@@ -21,7 +21,7 @@ program
21
21
  .option(
22
22
  "--base-url <url>",
23
23
  "API base URL (overrides PGAI_BASE_URL)",
24
- "https://v2.postgres.ai/api/general/"
24
+ "https://postgres.ai/api/general/"
25
25
  );
26
26
 
27
27
  const stub = (name) => async () => {
@@ -199,6 +199,12 @@ program
199
199
  const list = filtered.length > 0 ? filtered : [];
200
200
  if (list.length === 0) {
201
201
  console.log("No instances configured");
202
+ console.log("");
203
+ console.log("To add an instance:");
204
+ console.log(" postgres-ai add-instance <connection-string> <name>");
205
+ console.log("");
206
+ console.log("Example:");
207
+ console.log(" postgres-ai add-instance 'postgresql://user:pass@host:5432/db' my-db");
202
208
  return;
203
209
  }
204
210
  for (const n of list) console.log(`Instance: ${n}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postgresai",
3
- "version": "0.11.0-alpha.1",
3
+ "version": "0.11.0-alpha.3",
4
4
  "description": "PostgresAI CLI (Node.js)",
5
5
  "license": "MIT",
6
6
  "private": false,