Getting started

Installation

Add lttr to a Go module, set up access to the private repository, and install the CLI.

Check your Go version

lttr needs Go 1.25 or newer.

Terminal
go version

Configure private module access

sulv-io/lttr is a private repository. The public module proxy and checksum database cannot read it, so go get fails until you tell Go to fetch it directly and give Git a credential that can read it. You do this once per machine.

Mark the module as private

Terminal
go env -w GOPRIVATE='github.com/sulv-io/*'

GOPRIVATE sets GONOPROXY and GONOSUMDB to the same pattern, so Go fetches anything under github.com/sulv-io/ straight from GitHub and skips the checksum lookup that would fail on a repository it cannot see.

Let Git authenticate

Go fetches modules over HTTPS. Rewrite those URLs to carry a token that can read the repository:

Terminal
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/sulv-io/".insteadOf "https://github.com/sulv-io/"

If you already use an SSH key with GitHub, rewrite to SSH instead and no token is stored:

Terminal
git config --global url."git@github.com:sulv-io/".insteadOf "https://github.com/sulv-io/"

Verify

Terminal
go env GOPRIVATE
git ls-remote https://github.com/sulv-io/lttr HEAD

The first prints github.com/sulv-io/*. The second prints a commit hash. If it asks for a password or reports Repository not found, the credential is the problem, not Go.

The token form writes the token in cleartext to ~/.gitconfig. On a workstation prefer SSH; in CI, inject a short-lived token as an environment variable.

Add the module

Terminal
go get github.com/sulv-io/lttr@latest

lttr depends on two modules besides the standard library: goldmark, which the comark parser extends, and yaml.v3, which reads kit.yaml and frontmatter.

Most services import the root package, kit, and one shipped kit:

Import pathWhat it holds
github.com/sulv-io/lttrCompile, MustCompile, Template, Renderer, Config, Profile, Recipient, Message, Sender, SMTP
github.com/sulv-io/lttr/kitLoad, Types, Funcs, the *kit.Kit your own kit loads into
github.com/sulv-io/lttr/kits/plainMustKit(), the small starter kit
github.com/sulv-io/lttr/kits/quietMustKit(), the complete example kit

The pipeline packages (comark, data, ir, render, render/html, render/text) are exported for tools and tests. You rarely import them directly.

lttr is pre-1.0, so the API can still change between minor versions. Check which version you resolved with go list -m github.com/sulv-io/lttr.

Install the CLI

Terminal
go install github.com/sulv-io/lttr/cmd/lttr@latest
lttr -h
Output
usage: lttr <command> [flags]

commands:
  preview      render every sample to a directory with an index page
  render       write one sample's .eml to stdout
  lint         compile, render and check template files
  tags         list a template's merge tags and bindings
  serve        the studio: a live preview of the samples that reloads on save
  kit init     start a new kit in a directory, copied from Plain
  kit check    load a kit, render its samples and check the HTML

-kit selects the kit: quiet (the default: the example templates), plain,
or a kit directory. Run "lttr <command> -h" for a command's flags.

The CLI's default kit is Quiet: examples/quiet's nine reference emails, with typed sample data. Use it to see the design, try a component or check a change to the library. lttr serve reads Quiet's templates from examples/quiet/templates by default, so run it from a checkout of the repository or pass -dir. Point -kit at plain, or at a directory (./mykit) to work on your own kit; a kit that binds Go types can only be checked from Go, not the CLI (see Go types and funcs). See CLI and Goldens and testing.

Next steps

Copyright © 2026