postgresai 0.14.0-dev.53 → 0.14.0-dev.55

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
@@ -29,11 +29,10 @@ brew install postgresai
29
29
 
30
30
  ## Usage
31
31
 
32
- The `postgresai` package provides three command aliases (prefer `postgresai`):
32
+ The `postgresai` package provides two command aliases:
33
33
  ```bash
34
- postgres-ai --help
35
- postgresai --help
36
- pgai --help
34
+ postgresai --help # Canonical, discoverable
35
+ pgai --help # Short and convenient
37
36
  ```
38
37
 
39
38
  You can also run it without installing via `npx`:
@@ -126,17 +125,17 @@ This will:
126
125
 
127
126
  Start monitoring with demo database:
128
127
  ```bash
129
- postgres-ai mon local-install --demo
128
+ postgresai mon local-install --demo
130
129
  ```
131
130
 
132
131
  Start monitoring with your own database:
133
132
  ```bash
134
- postgres-ai mon local-install --db-url postgresql://user:pass@host:5432/db
133
+ postgresai mon local-install --db-url postgresql://user:pass@host:5432/db
135
134
  ```
136
135
 
137
136
  Complete automated setup with API key and database:
138
137
  ```bash
139
- postgres-ai mon local-install --api-key your_key --db-url postgresql://user:pass@host:5432/db -y
138
+ postgresai mon local-install --api-key your_key --db-url postgresql://user:pass@host:5432/db -y
140
139
  ```
141
140
 
142
141
  This will:
@@ -153,19 +152,19 @@ This will:
153
152
  #### Service lifecycle
154
153
  ```bash
155
154
  # Complete setup with various options
156
- postgres-ai mon local-install # Interactive setup for production
157
- postgres-ai mon local-install --demo # Demo mode with sample database
158
- postgres-ai mon local-install --api-key <key> # Setup with API key
159
- postgres-ai mon local-install --db-url <url> # Setup with database URL
160
- postgres-ai mon local-install --api-key <key> --db-url <url> # Complete automated setup
161
- postgres-ai mon local-install -y # Auto-accept all defaults
155
+ postgresai mon local-install # Interactive setup for production
156
+ postgresai mon local-install --demo # Demo mode with sample database
157
+ postgresai mon local-install --api-key <key> # Setup with API key
158
+ postgresai mon local-install --db-url <url> # Setup with database URL
159
+ postgresai mon local-install --api-key <key> --db-url <url> # Complete automated setup
160
+ postgresai mon local-install -y # Auto-accept all defaults
162
161
 
163
162
  # Service management
164
- postgres-ai mon start # Start monitoring services
165
- postgres-ai mon stop # Stop monitoring services
166
- postgres-ai mon restart [service] # Restart all or specific monitoring service
167
- postgres-ai mon status # Show monitoring services status
168
- postgres-ai mon health [--wait <sec>] # Check monitoring services health
163
+ postgresai mon start # Start monitoring services
164
+ postgresai mon stop # Stop monitoring services
165
+ postgresai mon restart [service] # Restart all or specific monitoring service
166
+ postgresai mon status # Show monitoring services status
167
+ postgresai mon health [--wait <sec>] # Check monitoring services health
169
168
  ```
170
169
 
171
170
  ##### local-install options
@@ -176,21 +175,21 @@ postgres-ai mon health [--wait <sec>] # Check monitoring services health
176
175
 
177
176
  #### Monitoring target databases (`mon targets` subgroup)
178
177
  ```bash
179
- postgres-ai mon targets list # List databases to monitor
180
- postgres-ai mon targets add <conn-string> <name> # Add database to monitor
181
- postgres-ai mon targets remove <name> # Remove monitoring target
182
- postgres-ai mon targets test <name> # Test target connectivity
178
+ postgresai mon targets list # List databases to monitor
179
+ postgresai mon targets add <conn-string> <name> # Add database to monitor
180
+ postgresai mon targets remove <name> # Remove monitoring target
181
+ postgresai mon targets test <name> # Test target connectivity
183
182
  ```
184
183
 
185
184
  #### Configuration and maintenance
186
185
  ```bash
187
- postgres-ai mon config # Show monitoring configuration
188
- postgres-ai mon update-config # Apply configuration changes
189
- postgres-ai mon update # Update monitoring stack
190
- postgres-ai mon reset [service] # Reset service data
191
- postgres-ai mon clean # Cleanup artifacts
192
- postgres-ai mon check # System readiness check
193
- postgres-ai mon shell <service> # Open shell to monitoring service
186
+ postgresai mon config # Show monitoring configuration
187
+ postgresai mon update-config # Apply configuration changes
188
+ postgresai mon update # Update monitoring stack
189
+ postgresai mon reset [service] # Reset service data
190
+ postgresai mon clean # Cleanup artifacts
191
+ postgresai mon check # System readiness check
192
+ postgresai mon shell <service> # Open shell to monitoring service
194
193
  ```
195
194
 
196
195
  ### MCP server (`mcp` group)
@@ -250,16 +249,16 @@ postgresai issues view <issueId> > issue.json
250
249
 
251
250
  #### Grafana management
252
251
  ```bash
253
- postgres-ai mon generate-grafana-password # Generate new Grafana password
254
- postgres-ai mon show-grafana-credentials # Show Grafana credentials
252
+ postgresai mon generate-grafana-password # Generate new Grafana password
253
+ postgresai mon show-grafana-credentials # Show Grafana credentials
255
254
  ```
256
255
 
257
256
  ### Authentication and API key management
258
257
  ```bash
259
- postgres-ai auth # Authenticate via browser (OAuth)
260
- postgres-ai auth --set-key <key> # Store API key directly
261
- postgres-ai show-key # Show stored key (masked)
262
- postgres-ai remove-key # Remove stored key
258
+ postgresai auth # Authenticate via browser (OAuth)
259
+ postgresai auth --set-key <key> # Store API key directly
260
+ postgresai show-key # Show stored key (masked)
261
+ postgresai remove-key # Remove stored key
263
262
  ```
264
263
 
265
264
  ## Configuration
@@ -304,17 +303,24 @@ Normalization:
304
303
 
305
304
  ### Examples
306
305
 
307
- Linux/macOS (bash/zsh):
306
+ For production (uses default URLs):
308
307
 
309
308
  ```bash
309
+ # Production auth - uses console.postgres.ai by default
310
+ postgresai auth --debug
311
+ ```
312
+
313
+ For staging/development environments:
314
+
315
+ ```bash
316
+ # Linux/macOS (bash/zsh)
310
317
  export PGAI_API_BASE_URL=https://v2.postgres.ai/api/general/
311
318
  export PGAI_UI_BASE_URL=https://console-dev.postgres.ai
312
319
  postgresai auth --debug
313
320
  ```
314
321
 
315
- Windows PowerShell:
316
-
317
322
  ```powershell
323
+ # Windows PowerShell
318
324
  $env:PGAI_API_BASE_URL = "https://v2.postgres.ai/api/general/"
319
325
  $env:PGAI_UI_BASE_URL = "https://console-dev.postgres.ai"
320
326
  postgresai auth --debug
@@ -331,6 +337,27 @@ postgresai auth --debug \
331
337
  Notes:
332
338
  - If `PGAI_UI_BASE_URL` is not set, the default is `https://console.postgres.ai`.
333
339
 
340
+ ## Development
341
+
342
+ ### Testing
343
+
344
+ The CLI uses [Bun](https://bun.sh/) as the test runner with built-in coverage reporting.
345
+
346
+ ```bash
347
+ # Run tests with coverage (default)
348
+ bun run test
349
+
350
+ # Run tests without coverage (faster iteration during development)
351
+ bun run test:fast
352
+
353
+ # Run tests with coverage and show report location
354
+ bun run test:coverage
355
+ ```
356
+
357
+ Coverage configuration is in `bunfig.toml`. Reports are generated in `coverage/` directory:
358
+ - `coverage/lcov-report/index.html` - HTML coverage report
359
+ - `coverage/lcov.info` - LCOV format for CI integration
360
+
334
361
  ## Requirements
335
362
 
336
363
  - Node.js 18 or higher