Skip to main content

Getting Started with Typr

Typr is a type-safe code generator for JVM languages. It reads your database schemas and OpenAPI specifications, then generates fully-typed code that the compiler can verify.

Private Beta

Typr is currently in private beta. We're working with select teams to refine the experience before public release in early 2026.

Installation (available in beta)
cs install typr --channel https://typr.dev/channel

Via Homebrew (macOS)​

brew install oyvindberg/tap/typr

Via npm (Cross-platform)​

npm install -g @typr/cli

Direct Download​

# Download the latest release
curl -L https://github.com/oyvindberg/typr/releases/latest/download/typr -o typr
chmod +x typr

# Or as a JAR file
curl -L https://github.com/oyvindberg/typr/releases/latest/download/typr.jar -o typr.jar
java -jar typr.jar --help
Quick Start (available in beta)

1. Initialize​

typr init

Creates typr.yaml. You'll be prompted for language and first data source.

2. Configure​

Edit typr.yaml:

sources:
postgres:
type: postgresql
host: localhost
database: myapp
username: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}

output:
path: ./generated
package: com.myapp
language: java

3. Generate​

typr

That's it. Running typr without arguments generates code.

4. Use​

// Generated types are ready to use
UserRow user = userRepo.selectById(new UserId(123));

// Type-safe - can't mix up ID types
// userRepo.selectById(new OrderId(123)); // Compile error!

What's Next?​