@indiekitai/pg-dash 0.4.2 → 0.4.4

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
@@ -4,6 +4,8 @@
4
4
 
5
5
  **The AI-native PostgreSQL health checker.** One command to audit your database, 23 MCP tools for AI-assisted optimization, CI integration for automated checks.
6
6
 
7
+ 📖 **[Read the full writeup on Dev.to](https://dev.to/fan_yang_670d82db29664c9e/i-built-a-free-postgresql-health-checker-with-23-mcp-tools-and-ci-integration-2abc)**
8
+
7
9
  Not another monitoring dashboard — pg-dash is built to fit into your **AI coding workflow**:
8
10
 
9
11
  ```
@@ -165,6 +167,13 @@ pg-dash --host localhost --user postgres --db mydb --port 3480
165
167
 
166
168
  Opens your browser at `http://localhost:3480` with the full dashboard.
167
169
 
170
+ ## Documentation
171
+
172
+ - [Real-world example](docs/real-world-example.md) — pg-dash running against a production database
173
+ - [Migration safety guide](docs/migration-safety.md) — catching lock risks before they hit production
174
+ - [MCP setup guide](docs/mcp-setup.md) — connecting to Claude Desktop and Cursor
175
+ - [CI integration guide](docs/ci-integration.md) — automated checks in GitHub Actions
176
+
168
177
  ## CLI Options
169
178
 
170
179
  ```
package/README.zh-CN.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  **AI 原生的 PostgreSQL 健康检查工具。** 一条命令审计数据库,23 个 MCP 工具让 AI 帮你优化,CI 集成自动检查。
6
6
 
7
+ 📖 **[在 Dev.to 阅读完整介绍](https://dev.to/fan_yang_670d82db29664c9e/i-built-a-free-postgresql-health-checker-with-23-mcp-tools-and-ci-integration-2abc)**
8
+
7
9
  不是又一个监控面板 —— pg-dash 是为 **AI 编程工作流** 设计的:
8
10
 
9
11
  ```
package/dist/cli.js CHANGED
@@ -4078,6 +4078,7 @@ pg-dash \u2014 Lightweight PostgreSQL Monitoring Dashboard
4078
4078
  Usage:
4079
4079
  pg-dash <connection-string> Start dashboard
4080
4080
  pg-dash check <connection-string> Run health check and exit
4081
+ pg-dash health <connection-string> Alias for check
4081
4082
  pg-dash check-migration <file> [connection] Analyze migration SQL for risks
4082
4083
  pg-dash diff-env --source <url> --target <url> Compare two environments
4083
4084
  pg-dash schema-diff <connection-string> Show latest schema changes
@@ -4120,7 +4121,12 @@ Environment variables:
4120
4121
  `);
4121
4122
  process.exit(0);
4122
4123
  }
4124
+ var KNOWN_SUBCOMMANDS = ["check", "health", "check-migration", "schema-diff", "diff-env"];
4123
4125
  var subcommand = positionals[0];
4126
+ function isValidConnectionString(s) {
4127
+ return s.startsWith("postgresql://") || s.startsWith("postgres://") || s.includes("@") || // user@host shorthand
4128
+ s.includes("=");
4129
+ }
4124
4130
  function resolveConnectionString(startIdx = 0) {
4125
4131
  let connStr = positionals[startIdx];
4126
4132
  if (!connStr) {
@@ -4136,9 +4142,19 @@ function resolveConnectionString(startIdx = 0) {
4136
4142
  process.exit(1);
4137
4143
  }
4138
4144
  }
4145
+ if (!isValidConnectionString(connStr)) {
4146
+ console.error(
4147
+ `Error: "${connStr}" doesn't look like a valid connection string.
4148
+ Expected: postgresql://user:pass@host:5432/db
4149
+
4150
+ Known subcommands: ${KNOWN_SUBCOMMANDS.join(", ")}
4151
+ Run pg-dash --help for usage.`
4152
+ );
4153
+ process.exit(1);
4154
+ }
4139
4155
  return connStr;
4140
4156
  }
4141
- if (subcommand === "check") {
4157
+ if (subcommand === "check" || subcommand === "health") {
4142
4158
  const connectionString = resolveConnectionString(1);
4143
4159
  const threshold = parseInt(values.threshold || "70", 10);
4144
4160
  const format = values.format || "text";
@@ -4463,6 +4479,15 @@ Migration check: ${filePath}`);
4463
4479
  process.exit(1);
4464
4480
  }
4465
4481
  } else {
4482
+ if (subcommand && !isValidConnectionString(subcommand) && KNOWN_SUBCOMMANDS.indexOf(subcommand) === -1) {
4483
+ console.error(
4484
+ `Error: Unknown subcommand "${subcommand}".
4485
+
4486
+ Known subcommands: ${KNOWN_SUBCOMMANDS.join(", ")}
4487
+ Run pg-dash --help for usage.`
4488
+ );
4489
+ process.exit(1);
4490
+ }
4466
4491
  const connectionString = resolveConnectionString(0);
4467
4492
  const port = parseInt(values.port, 10);
4468
4493
  const bind = values.bind || process.env.PG_DASH_BIND || "127.0.0.1";