Packages

Tern packages.

Beyond the standard library: a web framework, database clients and the rest of a server. Any git repository can be a package too.

tern search WORD          # find one
tern add roost            # add it to tern.mod and fetch it
tern add geo GIT-URL      # or any git repository

First-party packages

Maintained with the language, written the way any package is. tern add NAME writes one to tern.mod and pins its exact files in tern.lock; an installed Tern carries a copy, so it works offline. The database ones come with Tern for now, because the runtime works closely with them: just import them.

auth

JSON Web Tokens and signed-cookie sessions

tern add auth

grpc

A gRPC server (unary calls) over HTTP/2, in Tern: what OTLP/gRPC exporters and most unary clients need.

tern add grpc

migrate

Schema migrations for PostgreSQL and SQLite from numbered .sql files: up, down, status, locking

tern add migrate

openapi

OpenAPI 3.1 documents, Swagger UI and a typed TypeScript client from roost routes described with Tern types

tern add openapi

pg

A PostgreSQL client with a connection pool shared by tasks

tern add pg

queue

A client for ternq, the message queue broker.

tern add queue

redis

A Redis client with automatic pipelining

import redis comes with Tern

roost

A web framework on the http engine: routing, middleware, WebSockets, SSE, static files, uploads, validation, rate limits, metrics

tern add roost

sentry

Error reporting to Sentry: runtime errors with stack traces, request data, breadcrumbs

tern add sentry

sqlgen

Typed Tern functions generated from SQL queries, checked against PostgreSQL or SQLite (like sqlc)

tern add sqlgen

sqlite

SQLite databases with bound parameters and typed row reading

import sqlite comes with Tern

Publish your own

A package is a git repository with .tn files at the top. Push it, tag v0.1.0, and anyone can tern add it. There’s no account to create and nothing to upload. Fetching and building never run a package’s code, and every user sees what yours can reach (network, files, processes) before they accept an update that adds to it.