npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hesed/psql

v0.2.2

Published

CLI for PostgreSQL database interaction

Readme

psql

CLI for PostgreSQL database interaction

Version Downloads/week

Install

sdkck plugins install @hesed/psql

Usage

$ npm install -g @hesed/psql
$ pg COMMAND
running command...
$ pg (--version)
@hesed/psql/0.2.2 linux-x64 node-v22.22.1
$ pg --help [COMMAND]
USAGE
  $ pg COMMAND
...

Commands

pg psql auth add

Add a PostgreSQL connection profile

USAGE
  $ pg psql auth add -d <value> --host <value> -p <value> -P <value> --profile <value> -u <value> [--json] [--ssl]

FLAGS
  -P, --port=<value>      (required) PostgreSQL port
  -d, --database=<value>  (required) Database name
  -p, --password=<value>  (required) Password
  -u, --user=<value>      (required) Username
      --host=<value>      (required) PostgreSQL host
      --profile=<value>   (required) Profile name
      --[no-]ssl          Use SSL

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Add a PostgreSQL connection profile

EXAMPLES
  $ pg psql auth add

  $ pg psql auth add --no-ssl

See code: src/commands/psql/auth/add.ts

pg psql auth test

Test PostgreSQL database connection

USAGE
  $ pg psql auth test [--json] [--profile <value>]

FLAGS
  --profile=<value>  Profile name to test

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Test PostgreSQL database connection

EXAMPLES
  $ pg psql auth test

  $ pg psql auth test --profile staging

See code: src/commands/psql/auth/test.ts

pg psql auth update

Update an existing PostgreSQL connection profile

USAGE
  $ pg psql auth update -d <value> --host <value> -p <value> -P <value> -u <value> [--json] [--profile <value>] [--ssl]

FLAGS
  -P, --port=<value>      (required) PostgreSQL port
  -d, --database=<value>  (required) Database name
  -p, --password=<value>  (required) Password
  -u, --user=<value>      (required) Username
      --host=<value>      (required) PostgreSQL host
      --profile=<value>   Profile name to update
      --[no-]ssl          Use SSL

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Update an existing PostgreSQL connection profile

EXAMPLES
  $ pg psql auth update --ssl

  $ pg psql auth update --profile staging

See code: src/commands/psql/auth/update.ts

pg psql databases

List all databases accessible on the PostgreSQL server

USAGE
  $ pg psql databases [--profile <value>]

FLAGS
  --profile=<value>  Database profile name from config

DESCRIPTION
  List all databases accessible on the PostgreSQL server

EXAMPLES
  $ pg psql databases

  $ pg psql databases --profile staging

See code: src/commands/psql/databases.ts

pg psql describe-table TABLE

Describe the structure of a PostgreSQL table

USAGE
  $ pg psql describe-table TABLE [--format table|json|toon] [--profile <value>]

ARGUMENTS
  TABLE  Table name to describe

FLAGS
  --format=<option>  [default: table] Output format
                     <options: table|json|toon>
  --profile=<value>  Database profile name from config

DESCRIPTION
  Describe the structure of a PostgreSQL table

EXAMPLES
  $ pg psql describe-table users

  $ pg psql describe-table orders --format json --profile prod

See code: src/commands/psql/describe-table.ts

pg psql explain-query QUERY

Show the execution plan for a PostgreSQL query

USAGE
  $ pg psql explain-query QUERY [--format table|json|toon] [--profile <value>]

ARGUMENTS
  QUERY  SQL query to explain

FLAGS
  --format=<option>  [default: table] Output format
                     <options: table|json|toon>
  --profile=<value>  Database profile name from config

DESCRIPTION
  Show the execution plan for a PostgreSQL query

EXAMPLES
  $ pg psql explain-query "SELECT * FROM users WHERE id = 1"

  $ pg psql explain-query "SELECT * FROM orders JOIN users ON orders.user_id = users.id" --format json

See code: src/commands/psql/explain-query.ts

pg psql indexes TABLE

Show indexes for a PostgreSQL table

USAGE
  $ pg psql indexes TABLE [--format table|json|toon] [--profile <value>]

ARGUMENTS
  TABLE  Table name to show indexes for

FLAGS
  --format=<option>  [default: table] Output format
                     <options: table|json|toon>
  --profile=<value>  Database profile name from config

DESCRIPTION
  Show indexes for a PostgreSQL table

EXAMPLES
  $ pg psql indexes users

  $ pg psql indexes orders --format json --profile prod

See code: src/commands/psql/indexes.ts

pg psql query QUERY

Execute a SQL query against a PostgreSQL database

USAGE
  $ pg psql query QUERY [--format table|json|csv|toon] [--profile <value>] [--skip-confirmation]

ARGUMENTS
  QUERY  SQL query to execute

FLAGS
  --format=<option>    [default: table] Output format
                       <options: table|json|csv|toon>
  --profile=<value>    Database profile name from config
  --skip-confirmation  Skip confirmation prompt for destructive operations

DESCRIPTION
  Execute a SQL query against a PostgreSQL database

EXAMPLES
  $ pg psql query "SELECT * FROM users LIMIT 10"

  $ pg psql query "UPDATE users SET email = '[email protected]' WHERE id = 999" --format json

  $ pg psql query "DELETE FROM sessions" --profile prod --skip-confirmation

See code: src/commands/psql/query.ts

pg psql tables

List all tables in the current PostgreSQL database

USAGE
  $ pg psql tables [--profile <value>]

FLAGS
  --profile=<value>  Database profile name from config

DESCRIPTION
  List all tables in the current PostgreSQL database

EXAMPLES
  $ pg psql tables

  $ pg psql tables --profile local

See code: src/commands/psql/tables.ts