---
title: "Shipping psql without psql: a pure-TypeScript Postgres client in neonctl"
description: "neonctl now embeds a pure-TypeScript reimplementation of psql that activates when no native psql is on the PATH."
url: "https://swe.quest/articles/shipping-psql-without-psql-a-pure-typescript-postgres-client-in-neonctl-621e0ac130c536d1"
canonical: "https://neon.com/blog/shipping-psql-without-psql"
source: "Neon"
published: "2026-06-12"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["postgres","typescript","testing","ai-coding","developer-tools"]
---

# Shipping psql without psql: a pure-TypeScript Postgres client in neonctl

A post on [Neon](https://swe.quest/sources/neon.md), published 2026-06-12, 7 min read, Case study. Original: [https://neon.com/blog/shipping-psql-without-psql](https://neon.com/blog/shipping-psql-without-psql)

## Summary

neonctl now embeds a pure-TypeScript reimplementation of psql that activates when no native psql is on the PATH. It covers the REPL, all backslash commands, output formats, connection options, SCRAM and TLS, with no native dependencies, and it was written almost entirely by Claude Code under human review. Correctness rests on a conformance harness that fetches PostgreSQL's own regression scripts and diffs output byte-for-byte against a containerized server across PG 14–18, plus an adversarial security review that caught plausible-looking bugs such as a silent sslmode downgrade and a skippable SCRAM mutual-auth check. Lessons include regression-suite hidden setup (prerequisite tables, injected settings), fixing the first diff mismatch rather than the last, and runtime-dependent TLS behavior (BoringSSL under Bun vs OpenSSL under Node).

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)

## Prerequisites

- psql basics
- PostgreSQL wire protocol ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- TLS basics ([easy posts on Cryptography](https://swe.quest/tags/cryptography.md?difficulty=easy))

## Keywords

psql, neonctl, Neon, Claude Code, pg-protocol, SCRAM-SHA-256, testcontainers, BoringSSL

## Related posts

- [psql from the browser](https://swe.quest/articles/psql-from-the-browser-f27b7186b8abd76b.md): Neon · 2024-12-11 · Easy · 3 min read · PostgreSQL, Browsers, Developer tools, Open source
  psql.sh is a browser-based emulation of Postgres's psql client, built on Neon's WebSocket proxy and serverless driver because browsers can't open raw TCP connections.
- [@neondatabase/serverless hits 1.0.0](https://swe.quest/articles/neondatabase-serverless-hits-1-0-0-d5430675bc92b751.md): Neon · 2025-03-25 · Medium · 5 min read · PostgreSQL, Serverless, TypeScript, Application security, JavaScript
  Neon's JavaScript/TypeScript serverless driver, which carries Postgres queries over HTTP and WebSockets for environments without raw TCP such as V8 isolates and browsers, reaches 1.0.0 after a refactor that adds auto-generated types via api-extractor and CI tests across Node, Bun, Deno, browsers, Cloudflare Workers, Vercel and the Prisma/Drizzle adapters.
- [Edge-compatible Serverless Driver for Postgres](https://swe.quest/articles/edge-compatible-serverless-driver-for-postgres-9b0d09c6c7a067d0.md): Neon · 2022-12-08 · Medium · 9 min read · PostgreSQL, Serverless, Networking, Cryptography, WebAssembly
  Neon's @neondatabase/serverless driver lets V8-isolate platforms like Cloudflare Workers, which lack TCP, speak the real Postgres wire protocol by tunnelling it over a WebSocket to an open-source Go proxy that relays to TCP.
- [Web-based AI SQL Playground and connecting to Postgres from the browser](https://swe.quest/articles/web-based-ai-sql-playground-and-connecting-to-postgres-from-the-browser-fa7f4eccd9643a37.md): Neon · 2023-05-19 · Medium · 5 min read · PostgreSQL, LLMs, Serverless, JavaScript
  Neon's Postgres AI Playground connects to a Postgres database directly from the browser and uses OpenAI's gpt-3.5-turbo to turn natural-language prompts into SQL.
- [How Does psql -h pg.neon.tech Work?](https://swe.quest/articles/how-does-psql-h-pg-neon-tech-work-b4339dcc3b96f63b.md): Neon · 2024-08-14 · Medium · 3 min read · PostgreSQL, Identity & auth, Networking
  Neon's passwordless \`psql -h pg.neon.tech\` connects to a "Link Proxy", a server that speaks the Postgres wire protocol, rather than to a real Postgres instance.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
