postgresai 0.11.0-alpha.9 → 0.12.0-alpha.13
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 +68 -15
- package/bin/postgres-ai.ts +194 -102
- package/dist/bin/postgres-ai.js +177 -102
- package/dist/bin/postgres-ai.js.map +1 -1
- package/dist/lib/auth-server.js +8 -8
- package/dist/lib/issues.d.ts +7 -0
- package/dist/lib/issues.d.ts.map +1 -0
- package/dist/lib/issues.js +105 -0
- package/dist/lib/issues.js.map +1 -0
- package/dist/lib/mcp-server.d.ts +9 -0
- package/dist/lib/mcp-server.d.ts.map +1 -0
- package/dist/lib/mcp-server.js +114 -0
- package/dist/lib/mcp-server.js.map +1 -0
- package/dist/lib/util.d.ts +27 -0
- package/dist/lib/util.d.ts.map +1 -0
- package/dist/lib/util.js +46 -0
- package/dist/lib/util.js.map +1 -0
- package/dist/package.json +3 -2
- package/lib/auth-server.ts +8 -8
- package/lib/issues.ts +83 -0
- package/lib/mcp-server.ts +98 -0
- package/lib/util.ts +60 -0
- package/package.json +3 -4
- package/tsconfig.json +2 -2
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ This will:
|
|
|
47
47
|
|
|
48
48
|
Start monitoring with demo database:
|
|
49
49
|
```bash
|
|
50
|
-
postgres-ai quickstart --demo
|
|
50
|
+
postgres-ai mon quickstart --demo
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
This will:
|
|
@@ -57,27 +57,66 @@ This will:
|
|
|
57
57
|
|
|
58
58
|
## Commands
|
|
59
59
|
|
|
60
|
-
### Monitoring services
|
|
60
|
+
### Monitoring services management (`mon` group)
|
|
61
|
+
|
|
62
|
+
#### Service lifecycle
|
|
63
|
+
```bash
|
|
64
|
+
postgres-ai mon quickstart [--demo] # Complete setup (generate config, start services)
|
|
65
|
+
postgres-ai mon start # Start monitoring services
|
|
66
|
+
postgres-ai mon stop # Stop monitoring services
|
|
67
|
+
postgres-ai mon restart [service] # Restart all or specific monitoring service
|
|
68
|
+
postgres-ai mon status # Show monitoring services status
|
|
69
|
+
postgres-ai mon health [--wait <sec>] # Check monitoring services health
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### Monitoring target databases (`mon targets` subgroup)
|
|
73
|
+
```bash
|
|
74
|
+
postgres-ai mon targets list # List databases to monitor
|
|
75
|
+
postgres-ai mon targets add <conn-string> <name> # Add database to monitor
|
|
76
|
+
postgres-ai mon targets remove <name> # Remove monitoring target
|
|
77
|
+
postgres-ai mon targets test <name> # Test target connectivity
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Configuration and maintenance
|
|
61
81
|
```bash
|
|
62
|
-
postgres-ai
|
|
63
|
-
postgres-ai
|
|
64
|
-
postgres-ai
|
|
65
|
-
postgres-ai
|
|
66
|
-
postgres-ai
|
|
82
|
+
postgres-ai mon config # Show monitoring configuration
|
|
83
|
+
postgres-ai mon update-config # Apply configuration changes
|
|
84
|
+
postgres-ai mon update # Update monitoring stack
|
|
85
|
+
postgres-ai mon reset [service] # Reset service data
|
|
86
|
+
postgres-ai mon clean # Cleanup artifacts
|
|
87
|
+
postgres-ai mon check # System readiness check
|
|
88
|
+
postgres-ai mon shell <service> # Open shell to monitoring service
|
|
67
89
|
```
|
|
68
90
|
|
|
69
|
-
###
|
|
91
|
+
### MCP server (`mcp` group)
|
|
92
|
+
|
|
70
93
|
```bash
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
pgai mcp start # Start MCP stdio server exposing list_issues tool
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Cursor configuration example (Settings → MCP):
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"mcpServers": {
|
|
102
|
+
"PostgresAI": {
|
|
103
|
+
"command": "pgai",
|
|
104
|
+
"args": ["mcp", "start"],
|
|
105
|
+
"env": {
|
|
106
|
+
"PGAI_API_BASE_URL": "https://postgres.ai/api/general/"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
75
111
|
```
|
|
76
112
|
|
|
77
|
-
|
|
113
|
+
Tools exposed:
|
|
114
|
+
- list_issues: returns the same JSON as `pgai issues list`.
|
|
115
|
+
|
|
116
|
+
#### Grafana management
|
|
78
117
|
```bash
|
|
79
|
-
postgres-ai
|
|
80
|
-
postgres-ai
|
|
118
|
+
postgres-ai mon generate-grafana-password # Generate new Grafana password
|
|
119
|
+
postgres-ai mon show-grafana-credentials # Show Grafana credentials
|
|
81
120
|
```
|
|
82
121
|
|
|
83
122
|
### Authentication and API key management
|
|
@@ -103,6 +142,20 @@ API key resolution order:
|
|
|
103
142
|
3. User config file (`~/.config/postgresai/config.json`)
|
|
104
143
|
4. Legacy project config (`.pgwatch-config`)
|
|
105
144
|
|
|
145
|
+
Base URL resolution order:
|
|
146
|
+
- API base URL (`apiBaseUrl`):
|
|
147
|
+
1. Command line option (`--api-base-url`)
|
|
148
|
+
2. Environment variable (`PGAI_API_BASE_URL`)
|
|
149
|
+
3. User config file `baseUrl` (`~/.config/postgresai/config.json`)
|
|
150
|
+
4. Default: `https://postgres.ai/api/general/`
|
|
151
|
+
- UI base URL (`uiBaseUrl`):
|
|
152
|
+
1. Command line option (`--ui-base-url`)
|
|
153
|
+
2. Environment variable (`PGAI_UI_BASE_URL`)
|
|
154
|
+
3. Default: `https://console.postgres.ai`
|
|
155
|
+
|
|
156
|
+
Normalization:
|
|
157
|
+
- A single trailing `/` is removed to ensure consistent path joining.
|
|
158
|
+
|
|
106
159
|
### Environment variables
|
|
107
160
|
|
|
108
161
|
- `PGAI_API_KEY` - API key for PostgresAI services
|