@cli4ai/postgres
Advanced tools
+51
| # @cli4ai/postgres | ||
| > Official @cli4ai package • https://cli4ai.com • Install c4ai: `npm i -g c4ai` | ||
| PostgreSQL explorer with read-only queries (blocks writes by default). | ||
| ## Setup | ||
| ```bash | ||
| npm i -g c4ai | ||
| c4ai add -g postgres | ||
| ``` | ||
| Configure a default connection using `POSTGRES_URL` (or `DATABASE_URL`): | ||
| ```bash | ||
| POSTGRES_URL="postgres://user:pass@host:5432/db" c4ai run postgres databases | ||
| ``` | ||
| Named connections are supported via env vars like `POSTGRES_PROD_URL`. Pass the name as `[conn]`: | ||
| ```bash | ||
| POSTGRES_PROD_URL="postgres://..." c4ai run postgres tables prod public | ||
| ``` | ||
| ## Commands | ||
| ```bash | ||
| c4ai run postgres databases [conn] | ||
| c4ai run postgres schemas [conn] | ||
| c4ai run postgres tables [conn] [schema] | ||
| c4ai run postgres views [conn] [schema] | ||
| c4ai run postgres columns [conn] <table> | ||
| c4ai run postgres indexes [conn] <table> | ||
| c4ai run postgres constraints [conn] <table> | ||
| c4ai run postgres fkeys [conn] <table> | ||
| c4ai run postgres sample [conn] <table> [limit] | ||
| c4ai run postgres count [conn] <table> | ||
| c4ai run postgres query [conn] <sql> | ||
| c4ai run postgres stats [conn] <table> | ||
| c4ai run postgres sizes [conn] [schema] | ||
| c4ai run postgres search [conn] <pattern> | ||
| c4ai run postgres version [conn] | ||
| ``` | ||
| ## Examples | ||
| ```bash | ||
| POSTGRES_URL="postgres://user:pass@host:5432/db" c4ai run postgres tables | ||
| POSTGRES_URL="postgres://user:pass@host:5432/db" c4ai run postgres query "select now() as now" | ||
| ``` |
+1
-1
| { | ||
| "name": "postgres", | ||
| "version": "1.0.0", | ||
| "version": "1.0.3", | ||
| "description": "PostgreSQL read-only queries", | ||
@@ -5,0 +5,0 @@ "author": "cliforai", |
+1
-1
| { | ||
| "name": "@cli4ai/postgres", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "description": "PostgreSQL read-only queries", | ||
@@ -5,0 +5,0 @@ "author": "cliforai", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
15965
9.58%4
33.33%0
-100%52
Infinity%